Inheritance: BaseCreature
Esempio 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;
                    }
                }
            }
        }
Esempio n. 2
0
        public override void OnCombatantChange()
        {
            if (m_SpawnedFriends)
            {
                return;
            }

            for (int i = 1; i < MaxFriends + 1; i++)
            {
                // spawn new friends

                BaseCreature friend = new AirElemental();

                friend.MoveToWorld(Map.GetSpawnPosition(Location, 3), Map);

                m_SpawnedFriends = true;
            }
        }
Esempio n. 3
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();
			}
Esempio n. 6
0
        public override void OnCombatantChange()
        {
            if ( m_SpawnedFriends )
                return;

            for ( int i = 1; i < MaxFriends + 1; i++ )
            {
                // spawn new friends

                BaseCreature friend = new AirElemental();

                friend.MoveToWorld( Map.GetSpawnPosition( Location, 3 ), Map );

                m_SpawnedFriends = true;
            }
        }
Esempio n. 7
0
			protected override void OnTick()
			{
				if ( m_Item.Deleted )
					return;

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

				m_Item.Delete();
			}
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (!CheckLineOfSight(p))
            {
                this.DoFizzle();
                Caster.SendAsciiMessage("Target is not in line of sight");
            }
            else if (CheckSequence())
            {
                TimeSpan duration = TimeSpan.FromSeconds((2 * Caster.Skills.Magery.Fixed) / 5);

                if (Core.AOS)
                {
                    SummonedAirElemental airElemental = new SummonedAirElemental();

                    airElemental.MoveToWorld(new Point3D(p), Caster.Map );

                    SpellHelper.Summon(airElemental, Caster, 0x217, duration, false, false);
                }
                else
                {
                    AirElemental airElemental = new AirElemental();

                    airElemental.MoveToWorld(new Point3D(p), Caster.Map);

                    SpellHelper.Summon(airElemental, Caster, 0x217, duration, false, false);
                }

            }

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

				Mobile spawn;

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

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

				m_Item.Delete();
			}