protected override void OnTick() { if (m_Chest != null) { m_Chest.Delete(); } int x = Utility.Random(m_Rect.X, m_Rect.Width); int y = Utility.Random(m_Rect.Y, m_Rect.Height); int itemID = Utility.RandomList(m_Chest.ItemIDs); GuardianTreasureChest chest = new GuardianTreasureChest(itemID); chest.MoveToWorld(new Point3D(x, y, -1), Map.Malas); }
public void Setup() { m_Door = new GuardianDoor(DoorFacing.SouthCW); m_Door.MoveToWorld(new Point3D(355, 15, -1), Map.Malas); m_CanActive = true; for (int i = 0; i < 3; i++) { int x = Utility.Random(Rect.X, Rect.Width); int y = Utility.Random(Rect.Y, Rect.Height); GuardianTreasureChest chest = new GuardianTreasureChest(0xE41); int itemID = Utility.RandomList(chest.ItemIDs); chest.ItemID = itemID; chest.MoveToWorld(new Point3D(x, y, -1), Map.Malas); } }
public InternalTimer(GuardianTreasureChest chest) : base(TimeSpan.FromMinutes(1.0)) { m_Chest = chest; }
protected override void OnTick() { if ( m_Chest != null ) m_Chest.Delete(); int x = Utility.Random( m_Rect.X, m_Rect.Width ); int y = Utility.Random( m_Rect.Y, m_Rect.Height ); int itemID = Utility.RandomList( m_Chest.ItemIDs ); GuardianTreasureChest chest = new GuardianTreasureChest( itemID ); chest.MoveToWorld( new Point3D( x, y, -1 ), Map.Malas ); }
public InternalTimer( GuardianTreasureChest chest ) : base(TimeSpan.FromMinutes( 1.0 )) { m_Chest = chest; }
public override void OnMovement(Mobile m, Point3D oldLocation) { if (!Rect.Contains(m.Location) || m is BaseCreature) { return; } if (m != null && m_Door != null && !m_Door.Locked && !m_Door.Open && m_Door.Link != null && !m_Door.Link.Locked && !m_Door.Link.Open && m.IsPlayer && m.Alive && m_CanActive) { m_CanActive = false; //Carrabas: Moved this here so it will not execute the OnMovement more than once while executing the loops int guardianCount = 0; foreach (var mobile in Map.GetMobilesInBounds(Rect).ToArray()) { if (!(mobile is DarkGuardian)) { if (mobile.IsPlayer) { mobile.SendLocalizedMessage(1050000, null, 0x41); // The locks on the door click loudly and you begin to hear a faint hissing near the walls. } guardianCount += 2; } } if (guardianCount > 12) { guardianCount = 12; } for (int j = 0; j < guardianCount; j++) { DarkGuardian guard = new DarkGuardian(); guard.Map = Map.Malas; guard.Location = guard.Map.GetSpawnPosition(new Point3D(365, 15, -1), 8); } for (int i = 0; i < 5; i++) { int x = Utility.Random(Rect.X, Rect.Width); int y = Utility.Random(Rect.Y, Rect.Height); GuardianTreasureChest chest = new GuardianTreasureChest(0xE41); int itemID = Utility.RandomList(chest.ItemIDs); chest.ItemID = itemID; chest.MoveToWorld(new Point3D(x, y, -1), Map.Malas); } m_Door.Locked = true; m_Door.Link.Locked = true; if (m_Timer != null) { m_Timer.Stop(); } m_Timer = new PoisonTimer(this); m_Timer.Start(); } }
public InternalTimer(GuardianTreasureChest chest) : base(TimeSpan.FromMinutes(Utility.Random(1, 2))) { m_Chest = chest; }