Inheritance: BaseCreature
        public void SpawnRatmen(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int rats = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is Ratman || m is RatmanArcher || m is RatmanMage)
                {
                    ++rats;
                }
            }

            if (rats < 16)
            {
                PlaySound(0x3D);

                int newRats = Utility.RandomMinMax(3, 6);

                for (int i = 0; i < newRats; ++i)
                {
                    BaseCreature rat;

                    switch (Utility.Random(5))
                    {
                    default:
                    case 0:
                    case 1: rat = new Ratman(); break;

                    case 2:
                    case 3: rat = new RatmanArcher(); break;

                    case 4:                 rat = new RatmanMage(); break;
                    }

                    rat.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);
                        }
                    }

                    rat.MoveToWorld(loc, map);
                    rat.Combatant = target;
                }
            }
        }
Exemple #2
0
        public void SpawnRatmen(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int rats = 0;

            IPooledEnumerable eable = this.GetMobilesInRange(10);

            foreach (Mobile m in eable)
            {
                if (m is Ratman || m is RatmanArcher || m is RatmanMage)
                {
                    ++rats;
                }
            }
            eable.Free();

            if (rats < 16)
            {
                int newRats = Utility.RandomMinMax(3, 6);

                try
                {
                    for (int i = 0; i < newRats; ++i)
                    {
                        BaseCreature rat;

                        switch (Utility.Random(5))
                        {
                        default:
                        case 0:
                        case 1: rat = new Ratman(); break;

                        case 2:
                        case 3: rat = new RatmanArcher(); break;

                        case 4: rat = new RatmanMage(); break;
                        }

                        rat.Team = this.Team;

                        bool    validLocation = false;
                        Point3D loc           = this.Location;

                        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, target.Z, 16, CanFitFlags.requireSurface))
                            {
                                loc = new Point3D(x, y, Z);
                            }
                            else if (validLocation = map.CanFit(x, y, z, 16, CanFitFlags.requireSurface))
                            {
                                loc = new Point3D(x, y, z);
                            }
                        }

                        rat.MoveToWorld(loc, map);

                        rat.Combatant = target;
                    }
                }
                catch (Exception e)
                {
                    LogHelper.LogException(e);
                    Console.WriteLine("Exception (non-fatal) caught at Barracoon.Damage: " + e.Message);
                }
            }
        }
Exemple #3
0
        public void SpawnRatmen(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
                return;

            int rats = 0;

            IPooledEnumerable eable = this.GetMobilesInRange(10);
            foreach (Mobile m in eable)
            {
                if (m is Ratman || m is RatmanArcher || m is RatmanMage)
                    ++rats;
            }
            eable.Free();

            if (rats < 16)
            {
                int newRats = Utility.RandomMinMax(3, 6);

                try
                {
                    for (int i = 0; i < newRats; ++i)
                    {
                        BaseCreature rat;

                        switch (Utility.Random(5))
                        {
                            default:
                            case 0:
                            case 1: rat = new Ratman(); break;
                            case 2:
                            case 3: rat = new RatmanArcher(); break;
                            case 4: rat = new RatmanMage(); break;
                        }

                        rat.Team = this.Team;

                        bool validLocation = false;
                        Point3D loc = this.Location;

                        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, target.Z, 16, CanFitFlags.requireSurface))
                                loc = new Point3D(x, y, Z);
                            else if (validLocation = map.CanFit(x, y, z, 16, CanFitFlags.requireSurface))
                                loc = new Point3D(x, y, z);
                        }

                        rat.MoveToWorld(loc, map);

                        rat.Combatant = target;
                    }
                }
                catch (Exception e)
                {
                    LogHelper.LogException(e);
                    Console.WriteLine("Exception (non-fatal) caught at Barracoon.Damage: " + e.Message);
                }
            }
        }
