//// public void SpawnEvil(Mobile target) { Map map = this.Map; if (map == null) { return; } int spawned = 0; foreach (Mobile m in this.GetMobilesInRange(10)) { if (m is Skeleton || m is Executioner || m is EvilNecromancer) { ++spawned; } } if (spawned < 10) { int newSpawned = Utility.RandomMinMax(1, 6); for (int i = 0; i < newSpawned; ++i) { BaseCreature spawn; switch (Utility.Random(5)) { default: case 0: case 1: spawn = new Skeleton(); break; case 2: case 3: spawn = new Executioner(); break; case 4: spawn = new EvilNecromancer(); break; } spawn.Team = this.Team; spawn.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)) { spawn.Location = new Point3D(x, y, Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { spawn.Location = new Point3D(x, y, z); } } if (!validLocation) { spawn.Location = this.Location; } spawn.Combatant = target; } } }
//// public void SpawnEvil( Mobile target ) { Map map = this.Map; if ( map == null ) return; int spawned = 0; foreach ( Mobile m in this.GetMobilesInRange( 10 ) ) { if ( m is Skeleton || m is Executioner || m is EvilNecromancer ) ++spawned; } if ( spawned < 10 ) { int newSpawned = Utility.RandomMinMax( 1, 6 ); for ( int i = 0; i < newSpawned; ++i ) { BaseCreature spawn; switch ( Utility.Random( 5 ) ) { default: case 0: case 1: spawn = new Skeleton(); break; case 2: case 3: spawn = new Executioner(); break; case 4: spawn = new EvilNecromancer(); break; } spawn.Team = this.Team; spawn.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 ) ) spawn.Location = new Point3D( x, y, Z ); else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) ) spawn.Location = new Point3D( x, y, z ); } if ( !validLocation ) spawn.Location = this.Location; spawn.Combatant = target; } } }