//Type type = m_Owner.GetType(); protected override void OnTick() { if (m_Owner.Deleted) { Stop(); return; } IPooledEnumerable eable = m_Owner.GetMobilesInRange(10); foreach (Mobile m in eable) { if (m == null || !(m is PlayerMobile)) { continue; } if (m_Owner.CanBeHarmful(m) && m_Owner.Mana >= 100) { m_Owner.Mana -= 50; int ownerlocX = m_Owner.Location.X + Utility.RandomMinMax(-5, 5); int ownerlocY = m_Owner.Location.Y + Utility.RandomMinMax(-5, 5); int ownerlocZ = m_Owner.Location.Z; Efreet NewMobile = new Efreet(); NewMobile.MoveToWorld(new Point3D(ownerlocX, ownerlocY, ownerlocZ), m_Owner.Map); NewMobile.Combatant = m; } } eable.Free(); }
public void SummonCritters() { int SummonRange; Mobile SummonTarget; Map map = this.Map; if (map == null) { return; } int CritterNum = Utility.Random(8); int newCritters = Utility.RandomMinMax(4, 8); int critters = 0; foreach (Mobile m in this.GetMobilesInRange(15)) { if (m is PredatorHellCat || m is FireSteed || m is Nightmare || m is FireGargoyle || m is HellHound || m is Gargoyle || m is LavaElemental || m is Efreet) { ++critters; } } if (critters < 16) { for (int i = 0; i < newCritters; ++i) { BaseCreature critter; switch (CritterNum) { default: case 0: critter = new PredatorHellCat(); break; case 1: critter = new FireSteed(); break; case 2: critter = new Nightmare(); break; case 3: critter = new FireGargoyle(); break; case 4: critter = new HellHound(); break; case 5: critter = new Gargoyle(); break; case 6: critter = new LavaElemental(); break; case 7: critter = new Efreet(); break; } critter.Team = this.Team; bool validLocation = false; Point3D loc = this.Location; for (int j = 0; !validLocation && j < 10; ++j) { int x = X + Utility.Random(8) - 1; int y = Y + Utility.Random(8) - 1; int z = map.GetAverageZ(x, y); if (validLocation = map.CanFit(x, y, Z, 16, false, false)) { loc = new Point3D(x, y, this.Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { loc = new Point3D(x, y, z); } } critter.MoveToWorld(loc, map); } } }