public static void F_FLIGHT(BaseClient client, PacketIn packet)
        {
            GameClient cclient = (GameClient)client;

            ushort targetOid = packet.GetUint16();
            ushort state     = packet.GetUint16();

            if (state == 20) // Flight Master
            {
                Creature flightMaster = cclient.Plr.Region.GetObject(targetOid) as Creature;

                if (flightMaster == null || flightMaster.InteractType != InteractType.INTERACTTYPE_FLIGHT_MASTER || cclient.Plr.Get2DDistanceToObject(flightMaster, true) > FLIGHT_DISTANCE_TOLERANCE)
                {
                    cclient.Plr.SendLocalizeString(ChatLogFilters.CHATLOGFILTERS_USER_ERROR, Localized_text.TEXT_FLIGHT_MASTER_RANGE_ERR);
                    return;
                }

                ushort destId = packet.GetUint16();

                List <Zone_Taxi> destinations = WorldMgr.GetTaxis(cclient.Plr);

                if (destinations.Count <= destId - 1)
                {
                    return;
                }

                Zone_Taxi destination = destinations[destId - 1];

                if (!cclient.Plr.RemoveMoney(destination.Info.Price))
                {
                    cclient.Plr.SendLocalizeString(ChatLogFilters.CHATLOGFILTERS_USER_ERROR, Localized_text.TEXT_FLIGHT_LACK_FUNDS);
                    return;
                }

                Pet pet = cclient.Plr.CrrInterface.GetTargetOfInterest() as Pet;
                if (pet != null)
                {
                    pet.Destroy();
                }
                cclient.Plr.AbtInterface.ResetCooldowns();
                cclient.Plr.Teleport(destination.ZoneID, destination.WorldX, destination.WorldY, destination.WorldZ, destination.WorldO);
            }
        }
Esempio n. 2
0
        static public void LoadZone_Taxi()
        {
            Log.Debug("LoadZone_Info", "Loading Zone_Taxis...");

            IList <Zone_Taxi> Taxis = Database.SelectAllObjects <Zone_Taxi>();

            _Zone_Taxi = new Dictionary <UInt16, Zone_Taxi[]>();

            foreach (Zone_Taxi Taxi in Taxis)
            {
                Zone_Taxi[] Tax;
                if (!_Zone_Taxi.TryGetValue(Taxi.ZoneID, out Tax))
                {
                    Tax = new Zone_Taxi[(int)(GameData.Realms.REALMS_NUM_REALMS) + 1];
                    _Zone_Taxi.Add(Taxi.ZoneID, Tax);
                }

                _Zone_Taxi[Taxi.ZoneID][Taxi.RealmID] = Taxi;
            }

            Log.Success("LoadZone_Info", "Loaded " + Taxis.Count + " Zone_Taxis");
        }