Example #1
0
		public static bool LoadDoor(DBDoor door)
		{
			IDoor mydoor = null;
			ushort zone = (ushort)(door.InternalID / 1000000);

			Zone currentZone = WorldMgr.GetZone(zone);
			if (currentZone == null) return false;
			
			//check if the door is a keep door
			foreach (AbstractArea area in currentZone.GetAreasOfSpot(door.X, door.Y, door.Z))
			{
				if (area is KeepArea)
				{
					mydoor = new GameKeepDoor();
					mydoor.LoadFromDatabase(door);
					break;
				}
			}

			//if the door is not a keep door, create a standard door
			if (mydoor == null)
			{
				mydoor = new GameDoor();
				mydoor.LoadFromDatabase(door);
			}

			//add to the list of doors
			if (mydoor != null)
			{
				RegisterDoor(mydoor);
			}

			return true;
		}
Example #2
0
        public static bool LoadDoor(DBDoor door)
        {
            IDoor  mydoor = null;
            ushort zone   = (ushort)(door.InternalID / 1000000);

            Zone currentZone = WorldMgr.GetZone(zone);

            if (currentZone == null)
            {
                return(false);
            }

            // check if the door is a keep door
            foreach (AbstractArea area in currentZone.GetAreasOfSpot(door.X, door.Y, door.Z))
            {
                if (area is KeepArea)
                {
                    mydoor = new GameKeepDoor();
                    mydoor.LoadFromDatabase(door);
                    break;
                }
            }

            // if the door is not a keep door, create a standard door
            if (mydoor == null)
            {
                mydoor = new GameDoor();
                mydoor.LoadFromDatabase(door);
            }

            // add to the list of doors
            if (mydoor != null)
            {
                RegisterDoor(mydoor);
            }

            return(true);
        }