public void SpawnEvilPirate(Mobile m) { Map map = this.Map; if (map == null) { return; } EvilPirate spawned = new EvilPirate(); spawned.Team = this.Team; spawned.Map = map; bool validLocation = false; 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)) { spawned.Location = new Point3D(x, y, Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { spawned.Location = new Point3D(x, y, z); } } if (!validLocation) { spawned.Location = this.Location; } spawned.Combatant = m; }
public void SpawnEvilPirate( Mobile m ) { Map map = this.Map; if ( map == null ) return; EvilPirate spawned = new EvilPirate(); spawned.Team = this.Team; spawned.Map = map; bool validLocation = false; 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 ) ) spawned.Location = new Point3D( x, y, Z ); else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) ) spawned.Location = new Point3D( x, y, z ); } if ( !validLocation ) spawned.Location = this.Location; spawned.Combatant = m; }