public static void MassProvokeXML(BaseCreature mobile, Mobile player)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(15))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature)
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                m.DoHarmful(m);
                player.Combatant = null;
                m.Combatant      = player;
                m.PlaySound(0x403);
                m.Emote("*you see {0} looks furious*", m.Name);
            }
        }
        public static void MassPeaceXML(BaseCreature mobile, Mobile player)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(15))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team))
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                m.DoHarmful(m);
                m.Combatant = null;
                m.PlaySound(0x418);
                m.Emote("*you see {0} looks peacful*", m.Name);
            }
        }
        public static void CheckSummonLimits(BaseCreature creature)
        {
            ArrayList creatures = new ArrayList();

            int limit = 6;             // 6 creatures

            int range = 5;             // per 5x5 area

            IPooledEnumerable eable = creature.GetMobilesInRange(range);

            foreach (Mobile mobile in eable)
            {
                if (mobile != null && mobile.GetType() == creature.GetType())
                {
                    creatures.Add(mobile);
                }
            }

            int amount = 0;

            if (creatures.Count > limit)
            {
                amount = creatures.Count - limit;
            }

            while (amount > 0)
            {
                for (int i = 0; i < creatures.Count; i++)
                {
                    Mobile m = creatures[i] as Mobile;

                    if (m != null && ((BaseCreature)m).Summoned)
                    {
                        if (Utility.RandomBool() && amount > 0)
                        {
                            m.Delete();

                            amount--;
                        }
                    }
                }
            }
        }
        private void CompileHelpersList(BaseCreature pirate)
        {
            if (Owner == null)
            {
                return;
            }

            Party p = Party.Get(Owner);
            List <DamageStore> rights = pirate.GetLootingRights();

            IPooledEnumerable eable = pirate.GetMobilesInRange(19);

            foreach (Mobile mob in eable)
            {
                if (mob == Owner || !(mob is PlayerMobile))
                {
                    continue;
                }

                Party mobParty = Party.Get(mob);

                //Add party memebers regardless of looting rights
                if (p != null && mobParty != null && p == mobParty)
                {
                    m_Helpers.Add(mob);
                    continue;
                }

                // add those with looting rights
                for (int i = rights.Count - 1; i >= 0; --i)
                {
                    DamageStore ds = rights[i];

                    if (ds.m_HasRight && ds.m_Mobile == mob)
                    {
                        m_Helpers.Add(ds.m_Mobile);
                        break;
                    }
                }
            }
            eable.Free();
        }
        public static void AreaAirBlastXML(BaseCreature mobile, Mobile player, Mobile master)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(10))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }


                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team))
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }
            mobile.Emote("*you see {0} shoots a distructive air attack!*", mobile.Name);
            mobile.Mana -= 25;
            mobile.Stam -= 15;
            foreach (Mobile m in list)
            {
                if (m == master)
                {
                    return;
                }
                m.DoHarmful(m);
                m.FixedParticles(0x3728, 50, 50, 5052, EffectLayer.Waist);
                m.PlaySound(655);
                m.SendMessage("Your lose your breath as the air hits you!");
                int toStrike = Utility.RandomMinMax(25, 35);
                m.Damage(toStrike, mobile);
            }
        }
        public static void AreaIceBlastXML(BaseCreature mobile, Mobile player, Mobile master)
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in mobile.GetMobilesInRange(10))
            {
                if (m == mobile || !m.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team))
                {
                    list.Add(m);
                }
                else if (m.Player)
                {
                    list.Add(m);
                }
            }
            mobile.Emote("*you see {0} shoots a distructive ice attack!*", mobile.Name);
            mobile.Mana -= 25;
            mobile.Stam -= 15;
            foreach (Mobile m in list)
            {
                if (m == master)
                {
                    return;
                }
                m.DoHarmful(m);
                m.FixedParticles(0x1fb7, 50, 50, 5052, EffectLayer.Waist);
                m.PlaySound(279);
                m.PlaySound(280);
                m.SendMessage("Your skin numbs as the cold freezes you!");
                m.Damage(((Utility.Random(25, 35)) - (m.ColdResistance / 2)));
            }
        }
        public static void RoarAttack(BaseCreature from, Mobile target)
        {
            if (from.RoarAttack < 10 || from == null || target == null)
                return;

            int power = from.RoarAttack / 10;
            int mindam = from.RoarAttack / 3;
            int maxdam = from.RoarAttack / 2;
            from.Say("*Roars*");

            ArrayList targets = new ArrayList();

            foreach (Mobile m in from.GetMobilesInRange(power))
            {
                if (m != from && from.CanBeHarmful(m))
                    targets.Add(m);
            }

            for (int i = 0; i < targets.Count; ++i)
            {
                Mobile m = (Mobile)targets[i];

                if (m is BaseCreature)
                {
                    BaseCreature bc = (BaseCreature)m;

                   // if (bc.Controlled == true && bc.ControlMaster != null)
                       // return;//////////////////////////////////////////////////////////////////////////////
                    
                  //  else
                    
                    bc.BeginFlee(TimeSpan.FromSeconds(10.0));
                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 100, 0, 0, 0, 0);
                }
            }
        }
		//END STAM DRAIN ATTACK

		//BEGIN MANA DRAIN ATTACK

		public static void DoManaDrainAttack(BaseCreature mobile)
		{

			foreach (Mobile m in mobile.GetMobilesInRange( 3 ) )
				if (m != null && m.Mana >= 50 && m.AccessLevel == AccessLevel.Player)
					mobile.Mana += 5;
		}
		//END AIR AREA ATTACK

		//BEGIN HITS DRAIN ATTACK

		public static void DoHitsDrainAttack(BaseCreature mobile)
		{

			foreach (Mobile m in mobile.GetMobilesInRange( 3 ) )
				if (m != null && m.Hits >= 50 && m.AccessLevel == AccessLevel.Player)
					mobile.Hits += 2;

		}
		//END WATER AREA ATTACK

		//BEGIN AIR AREA ATTACK

		public static void DoAirAreaAttack(BaseCreature mobile, Mobile player)
		{
			ArrayList list = new ArrayList();

			foreach ( Mobile m in mobile.GetMobilesInRange( 10 ) )
			{
				if ( m == mobile || !m.CanBeHarmful( m ) )
					continue;

				if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team) )
					list.Add( m );
				else if ( m.Player )
					list.Add( m );
			}

			foreach ( Mobile m in list )
			{
				m.DoHarmful( m );

				m.FixedParticles( 0x3728, 50, 50, 5052, EffectLayer.Waist );
				m.PlaySound( 655 );

				m.SendMessage( "Your lose your breath as the air hits you!" );

				int toStrike = Utility.RandomMinMax( 25, 35 );

				m.Damage( toStrike, mobile );
			}
		}
		//END FIRE AREA ATTACK

		//BEGIN WATER  ATTACK

		public static void DoWaterAreaAttack(BaseCreature mobile, Mobile player)
		{
			ArrayList list = new ArrayList();

			foreach ( Mobile m in mobile.GetMobilesInRange( 10 ) )
			{
				if ( m == mobile || !m.CanBeHarmful( m ) )
					continue;

				if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team) )
					list.Add( m );
				else if ( m.Player )
					list.Add( m );
			}

			foreach ( Mobile m in list )
			{
				m.DoHarmful( m );

				m.FixedParticles( 0x1fb7, 50, 50, 5052, EffectLayer.Waist );
				m.PlaySound( 279 );
				m.PlaySound( 280 );

				m.SendMessage( "Your skin numbs as the cold freezes you!" );

				//int toStrike = Utility.RandomMinMax( 25, 35 );
    
                                m.Damage( ((Utility.Random( 25, 35 )) - (m.ColdResistance /2)) );
				//m.Damage( toStrike, mobile );
			}
		}
