public void SpawnBaddie(Mobile m) { if (Elementals == null) { return; } Point3D p = m.Location; for (int i = 0; i < 10; i++) { int x = Utility.RandomMinMax(p.X - 1, p.X + 1); int y = Utility.RandomMinMax(p.Y - 1, p.Y + 1); if (Map.TerMur.CanSpawnMobile(x, y, -20)) { p = new Point3D(x, y, -20); break; } } BaseCreature creature = new HurricaneElemental(); creature.MoveToWorld(p, Map.TerMur); Elementals.Add(creature); creature.Combatant = m; }
private void SpawnRandomElemental() { if (Elementals == null) { return; } Rectangle2D rec = SpawnRecs[Utility.RandomMinMax(0, 3)]; ConvertOffset(ref rec); while (true) { int x = Utility.RandomMinMax(rec.X, rec.X + rec.Width); int y = Utility.RandomMinMax(rec.Y, rec.Y + rec.Height); int z = Map.TerMur.GetAverageZ(x, y); if (Map.TerMur.CanSpawnMobile(x, y, z)) { BaseCreature elemental = new VileWaterElemental(); elemental.MoveToWorld(new Point3D(x, y, z), Map.TerMur); Elementals.Add(elemental); break; } } }