예제 #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;
                    }
                }
            }
        }
예제 #2
0
파일: Mistral.cs 프로젝트: nogu3ira/xrunuo
        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;
            }
        }
예제 #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;
                }
            }
        }
예제 #5
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;
            }
        }
예제 #6
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();
			}
예제 #7
0
        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();
			}