Exemple #12
0
        public static void CheckSummonLimits( BaseCreature creature )
        {
            ArrayList creatures = new ArrayList();

            int limit = 6; // 6 creatures
            int range = 5; // per 5x5 area

            var eable = creature.GetMobilesInRange( range );

            foreach ( Mobile mobile in eable )
            {
                if ( mobile != null && mobile.GetType() == creature.GetType() )
                    creatures.Add( mobile );
            }

            int amount = 0;

            if ( creatures.Count > limit )
                amount = creatures.Count - limit;

            while ( amount > 0 )
            {
                for ( int i = 0; i < creatures.Count; i++ )
                {
                    Mobile m = creatures[i] as Mobile;

                    if ( m != null && ( (BaseCreature) m ).Summoned )
                    {
                        if ( Utility.RandomBool() && amount > 0 )
                        {
                            m.Delete();
                            amount--;
                        }
                    }
                }
            }
        }
		//END MASS PEACE

		//BEGIN MASS PROVOKE

		public static void DoMassProvoke(BaseCreature mobile, Mobile player)
		{
			ArrayList list = new ArrayList();

			foreach ( Mobile m in mobile.GetMobilesInRange( 15 ) )
			{
				if ( m == mobile || !m.CanBeHarmful( m ) )
					continue;

				if ( m is BaseCreature )
					list.Add( m );
				else if ( m.Player )
					list.Add( m );
			}

			foreach ( Mobile m in list )
			{
				m.DoHarmful( m );
				player.Combatant = null;
				m.Combatant = player;
				m.PlaySound( 0x403 );
				m.Emote("*you see {0} looks furious*", m.Name);
			}
		}
		//END BOMBER

		//BEGIN MASS PEACE


		public static void DoMassPeace(BaseCreature mobile, Mobile player)
		{
			ArrayList list = new ArrayList();

			foreach ( Mobile m in mobile.GetMobilesInRange( 15 ) )
			{
				if ( m == mobile || !m.CanBeHarmful( m ) )
					continue;

				if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team) )
					list.Add( m );
				else if ( m.Player )
					list.Add( m );
			}

			foreach ( Mobile m in list )
			{
				m.DoHarmful( m );
				m.Combatant = null;
				m.PlaySound( 0x418 );
				m.Emote("*you see {0} looks peacful*", m.Name);
			}
		}
        public static void IcyWindAttack(BaseCreature from, Mobile target)
        {
            if (from.IcyWindAttack < 10 || from == null || target == null)
                return;

            Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);
            int mindam = from.IcyWindAttack / 3;
            int maxdam = from.IcyWindAttack / 2;

            ArrayList targets = new ArrayList();

            foreach (Mobile m in from.GetMobilesInRange(from.IcyWindAttack / 10))
            {
                if (m != from && from.CanBeHarmful(m))
                    targets.Add(m);
            }

            for (int i = 0; i < targets.Count; ++i)
            {
                Mobile m = (Mobile)targets[i];
                from.Say("Icy Wind Attack");
                AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 100, 0, 0);
                Slow.SlowWalk(m, 10);
            }
        }