Exemple #4
0
        public void SpawnRatmen(Mobile target)
        {
            Map map = Map;

            if (map == null)
            {
                return;
            }

            int rats =
                GetMobilesInRange(10).Cast<Mobile>().Count(m => m is Ratman || m is RatmanArcher || m is RatmanMage);

            if (rats < 6)
            {
                PlaySound(0x3D);

                int newRats = Utility.RandomMinMax(3, 5);

                for (int i = 0; i < newRats; ++i)
                {
                    BaseCreature rat;

                    switch (Utility.Random(5))
                    {
                        default:
                        case 0:
                        case 1:
                            rat = new Ratman();
                            break;
                        case 2:
                        case 3:
                            rat = new RatmanArcher();
                            break;
                        case 4:
                            rat = new RatmanMage();
                            break;
                    }

                    rat.Team = Team;

                    Point3D loc = Location;

                    for (int j = 0; j < 10; ++j)
                    {
                        int x = X + Utility.Random(3) - 1;
                        int y = Y + Utility.Random(3) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (false == map.CanFit(x, y, Z, 16, false, false))
                        {
                            loc = new Point3D(x, y, Z);
                        }
                        else if (false == map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    rat.MoveToWorld(loc, map);
                    // take away insta kill
                    //rat.Combatant = target;
                }
            }
        }
		public void SpawnRatmen( Mobile target )
		{
			Map map = this.Map;

			if ( map == null )
				return;

			int rats = 0;

			foreach ( Mobile m in this.GetMobilesInRange( 10 ) )
			{
				if ( m is Ratman || m is RatmanArcher || m is RatmanMage )
					++rats;
			}

			if ( rats < 16 )
			{
				PlaySound( 0x3D );

				int newRats = Utility.RandomMinMax( 3, 6 );

				for ( int i = 0; i < newRats; ++i )
				{
					BaseCreature rat;

					switch ( Utility.Random( 5 ) )
					{
						default:
						case 0: case 1:	rat = new Ratman(); break;
						case 2: case 3:	rat = new RatmanArcher(); break;
						case 4:			rat = new RatmanMage(); break;
					}

					rat.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 );
					}

					rat.MoveToWorld( loc, map );
					rat.Combatant = target;
				}
			}
		}
