public void SpawnDreadSpider(Mobile target) { Map map = target.Map; if (map == null) { return; } int dreadspiders = 0; foreach (Mobile m in this.GetMobilesInRange(10)) { if (m is DreadSpider) { ++dreadspiders; } } if (dreadspiders < 10) { BaseCreature dreadspider = new DreadSpider(); dreadspider.Team = this.Team; Point3D loc = target.Location; bool validLocation = false; for (int j = 0; !validLocation && j < 10; ++j) { int x = target.X + Utility.Random(3) - 1; int y = target.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); } } dreadspider.MoveToWorld(loc, map); dreadspider.Combatant = target; } }
private void SpawnRandom() { Point3D loc = Location; BaseCreature creature = null; switch (Utility.Random(5)) { case 0: case 1: creature = new TheCursed(); break; case 2: creature = new DreadSpider(); break; case 3: creature = new HellHound(); break; case 4: creature = new PredatorHellCat(); break; } Effects.SendLocationParticles(EffectItem.Create(loc, Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); Effects.PlaySound(loc, Map, 0x1FE); creature.MoveToWorld(loc, Map); }
public void SpawnDreadSpider( Mobile target ) { Map map = target.Map; if ( map == null ) return; int dreadspiders = 0; foreach ( Mobile m in this.GetMobilesInRange( 10 ) ) { if ( m is DreadSpider ) ++dreadspiders; } if ( dreadspiders < 10 ) { BaseCreature dreadspider = new DreadSpider(); dreadspider.Team = this.Team; Point3D loc = target.Location; bool validLocation = false; for ( int j = 0; !validLocation && j < 10; ++j ) { int x = target.X + Utility.Random( 3 ) - 1; int y = target.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 ); } dreadspider.MoveToWorld( loc, map ); dreadspider.Combatant = target; } }