Exemple #1
0
 public ZoneMgr(RegionMgr Region,Zone_Info Info)
 {
     this.Region = Region;
     this.ZoneId = Info.ZoneId;
     this.Info = Info;
     this.Running = true;
     this.ClientInfo = ClientFileMgr.GetZoneInfo(Info.ZoneId);
 }
Exemple #2
0
 public ZoneMgr(RegionMgr Region,Zone_Info Info)
 {
     this.Region = Region;
     this.ZoneId = Info.ZoneId;
     this.Info = Info;
     this.Running = true;
     this.AreaInfo = AreaMapMgr.GetAreaInfo(Info.ZoneId);
 }
Exemple #3
0
        public static UInt16 CalculPin(Zone_Info Info, int WorldPos, bool x)
        {
            UInt16 Pin = 0;

            int BaseOffset = x ? Info.OffX << 12 : Info.OffY << 12;
            if (BaseOffset <= WorldPos)
                Pin = (UInt16)(WorldPos - BaseOffset);

            return Pin;
        }
Exemple #4
0
        public static Point3D CalculWorldPosition(Zone_Info Info, UInt16 PinX, UInt16 PinY, UInt16 PinZ)
        {
            int x = PinX > 32768 ? PinX - 32768 : PinX;
            int y = PinY > 32768 ? PinY - 32768 : PinY;
            Point3D WorldPosition = new Point3D(0, 0, 0);

            WorldPosition.X = (int)((int)CalcOffset(Info,PinX,true) + ((int)((int)x) & 0x00000FFF));
            WorldPosition.Y = (int)((int)CalcOffset(Info, PinY, false) + ((int)((int)y) & 0x00000FFF));
            WorldPosition.Z = PinZ / 2;
            if (Info.ZoneId == 161)
                WorldPosition.Z = (32768 + PinZ) / 2;

            return WorldPosition;
        }
Exemple #5
0
 static public uint CalcOffset(Zone_Info Info, UInt16 Pin, bool x)
 {
     return (UInt32)Math.Truncate((decimal)(Pin / 4096 + (x ? Info.OffX : Info.OffY))) << 12;
 }