Exemple #6
0
        public override void OnThink()
        {
            if (!boatspawn)
            {
                if (this is SailorOrkGuards || this is SailorElfGuards || this is SailorGuards)
                {
                    TitleGuards(this);
                }

                Map map = Map;

                if (map == null)
                {
                    return;
                }

                Server.Multis.BaseBoat.BuildShip(ship, this);
                boatspawn = true;
                if (Server.Multis.BaseBoat.IsNearOtherShip(this))
                {
                    this.Delete();
                }
                else if (Worlds.TestShore(Map, X, Y, 15))
                {
                    this.Delete();
                }
            }

            base.OnThink();

            if (ship == null)
            {
                this.Delete();
            }

            base.OnThink();

            if (!crewspawn)
            {
                crewspawn = true;
                int          crew   = Utility.RandomMinMax(9, 12);
                BaseCreature pirate = new Brigand(); pirate.Delete();
                bool         evil   = true;
                string       toss   = "stones";

                while (crew > 0)
                {
                    if (this is PirateCyclops || this is PirateDragonogre || this is PirateEttinMage || this is PirateTroll || this is PirateOgreLord || this is PirateMinotaur)
                    {
                        switch (Utility.RandomMinMax(1, 13))
                        {
                        case 1: pirate = new Orc();                             toss = "stones";        break;

                        case 2: pirate = new Bugbear();                 toss = "axes";          break;

                        case 3: pirate = new Gnoll();                   toss = "daggers";       break;

                        case 4: pirate = new Goblin();                  toss = "darts";         break;

                        case 5: pirate = new Morlock();                 toss = "stones";        break;

                        case 6: pirate = new Neanderthal();             toss = "stones";        break;

                        case 7: pirate = new Ratman();                  toss = "daggers";       pirate.Body = 42;               break;

                        case 8: pirate = new Minotaur();                toss = "axes";          pirate.Body = 241;              break;

                        case 9: pirate = new Orc();                             toss = "axes";          pirate.Body = 20;               break;

                        case 10: pirate = new Orc();                    toss = "daggers";       pirate.Body = 182;              break;

                        case 11: pirate = new Orc();                    toss = "arrows";        pirate.Body = 252;              break;

                        case 12: pirate = new Kobold();                 toss = "daggers";       pirate.Body = 245;              break;

                        case 13: pirate = new Minotaur();               toss = "axes";          pirate.Body = 78;               break;
                        }
                    }
                    else if (this is PirateDaemon || this is PirateDemon || this is PirateDemoness || this is PirateDevil || this is PirateSuccubus)
                    {
                        switch (Utility.RandomMinMax(1, 5))
                        {
                        case 1: pirate = new Demon();                   toss = "fire";          pirate.Hue = 0;         pirate.Body = 112;              break;

                        case 2: pirate = new Gargoyle();                toss = "fire";          pirate.Hue = 0;         pirate.Body = 112;              break;

                        case 3: pirate = new Succubus();                toss = "energy";        pirate.Hue = 0;         pirate.Body = 149;              break;

                        case 4: pirate = new Demon();                   toss = "daggers";       pirate.Hue = 0;         pirate.Body = 128;              break;

                        case 5: pirate = new Demon();                   toss = "poison";        pirate.Hue = 0;         pirate.Body = 136;              break;
                        }
                    }
                    else if (this is PirateGargoyle)
                    {
                        switch (Utility.RandomMinMax(1, 5))
                        {
                        case 1: pirate = new Gargoyle();                pirate.Body = 112;              break;

                        case 2: pirate = new Gargoyle();                pirate.Body = 126;              break;

                        case 3: pirate = new Gargoyle();                pirate.Body = 113;              break;

                        case 4: pirate = new Gargoyle();                pirate.Body = 158;              break;

                        case 5: pirate = new Gargoyle();                                                                break;
                        }
                        switch (Utility.RandomMinMax(1, 5))
                        {
                        case 1: toss = "fire";          break;

                        case 2: toss = "cold";          break;

                        case 3: toss = "energy";        break;

                        case 4: toss = "poison";        break;

                        case 5: toss = "bolt";          break;
                        }
                    }
                    else if (this is PirateGrathek || this is PirateSakleth)
                    {
                        switch (Utility.RandomMinMax(1, 4))
                        {
                        case 1: pirate = new LizardmanArcher();         toss = "spear";         break;

                        case 2: pirate = new Lizardman();                       toss = "daggers";       pirate.Body = 33;               break;

                        case 3: pirate = new Lizardman();                       toss = "rocks";         pirate.Body = 326;              break;

                        case 4: pirate = new Lizardman();                       toss = "darts";         pirate.Body = 375;              break;
                        }
                    }
                    else if (this is PirateTitan)
                    {
                        switch (Utility.RandomMinMax(1, 4))
                        {
                        case 1: pirate = new Tritun();          toss = "daggers";               break;

                        case 2: pirate = new Tritun();          toss = "spear";                 pirate.Body = 678;              break;

                        case 3: pirate = new Tritun();          toss = "poison";                pirate.Body = 676;              break;

                        case 4: pirate = new Tritun();          toss = "bolt";                  pirate.Body = 677;              break;
                        }
                    }
                    else if (this is PirateOphidian)
                    {
                        pirate = new OphidianWarrior();         toss = "dagger";        pirate.Body = 87;
                    }
                    else if (this is PirateSnakeMan)
                    {
                        evil = false;
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: pirate = new OphidianWarrior();         toss = "poison";                pirate.Body = 704;              break;

                        case 2: pirate = new OphidianWarrior();         toss = "daggers";               pirate.Body = 143;              break;
                        }
                    }
                    else if (this is PirateUndead)
                    {
                        switch (Utility.RandomMinMax(1, 5))
                        {
                        case 1: pirate = new Zombie();                  toss = "bones";                                                                 break;

                        case 2: pirate = new Zombie();                  toss = "bones";                 pirate.Body = 304;              break;

                        case 3: pirate = new Ghoul();                   toss = "bones";                                                                 break;

                        case 4: pirate = new AquaticGhoul();    toss = "bones";                                                                 break;

                        case 5: pirate = new Wight();                   toss = "bones";                                                                 break;
                        }
                    }
                    else if (this is PirateGhost)
                    {
                        switch (Utility.RandomMinMax(1, 5))
                        {
                        case 1: pirate = new Spectre();                         toss = "fire";                  break;

                        case 2: pirate = new Spectre();                         toss = "cold";                  break;

                        case 3: pirate = new Spectre();                         toss = "energy";                break;

                        case 4: pirate = new Spectre();                         toss = "bolt";                  break;

                        case 5: pirate = new Spectre();                         toss = "poison";                break;
                        }
                    }
                    else if (this is PirateDarkLord || this is PirateLich || this is PirateLichLord || this is PirateSkeleton)
                    {
                        switch (Utility.RandomMinMax(1, 14))
                        {
                        case 1: pirate = new Zombie();                  toss = "bones";                                                                 break;

                        case 2: pirate = new Zombie();                  toss = "bones";                 pirate.Body = 304;              break;

                        case 3: pirate = new Spectre();                 toss = "fire";                                                                  break;

                        case 4: pirate = new Ghoul();                   toss = "bones";                                                                 break;

                        case 5: pirate = new AquaticGhoul();    toss = "bones";                                                                 break;

                        case 6: pirate = new Skeleton();                toss = "bones";                 pirate.Body = 50;               break;

                        case 7: pirate = new SkeletonArcher();  toss = "arrows";                                                                break;

                        case 8: pirate = new Wight();                   toss = "bones";                                                                 break;

                        case 9: pirate = new Skeleton();                toss = "bandages";              pirate.Body = 154;              BaseSoundID = 471;      break;

                        case 10: pirate = new BoneMagi();               toss = "fire";                                                                  break;

                        case 11: pirate = new BoneMagi();               toss = "cold";                                                                  break;

                        case 12: pirate = new BoneMagi();               toss = "energy";                                                                break;

                        case 13: pirate = new BoneMagi();               toss = "poison";                                                                break;

                        case 14: pirate = new BoneMagi();               toss = "bolt";                                                                  break;
                        }
                    }

                    else if (this is PirateDrow)
                    {
                        pirate = new ElfBerserker();            toss = "crossbow";
                    }
                    else if (this is PirateMen)
                    {
                        pirate = new Berserker();                       toss = "crossbow";
                    }
                    else if (this is PirateNatives)
                    {
                        pirate = new Berserker();                       toss = "harpoon";
                    }
                    else if (this is PirateCult)
                    {
                        switch (Utility.RandomMinMax(1, 12))
                        {
                        case 1: pirate = new Brigand();         toss = "daggers";       break;

                        case 2: pirate = new Brigand();         toss = "stones";        break;

                        case 3: pirate = new Brigand();         toss = "stars";         break;

                        case 4: pirate = new Brigand();         toss = "darts";         break;

                        case 5: pirate = new Brigand();         toss = "axes";          break;

                        case 6: pirate = new Brigand();         toss = "bones";         break;

                        case 7: pirate = new Brigand();         toss = "arrows";        break;

                        case 8: pirate = new Brigand();         toss = "fire";          break;

                        case 9: pirate = new Brigand();         toss = "cold";          break;

                        case 10: pirate = new Brigand();        toss = "energy";        break;

                        case 11: pirate = new Brigand();        toss = "poison";        break;

                        case 12: pirate = new Brigand();        toss = "bolt";          break;
                        }
                    }
                    else if (this is SailorElfGuards)
                    {
                        pirate = new ElfBerserker();
                        evil   = false;
                        switch (Utility.RandomMinMax(1, 3))
                        {
                        case 1: toss = "crossbow";              break;

                        case 2: toss = "bow";                   break;

                        case 3: toss = "harpoon";               break;
                        }
                    }
                    else if (this is SailorGuards)
                    {
                        pirate = new Berserker();
                        evil   = false;
                        switch (Utility.RandomMinMax(1, 3))
                        {
                        case 1: toss = "crossbow";              break;

                        case 2: toss = "bow";                   break;

                        case 3: toss = "harpoon";               break;
                        }
                    }
                    else if (this is SailorOrkGuards)
                    {
                        pirate = new OrkWarrior();
                        evil   = false;
                        switch (Utility.RandomMinMax(1, 3))
                        {
                        case 1: toss = "crossbow";              break;

                        case 2: toss = "bow";                   break;

                        case 3: toss = "harpoon";               break;
                        }
                    }
                    else if (this is SailorElf)
                    {
                        pirate = new ElfBerserker();
                        evil   = false;
                        switch (Utility.RandomMinMax(1, 7))
                        {
                        case 1: toss = "daggers";       break;

                        case 2: toss = "harpoon";       break;

                        case 3: toss = "stars";         break;

                        case 4: toss = "darts";         break;

                        case 5: toss = "axes";          break;

                        case 6: toss = "arrows";        break;

                        case 7: toss = "crossbow";      break;
                        }
                    }
                    else if (this is SailorMerchant)
                    {
                        pirate = new Berserker();
                        evil   = false;
                        switch (Utility.RandomMinMax(1, 7))
                        {
                        case 1: toss = "daggers";       break;

                        case 2: toss = "harpoon";       break;

                        case 3: toss = "stars";         break;

                        case 4: toss = "darts";         break;

                        case 5: toss = "axes";          break;

                        case 6: toss = "arrows";        break;

                        case 7: toss = "crossbow";              break;
                        }
                    }
                    else if (this is SailorAngel || this is SailorAngelLord)
                    {
                        evil = false;
                        switch (Utility.RandomMinMax(1, 5))
                        {
                        case 1: pirate = new Pixie();           toss = "fire";                  pirate.Body = Utility.RandomList(356, 128); break;

                        case 2: pirate = new Fairy();           toss = "cold";                  pirate.Body = 363; break;

                        case 3: pirate = new Centaur();         toss = "arrows";                break;

                        case 4: pirate = new Satyr();           toss = "daggers";               break;

                        case 5: pirate = new Wisp();            toss = "energy";                break;
                        }
                    }

                    SizeUpCrewMember(pirate, evil, EmoteHue, this, toss);
                    crew--;
                }
            }
        }
		public virtual void SpawnEnemies( RVS Handeling, String RegionName, int amount)
		{
			int numberOfEnemies = amount;
			int kindOfEnemy = 0;
			int randomEnemy = 0;
			Mobile Enemy = null;
			//Mobile Enemy = new Sheep();
			
			int randomValueX = 0;
			int randomValueY = 0;
			int negative = 0;
			
			Point3D spawn;
			Map spawnmap;
			
			if ( RegionName == "Sheep" )
			{
				spawn = SheepSpawnPoint;
				spawnmap = SheepSpawnMap;
				kindOfEnemy = 0;
			}
			else if ( RegionName == "Rabbit" )
			{
				spawn = RabbitSpawnPoint;
				spawnmap = RabbitSpawnMap;
				kindOfEnemy = 1;
			}
			else
			{
				spawn = SheepSpawnPoint;
				spawnmap = SheepSpawnMap;
				kindOfEnemy = 0;
			}
			
			for ( int i = 0; i < numberOfEnemies; i++ )
			{
				//kindOfEnemy = Utility.Random( 5 );
				
				randomValueX = Utility.Random( 11 );
				negative = Utility.Random( 2 );
				if ( negative > 0 )
					randomValueX *= -1;
					
				negative = Utility.Random( 2 );
				randomValueY = Utility.Random( 11 );
				if ( negative > 0 )
					randomValueY *= -1;
				
				if ( Handeling.RvS )
				{ 
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Sheep();
								break;
							}
						case 1:
							{
								Enemy = new Rabbit();
								break;
							}
					}
				}
				else if ( Handeling.Orcs )
				{ 
					kindOfEnemy = 0;
					randomEnemy = Utility.Random( 100 );
					if ( randomEnemy <= 20 )
						kindOfEnemy++;
					if ( randomEnemy <= 10 )
						kindOfEnemy++;
					if ( randomEnemy <= 5 )
						kindOfEnemy++;
					
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Orc();
								break;
							}
						case 1:
							{
								Enemy = new OrcishLord();
								break;
							}
						case 2:
							{
								Enemy = new Ettin();
								break;
							}
						case 3:
							{
								Enemy = new OrcishMage();
								break;
							}
					}
				}
				else if ( Handeling.Lizardmen )
				{ 
					kindOfEnemy = 0;
					randomEnemy = Utility.Random( 100 );
					if ( randomEnemy <= 20 )
						kindOfEnemy++;
					if ( randomEnemy <= 10 )
						kindOfEnemy++;
					if ( randomEnemy <= 5 )
						kindOfEnemy++;
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Snake();
								break;
							}
						case 1:
							{
								Enemy = new GiantSerpent();
								break;
							}
						case 2:
							{
								Enemy = new Lizardman();
								break;
							}
						case 3:
							{
								Enemy = new Drake();
								break;
							}
					}
				}
				else if ( Handeling.Ratmen )
				{ 
					kindOfEnemy = 0;
					randomEnemy = Utility.Random( 100 );
					if ( randomEnemy <= 20 )
						kindOfEnemy++;
					if ( randomEnemy <= 15 )
						kindOfEnemy++;
					if ( randomEnemy <= 10 )
						kindOfEnemy++;
					if ( randomEnemy <= 5 )
						kindOfEnemy++;
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Sewerrat();
								break;
							}
						case 1:
							{
								Enemy = new GiantRat();
								break;
							}
						case 2:
							{
								Enemy = new Ratman();
								break;
							}
						case 3:
							{
								Enemy = new RatmanMage();
								break;
							}	
						case 4:
							{
								Enemy = new RatmanArcher();
								break;
							}
					}
				}
				else if ( Handeling.Undead )
				{ 
					kindOfEnemy = 0;
					randomEnemy = Utility.Random( 100 );
					if ( randomEnemy <= 50 )
						kindOfEnemy++;
					if ( randomEnemy <= 40 )
						kindOfEnemy++;
					if ( randomEnemy <= 30 )
						kindOfEnemy++;
					if ( randomEnemy <= 20 )
						kindOfEnemy++;
					if ( randomEnemy <= 10 )
						kindOfEnemy++;
					if ( randomEnemy <= 5 )
						kindOfEnemy++;
						
					switch ( kindOfEnemy )
					{
						case 0:
							{
								Enemy = new Skeleton();
								break;
							}
						case 1:
							{
								Enemy = new Zombie();
								break;
							}
						case 2:
							{
								Enemy = new RestlessSoul();
								break;
							}
						case 3:
							{
								Enemy = new SkeletalMage();
								break;
							}
						case 4:
							{
								Enemy = new SkeletalKnight();
								break;
							}
						case 5:
							{
								Enemy = new Mummy();
								break;
							}
						case 6:
							{
								Enemy = new Lich();
								break;
							}
					}
				}
				
				Enemy.Map = spawnmap;
				Enemy.Location = new Point3D((spawn.X + randomValueX), (spawn.Y + randomValueY), (spawn.Z));
				
				Enemies.Add(Enemy);
			}
		}
