Inheritance: BaseCreature
Exemplo n.º 1
0
        public void DoSpawn()
        {
            Map map = this.Map;

            if (map != null && Utility.RandomBool())
            {
                this.PlaySound(0x218);//////////

                int    newFollowers = Utility.RandomMinMax(2, 5);
                Mobile focus        = GetRandomTarget(10, false);

                if (focus != null)
                {
                    for (int i = 0; i < newFollowers; ++i)
                    {
                        BaseCreature spawn;

                        switch (Utility.Random(5))
                        {
                        default:
                        case 0: spawn = new WaterElemental(); break;

                        case 1: spawn = new EarthElemental(); break;

                        case 2: spawn = new FireSteed(); break;

                        case 3: spawn = new FireElemental(); break;

                        case 4: spawn = new AirElemental(); break;
                        }

                        spawn.Team = this.Team;

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

                        for (int j = 0; !validLocation && j < 10; ++j)
                        {
                            int x = Utility.RandomMinMax(focus.X - 1, focus.X + 1);
                            int y = Utility.RandomMinMax(focus.Y - 1, focus.Y + 1);
                            int z = map.GetAverageZ(x, y);

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

                        spawn.MoveToWorld(loc, map);
                        spawn.Combatant = focus;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void SpawnFollowers(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
                return;

            int followers = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is EarthElemental || m is FireElemental || m is AirElemental || m is FireSteed || m is WaterElemental)
                    ++followers;
            }

            if (this.Followers < 9)
            {
                this.PlaySound(0x218);//////////

                int newFollowers = Utility.RandomMinMax(1, 3);

                for (int i = 0; i < newFollowers; ++i)
                {
                    BaseCreature follower;

                    switch (Utility.Random(5))
                    {
                        default:
                        case 0:
                            follower = new WaterElemental();
                            break;
                        case 1:
                            follower = new EarthElemental();
                            break;
                        case 2:
                            follower = new FireSteed();
                            break;
                        case 3:
                            follower = new FireElemental();
                            break;
                        case 4:
                            follower = new AirElemental();
                            break;
                    }

                    follower.Team = this.Team;

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

                    for (int j = 0; !validLocation && j < 9; ++j)
                    {
                        int x = this.X + Utility.Random(3) - 1;
                        int y = this.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, this.Z);
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                            loc = new Point3D(x, y, z);
                    }

                    follower.MoveToWorld(loc, map);
                    follower.Combatant = target;
                }
            }
        }
        public void SpawnFollowers(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int followers = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is EarthElemental || m is FireElemental || m is AirElemental || m is FireSteed || m is WaterElemental)
                {
                    ++followers;
                }
            }

            if (this.Followers < 9)
            {
                this.PlaySound(0x218);//////////

                int newFollowers = Utility.RandomMinMax(1, 3);

                for (int i = 0; i < newFollowers; ++i)
                {
                    BaseCreature follower;

                    switch (Utility.Random(5))
                    {
                    default:
                    case 0:
                        follower = new WaterElemental();
                        break;

                    case 1:
                        follower = new EarthElemental();
                        break;

                    case 2:
                        follower = new FireSteed();
                        break;

                    case 3:
                        follower = new FireElemental();
                        break;

                    case 4:
                        follower = new AirElemental();
                        break;
                    }

                    follower.Team = this.Team;

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

                    for (int j = 0; !validLocation && j < 9; ++j)
                    {
                        int x = this.X + Utility.Random(3) - 1;
                        int y = this.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, this.Z);
                        }
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    follower.MoveToWorld(loc, map);
                    follower.Combatant = target;
                }
            }
        }
			protected override void OnTick()
			{
				if ( m_Item.Deleted )
					return;

				Mobile spawn;

				switch ( Utility.Random( 10 ) )
				{
					default:
					case 0: spawn = new AirElemental(); break;
					case 1: spawn = new EarthElemental(); break;
					case 2: spawn = new WaterElemental(); break;
					case 3: spawn = new FireElemental(); break;
					case 4: spawn = new IceElemental(); break;
					case 5: spawn = new SnowElemental(); break;
					case 6: spawn = new Efreet(); break;
					case 7: spawn = new BloodElemental(); break;
					case 8: spawn = new PoisonElemental(); break;
				}

				spawn.MoveToWorld( m_Item.Location, m_Item.Map );

				m_Item.Delete();
			}
Exemplo n.º 5
0
			protected override void OnTick()
			{
				if ( m_Item.Deleted )
					return;

				if ( m_Item.Summoner != null && !m_Item.Summoner.Deleted )
				{
					EarthElemental spawn = new EarthElemental();
					spawn.MoveToWorld( m_Item.Location, m_Item.Map );
					m_Item.Summoner.Summons.Add( spawn );
				}

				m_Item.Delete();
			}
			protected override void OnTick()
			{
				if ( m_Item.Deleted )
					return;

				Mobile spawn;

				switch ( Utility.Random( 2 ) )
				{
					default:
					case 0: spawn = new EarthElemental(); break;
					case 1: spawn = new EarthElemental(); break;
				}

				spawn.MoveToWorld( m_Item.Location, m_Item.Map );

				m_Item.Delete();
			}