private GaryTheDungeonMaster GetGary() { if (Gary == null || Gary.Deleted) { GaryTheDungeonMaster gary = null; IPooledEnumerable eable = Map.GetMobilesInBounds(_Bounds[0]); foreach (Mobile m in eable) { if (m is GaryTheDungeonMaster) { gary = (GaryTheDungeonMaster)m; break; } } eable.Free(); if (gary != null) { Gary = gary; Gary.MoveToWorld(_GaryLoc, Map.Malas); } else { Gary = new GaryTheDungeonMaster(); Gary.MoveToWorld(_GaryLoc, Map.Malas); } } return(Gary); }
private GaryTheDungeonMaster GetGary() { if (Gary == null || Gary.Deleted) { GaryTheDungeonMaster gary = this.GetEnumeratedMobiles().OfType <GaryTheDungeonMaster>().FirstOrDefault(m => m is GaryTheDungeonMaster && !m.Deleted); if (gary != null) { Gary = gary; Gary.MoveToWorld(_GaryLoc, Map.Malas); } else { Gary = new GaryTheDungeonMaster(); Gary.MoveToWorld(_GaryLoc, Map.Malas); } } return(Gary); }
public override void OnEnter(Mobile m) { GaryTheDungeonMaster g = GetGary(); g.SayTo(m, 1080098); // Ah... visitors! }
public void DoRoll() { GaryTheDungeonMaster g = GetGary(); Sapphired20 d = GetDice(); int roll = ForceRoll >= 0 && ForceRoll < 20 ? ForceRoll : Utility.Random(20); g.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1080099); // *Gary rolls the sapphire d20* BaseDoor door1 = GetDoor1(); BaseDoor door2 = GetDoor2(); door1.Locked = true; door2.Locked = true; Timer.DelayCall(TimeSpan.FromMinutes(2), () => { door1.Locked = false; door2.Locked = false; }); Timer.DelayCall(TimeSpan.FromSeconds(1), () => { if (d != null) { d.Roll(roll); } else { foreach (PlayerMobile m in GetEnumeratedMobiles().OfType <PlayerMobile>()) { m.SendMessage("- {0} -", (roll + 1).ToString()); } } }); Timer.DelayCall(TimeSpan.FromSeconds(2), () => { if (roll == 19) { DoStaffSpawn(); } else { Spawn = Activator.CreateInstance(_MonsterList[roll]) as BaseCreature; Spawn.Kills = 100; if (Spawn is Dragon) { Spawn.Body = 155; Spawn.CorpseNameOverride = "a rotting corpse"; } Spawn.MoveToWorld(_SpawnLoc, Map.Malas); Spawn.Home = _SpawnLoc; Spawn.RangeHome = 7; } ChangeStatues(); }); ForceRoll = -1; }