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
            /// <summary>
            /// This function is called to close the door 10 seconds after it was opened
            /// </summary>
            protected override void OnTick()
            {
                GameDoor door = (GameDoor)m_actionSource;

                door.Close();
            }
Example #3
0
 /// <summary>
 /// Constructs a new close door action
 /// </summary>
 /// <param name="door">The door that should be closed</param>
 public CloseDoorAction(GameDoor door)
     : base(door)
 {
 }
Example #4
0
 /// <summary>
 /// Constructs a new close door action
 /// </summary>
 /// <param name="door">The door that should be closed</param>
 public CloseDoorAction(GameDoor door)
     : base(door)
 {
 }