public void SpawnBlackCat(Mobile m) { Map map = this.Map; if (map == null) { return; } BlackCat spawned = new BlackCat(); spawned.Team = this.Team; bool validLocation = false; Point3D loc = this.Location; for (int j = 0; !validLocation && j < 10; ++j) { int x = X + Utility.Random(3) - 1; int y = Y + Utility.Random(3) - 1; int z = map.GetAverageZ(x, y); if (validLocation = map.CanFit(x, y, this.Z, 16, false, false)) { loc = new Point3D(x, y, Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { loc = new Point3D(x, y, z); } } spawned.MoveToWorld(loc, map); spawned.Combatant = m; }
public void SpawnBlackCat(Mobile target) { Map map = this.Map; if (map == null) { return; } int newBlackCat = Utility.RandomMinMax(1, 2); for (int i = 0; i < newBlackCat; ++i) { BlackCat BlackCat = new BlackCat(); BlackCat.Team = this.Team; BlackCat.FightMode = FightMode.Closest; bool validLocation = false; Point3D loc = this.Location; for (int j = 0; !validLocation && j < 10; ++j) { int x = X + Utility.Random(3) - 1; int y = Y + Utility.Random(3) - 1; int z = map.GetAverageZ(x, y); if (validLocation = map.CanFit(x, y, this.Z, 16, false, false)) { loc = new Point3D(x, y, Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { loc = new Point3D(x, y, z); } } BlackCat.MoveToWorld(loc, map); BlackCat.Combatant = target; } }
public void SpawnBlackCat( Mobile target ) { Map map = this.Map; if ( map == null ) return; int newBlackCat = Utility.RandomMinMax( 1, 2 ); for ( int i = 0; i < newBlackCat; ++i ) { BlackCat BlackCat = new BlackCat(); BlackCat.Team = this.Team; BlackCat.FightMode = FightMode.Closest; bool validLocation = false; Point3D loc = this.Location; for ( int j = 0; !validLocation && j < 10; ++j ) { int x = X + Utility.Random( 3 ) - 1; int y = Y + Utility.Random( 3 ) - 1; int z = map.GetAverageZ( x, y ); if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) ) loc = new Point3D( x, y, Z ); else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) ) loc = new Point3D( x, y, z ); } BlackCat.MoveToWorld( loc, map ); BlackCat.Combatant = target; } }