public void Activate(Mobile m) { CheckDoors(); DoorOne.Open = false; DoorTwo.Open = false; DoorOne.Locked = true; DoorTwo.Locked = true; Effects.PlaySound(DoorOne.Location, DoorOne.Map, 0x241); Effects.PlaySound(DoorTwo.Location, DoorTwo.Map, 0x241); if (Guardians == null) { Guardians = new List <DarkGuardian>(); } int count = 0; foreach (var mob in this.GetEnumeratedMobiles().Where(mob => mob is PlayerMobile || (mob is BaseCreature && ((BaseCreature)mob).GetMaster() != null && !mob.IsDeadBondedPet))) { if (mob.NetState != null) { mob.SendLocalizedMessage(1050000, "", 365); // The locks on the door click loudly and you begin to hear a faint hissing near the walls. } if (mob.Alive) { count++; } } count = Math.Max(1, count * 2); for (int i = 0; i < count; i++) { DarkGuardian guardian = new DarkGuardian(); int x = Utility.RandomMinMax(PentagramBounds.X, PentagramBounds.X + PentagramBounds.Width); int y = Utility.RandomMinMax(PentagramBounds.Y, PentagramBounds.Y + PentagramBounds.Height); int z = Map.Malas.GetAverageZ(x, y); guardian.MoveToWorld(new Point3D(x, y, z), Map.Malas); Guardians.Add(guardian); guardian.Combatant = m; } if (m_Timer != null) { m_Timer.Stop(); m_Timer = null; } m_Timer = new InternalTimer(this); m_Timer.Start(); }
public void Activate(Mobile m) { CheckDoors(); DoorOne.Open = false; DoorTwo.Open = false; DoorOne.Locked = true; DoorTwo.Locked = true; Effects.PlaySound(DoorOne.Location, DoorOne.Map, 0x241); Effects.PlaySound(DoorTwo.Location, DoorTwo.Map, 0x241); if (Guardians == null) { Guardians = new List <DarkGuardian>(); } int count = MobileCount() * 2; for (int i = 0; i < count; i++) { DarkGuardian guardian = new DarkGuardian(); int x = Utility.RandomMinMax(PentagramBounds.X, PentagramBounds.X + PentagramBounds.Width); int y = Utility.RandomMinMax(PentagramBounds.Y, PentagramBounds.Y + PentagramBounds.Height); int z = Map.Malas.GetAverageZ(x, y); guardian.MoveToWorld(new Point3D(x, y, z), Map.Malas); Guardians.Add(guardian); guardian.Combatant = m; } if (m_Timer != null) { m_Timer.Stop(); m_Timer = null; } m_Timer = new InternalTimer(this); m_Timer.Start(); }