Exemple #1
0
        public void Teleport(UInt16 ZoneID, UInt32 WorldX, UInt32 WorldY, UInt16 WorldZ, UInt16 WorldO)
        {
            Log.Info("Player", "Teleport : " + ZoneID + "," + WorldX + "," + WorldY + "," + WorldZ);

            Zone_Info Info = WorldMgr.GetZone_Info(ZoneID);

            if (Info == null)
            {
                return;
            }

            // Change Region , so change thread and maps
            if (Zone == null || Zone.Info.Region != Info.Region)
            {
                RegionMgr NewRegion = WorldMgr.GetRegion(Info.Region, true);
                if (NewRegion != null)
                {
                    ZoneMgr NewZone = NewRegion.GetZoneMgr(Info.ZoneId, true);
                    Teleport(NewZone, WorldX, WorldY, WorldZ, WorldO);
                }
            }
            else // Teleport in current Zone
            {
                SafeWorldTeleport(WorldX, WorldY, WorldZ, WorldO);
            }
        }
Exemple #2
0
        static public List <Zone_Taxi> GetTaxis(Player Plr)
        {
            List <Zone_Taxi> L = new List <Zone_Taxi>();

            foreach (Zone_Taxi[] Taxis in WorldMgr._Zone_Taxi.Values)
            {
                if (Taxis[(byte)Plr.Realm] == null || Taxis[(byte)Plr.Realm].WorldX == 0)
                {
                    continue;
                }

                if (Taxis[(byte)Plr.Realm].Info == null)
                {
                    Taxis[(byte)Plr.Realm].Info = WorldMgr.GetZone_Info(Taxis[(byte)Plr.Realm].ZoneID);
                }

                if (Taxis[(byte)Plr.Realm].Info == null)
                {
                    continue;
                }

                L.Add(Taxis[(byte)Plr.Realm]);
            }

            return(L);
        }
Exemple #3
0
        public void Teleport(UInt16 ZoneID, UInt32 WorldX, UInt32 WorldY, UInt16 WorldZ, UInt16 WorldO)
        {
            Log.Info("Player", "Teleport : " + ZoneID + "," + WorldX + "," + WorldY + "," + WorldZ);


            // ADDED THIS TO GIVE ME INFO// also use this kind of thing for portal not open
            SendLocalizeString("ZoneID=" + ZoneID + "," + WorldX + "," + WorldY + "," + WorldZ + "," + WorldO, GameData.Localized_text.CHAT_TAG_DEFAULT);


            Zone_Info Info = WorldMgr.GetZone_Info(ZoneID);

            if (Info == null)
            {
                return;
            }

            // Change Region , so change thread and maps
            if (Zone == null || Zone.Info.Region != Info.Region)
            {
                RegionMgr NewRegion = WorldMgr.GetRegion(Info.Region, true);
                if (NewRegion != null)
                {
                    ZoneMgr NewZone = NewRegion.GetZoneMgr(Info.ZoneId, true);
                    Teleport(NewZone, WorldX, WorldY, WorldZ, WorldO);
                }
            }
            else // Teleport in current Zone
            {
                SafeWorldTeleport(WorldX, WorldY, WorldZ, WorldO);
            }
        }
Exemple #4
0
        static public void CalculWorldPosition(UInt16 ZoneID, ushort PinX, ushort PinY, ushort PinZ, ref int WorldX, ref int WorldY, ref int WorldZ)
        {
            Zone_Info Info = WorldMgr.GetZone_Info(ZoneID);

            if (Info == null)
            {
                return;
            }

            int x = PinX > 32768 ? PinX - 32768 : PinX;
            int y = PinY > 32768 ? PinY - 32768 : PinY;

            WorldX = (int)((int)CalcOffset(Info, PinX, true) + ((int)((int)x) & 0x00000FFF));
            WorldY = (int)((int)CalcOffset(Info, PinY, false) + ((int)((int)y) & 0x00000FFF));
            WorldZ = PinZ;
            if (Info.ZoneId == 161)
            {
                WorldZ += 16384;
            }
        }