Exemple #8
0
        public void SpawnRatmen(Mobile target)
        {
            Map map = Map;

            if (map == null)
            {
                return;
            }

            int rats =
                GetMobilesInRange(10).Cast <Mobile>().Count(m => m is Ratman || m is RatmanArcher || m is RatmanMage);

            if (rats < 6)
            {
                PlaySound(0x3D);

                int newRats = Utility.RandomMinMax(3, 5);

                for (int i = 0; i < newRats; ++i)
                {
                    BaseCreature rat;

                    switch (Utility.Random(5))
                    {
                    default:
                    case 0:
                    case 1:
                        rat = new Ratman();
                        break;

                    case 2:
                    case 3:
                        rat = new RatmanArcher();
                        break;

                    case 4:
                        rat = new RatmanMage();
                        break;
                    }

                    rat.Team = Team;

                    Point3D loc = Location;

                    for (int j = 0; j < 10; ++j)
                    {
                        int x = X + Utility.Random(3) - 1;
                        int y = Y + Utility.Random(3) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (false == map.CanFit(x, y, Z, 16, false, false))
                        {
                            loc = new Point3D(x, y, Z);
                        }
                        else if (false == map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    rat.MoveToWorld(loc, map);
                    // take away insta kill
                    //rat.Combatant = target;
                }
            }
        }