Exemple #16
0
		public static void DoMoves( BaseCreature from, Mobile target )
		{
			switch ( Utility.Random( 3 ) )
			{
				case 0:
				
				if ( Utility.Random( 500 ) <= from.RoarAttack )
				{
					int power;
					int mindam;
					int maxdam;

					if ( from.RoarAttack > 3 )
					{
						mindam = from.RoarAttack / 3;
						maxdam = from.RoarAttack / 2;
					}
					else
					{
						mindam = 1;
						maxdam = 3;
					}

					if ( from.RoarAttack > 10 )
						power = from.RoarAttack / 10;
					else
						power = 1;

					ArrayList targets = new ArrayList();

					foreach ( Mobile m in from.GetMobilesInRange( power ) )
					{
						if ( m != from )
							targets.Add( m );
					}
								
					for ( int i = 0; i < targets.Count; ++i )
					{
						Mobile m = (Mobile)targets[i];

						if ( m is BaseCreature )
						{
							BaseCreature bc = (BaseCreature)m;

							bc.BeginFlee( TimeSpan.FromSeconds( 30.0 ) );
							AOS.Damage( target, from, Utility.RandomMinMax( mindam, maxdam ), 20, 20, 20, 20, 20 );
						}
					}	
				}
				
				break;

				case 1:
				
				if ( Utility.Random( 500 ) <= from.PetPoisonAttack )
				{
					Effects.SendLocationParticles( EffectItem.Create( target.Location, target.Map, EffectItem.DefaultDuration ), 0x36B0, 1, 14, 63, 7, 9915, 0 );
					Effects.PlaySound( target.Location, target.Map, 0x229 );

					int mindam;
					int maxdam;

					if ( from.PetPoisonAttack > 3 )
					{
						mindam = from.PetPoisonAttack / 3;
						maxdam = from.PetPoisonAttack / 2;
					}
					else
					{
						mindam = 1;
						maxdam = 3;
					}

					int level = from.PetPoisonAttack / 20;

					if ( level > 5 )
						level = 5;

					target.ApplyPoison( from.ControlMaster, Poison.GetPoison( level ) );
					AOS.Damage( target, from, Utility.RandomMinMax( mindam, maxdam ), 0, 0, 0, 0, 100 );
				}
				
				break;

				case 2:
				
				if ( Utility.Random( 500 ) <= from.FireBreathAttack )
				{
					int mindam;
					int maxdam;

					if ( from.PetPoisonAttack > 3 )
					{
						mindam = from.PetPoisonAttack / 3;
						maxdam = from.PetPoisonAttack / 2;
					}
					else
					{
						mindam = 1;
						maxdam = 3;
					}

					from.MovingParticles( target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
					from.PlaySound( Core.AOS ? 0x15E : 0x44B );
					target.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
					target.PlaySound( 0x208 );

					AOS.Damage( target, from, Utility.RandomMinMax( mindam, maxdam ), 0, 0, 0, 0, 100 );
						
					Timer t = new FireBreathDOT( target, from, from.FireBreathAttack );
					t.Start();
				}
				
				break;
			}
		}
		public static void DoRobotReveal(BaseCreature mobile)
		{
			foreach (Mobile m in mobile.GetMobilesInRange( 10 ) )
				if (m != null && m.Hidden && m.AccessLevel == AccessLevel.Player)
					m.Hidden = false;

			if( s_RoboTalked == false ) 
			{ 
				s_RoboTalked = true; 
				SayRobotRandom( robotsay, mobile );  
				RobotSpamTimer t = new RobotSpamTimer(); 
				t.Start(); 
			} 
		}
Exemple #18
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is PlayerMobile)
            {
                from.SendMessage("Huh? But the children would be so ugly");
            }
            else if (target is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)target;

                Type   targettype = bc.GetType();
                Type   pettype    = m_Pet.GetType();
                Mobile breeder    = new Mobile();
                Mobile owner      = new Mobile();

                foreach (Mobile m in bc.GetMobilesInRange(5))
                {
                    if (m is AnimalBreeder)
                    {
                        breeder = m;
                    }

                    if (m == bc.ControlMaster)
                    {
                        owner = m;
                    }
                }

                if (bc.Controlled != true)
                {
                    from.SendMessage("That creature is not tamed.");
                }
                else if (bc.ControlMaster == null)
                {
                    from.SendMessage("That creature has no master.");
                }
                else if (bc.MatingDelay >= DateTime.Now)
                {
                    from.SendMessage("That creature has mated in the last six days, It cannot mate again so soon.");
                }
                else if (bc.ControlMaster == from)
                {
                    from.SendMessage("You cannot breed two of your own pets together, You must find another player who has the same type of pet as your's in order to breed.");
                }
                else if (breeder == null)
                {
                    from.SendMessage("You must be near an animal breeder in order to breed your pet.");
                }
                else if (owner == null)
                {
                    from.SendMessage("The owner of that pet is not near by to confirm mating between the two pets.");
                }
                else if (targettype != pettype)
                {
                    from.SendMessage("You cannot crossbreed two different species together.");
                }
                else if (bc.AllowMating != true)
                {
                    from.SendMessage("This creature is not at the correct level to breed yet.");
                }
                else if (bc.Female == m_Pet.Female)
                {
                    from.SendMessage("You cannot breed two pets of the same gender together, That is just WRONG!");
                }
                else
                {
                    from.SendGump(new AwaitingConfirmationGump(m_Pet, bc));
                    owner.SendGump(new BreedingAcceptGump(m_Pet, bc));
                }
            }
            else
            {
                from.SendMessage("Your pet cannot breed with that.");
            }
        }
		public static void DoHumanReveal(BaseCreature mobile)
		{
			foreach (Mobile m in mobile.GetMobilesInRange( 10 ) )
				if (m != null && m.Hidden && m.AccessLevel == AccessLevel.Player)
					m.Hidden = false;

			if( s_HumanTalked == false ) 
			{ 
				s_HumanTalked = true; 
				SayHumanRandom( humansay, mobile ); 
				HumanSpamTimer t = new HumanSpamTimer(); 
				t.Start(); 
			} 
		}
        private void CompileHelpersList(BaseCreature pirate)
        {
            if (Owner == null)
                return;
 
            Party p = Party.Get(Owner);
            List<DamageStore> rights = pirate.GetLootingRights();
 
            IPooledEnumerable eable = pirate.GetMobilesInRange(19);
            foreach (Mobile mob in eable)
            {
                if (mob == Owner || !(mob is PlayerMobile))
                    continue;
 
                Party mobParty = Party.Get(mob);
 
                //Add party memebers regardless of looting rights
                if (p != null && mobParty != null && p == mobParty)
                {
                    m_Helpers.Add(mob);
                    continue;
                }
 
                // add those with looting rights
                for (int i = rights.Count - 1; i >= 0; --i)
                {
                    DamageStore ds = rights[i];
 
                    if (ds.m_HasRight && ds.m_Mobile == mob)
                    {
                        m_Helpers.Add(ds.m_Mobile);
                        break;
                    }
                }
            }
            eable.Free();
        }
		//END HUMAN REVEALER

		//BEGIN AREA FIRE ATTACK

		public static void DoFireAreaAttack(BaseCreature mobile, Mobile player)
		{
			ArrayList list = new ArrayList();

			foreach ( Mobile m in mobile.GetMobilesInRange( 10 ) )
			{
				if ( m == mobile || !m.CanBeHarmful( m ) )
					continue;

				if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != mobile.Team) )
					list.Add( m );
				else if ( m.Player )
					list.Add( m );
			}

			foreach ( Mobile m in list )
			{
                                /*if ( CheckResisted( m ) )
				{
                                 m.DoHarmful( m );
                                int Strike = Utility.RandomMinMax( 5, 15 );
			        m.Damage( Strike, mobile );
				m.SendMessage( "Your feel the heat of fire!" );
                                return;
				}*/
				m.DoHarmful( m );

				m.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.Waist );
				m.PlaySound( 0x208 );

				m.SendMessage( "Your skin blisters as the fire burns you!" );

				//int toStrike = Utility.RandomMinMax( 25, 35 );
    
                                m.Damage( ((Utility.Random( 25, 35 )) - (m.FireResistance /2)) );
				//m.Damage( toStrike, mobile );
			}
		}