Esempio n. 1
0
        /// <summary>
        /// Overloaded Actions on dialog select event
        /// changed: 02.10.05
        /// </summary>
        public override void DialogCharacterSelection( Character c, int id, int num )
        {
            switch ( (NPCMenuId)id )
            {
                case NPCMenuId.MainMenu:// main menu
                {
                    switch ( (NPCSubMenuId)num )
                    {
                        case NPCSubMenuId.Taxi:
                        {
                            if ( Taxi ) //check for cracks
                            {
                                c.EndGossip();
                                return;//do taxi events
                            }
                            else break;
                        }
                        case NPCSubMenuId.Vendor:
                        {
                            if ( Vendor || InKeeper )  //check for cracks
                            {
                                c.ShowMobileInventory( Guid );
                                return;
                            }
                            else break;
                        }
                        case NPCSubMenuId.Trainer:
                        {
                            if ( Trainer )  //check for cracks
                            {
                                c.TrainerList( Guid );
                                return;
                            }
                            else break;
                        }
                        case NPCSubMenuId.Banker:
                        {
                            if ( Banker )  //check for cracks
                            {
                                c.EndGossip();
                                return;//do Banker events
                            }
                            else break;
                        }
                        case NPCSubMenuId.InKeeperBind://binder
                        {
                            if ( InKeeper ) //check for cracks
                            {
                                bool hsExist = false;
                                foreach ( Item it in c.Items )
                                {
                                    if ( it != null && it.Id == 6948 )
                                    {
                                        hsExist = true; break;
                                    }
                                }

                                if ( !hsExist )//+Check for existing heartstone and if not exist - add to BP.
                                {
                                    Item it = World.CreateItemInPoolById( 6948 ); //c.CreateAndAddObject( "Hearthstone" );
                                    if ( it != null ) c.PutObjectInBackpack( it, true );
                                }
                                // Check for distance from user to inkeeper
                                c.BindingPointX = c.X;
                                c.BindingPointY = c.Y;
                                c.BindingPointZ = c.Z;
                                c.BindingPointMapId = c.MapId;
                                c.EndGossip();
                                BindPointEffect( c );
                                return;
                            }
                            else break;
                        }
                        case NPCSubMenuId.InKeeperMsg://gossip
                        {
                            if ( InKeeper )
                            {
                                c.EndGossip();
                                return;//do InKeeper events
                            }
                            else break;
                        }
                    }
                    c.ResponseMessage( this, (int)NPCMenuId.Hello, Message_Hello );	// if error in some dialogs
                    return;
                }
            }
            if ( c.GossipOpened ) c.EndGossip();
        }