public void ResetLevel3Spawners(Map map) { Server.Region r = Server.Region.Find(new Point3D(5574, 1859, 0), map); foreach (Item item in r.GetEnumeratedItems().Where(i => i is ISpawner && i.X >= 5501 && i.X <= 5627 && i.Y >= 1799 && i.Y <= 1927)) { if (item is XmlSpawner) { ((XmlSpawner)item).DoReset = true; } else if (item is Spawner) { ((Spawner)item).RemoveSpawned(); ((Spawner)item).Running = false; } } }
public static bool HasType(Region r, Type t) { if (r == null) return false; if (t.IsSubclassOf(typeof(Mobile))) { foreach (Mobile m in r.GetEnumeratedMobiles()) { if (m.GetType() == t) return true; } } else if (t.IsSubclassOf(typeof(Item))) { foreach (Item i in r.GetEnumeratedItems()) { if (i.GetType() == t) return true; } } return false; }