当前位置: 首页>>代码示例>>C#>>正文


C# BaseCreature.GetMobilesInRange方法代码示例

本文整理汇总了C#中BaseCreature.GetMobilesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.GetMobilesInRange方法的具体用法?C# BaseCreature.GetMobilesInRange怎么用?C# BaseCreature.GetMobilesInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseCreature的用法示例。


在下文中一共展示了BaseCreature.GetMobilesInRange方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RoarAttack

        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);
                }
            }
        }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:36,代码来源:PetMoves.cs

示例2: CompileHelpersList

        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();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:37,代码来源:ProfessionalBountyQuest.cs

示例3: CheckSummonLimits

        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--;
                        }
                    }
                }
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:37,代码来源:SpellHelper.cs

示例4: DoMoves

		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;
//.........这里部分代码省略.........
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:101,代码来源:PetMoves.cs

示例5: DoManaDrainAttack

		//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;
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:11,代码来源:MobileFeatures.cs

示例6: DoHitsDrainAttack

		//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;

		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:12,代码来源:MobileFeatures.cs

示例7: DoAirAreaAttack

		//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 );
			}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:33,代码来源:MobileFeatures.cs

示例8: DoWaterAreaAttack

		//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 );
			}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:35,代码来源:MobileFeatures.cs

示例9: DoFireAreaAttack

		//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 );
			}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:42,代码来源:MobileFeatures.cs

示例10: DoHumanReveal

		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(); 
			} 
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:14,代码来源:MobileFeatures.cs

示例11: DoRobotReveal

		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(); 
			} 
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:14,代码来源:MobileFeatures.cs

示例12: DoMassProvoke

		//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);
			}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:28,代码来源:MobileFeatures.cs

示例13: DoMassPeace

		//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);
			}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:28,代码来源:MobileFeatures.cs

示例14: IcyWindAttack

        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);
            }
        }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:25,代码来源:PetMoves.cs


注:本文中的BaseCreature.GetMobilesInRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。