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


C# GameLiving.GetPlayersInRadius方法代码示例

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


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

示例1: Execute

        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            SendCasterSpellEffectAndCastMessage(living, 1145, true);

            bool deactivate = false;
            foreach (GamePlayer player in living.GetPlayersInRadius(false, 350))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(living, player, true))
                {
                    DamageTarget(player, living);
                    deactivate = true;
                }
            }

            foreach (GameNPC npc in living.GetNPCsInRadius(false, 350))
            {
                if (GameServer.ServerRules.IsAllowedToAttack(living, npc, true))
                {
                    DamageTarget(npc, living);
                    deactivate = true;
                }
            }
            if (deactivate)
                DisableSkill(living);
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:31,代码来源:SoulQuenchAbility.cs

示例2: Start

 public override void Start(GameLiving target)
 {
     base.Start(target);
     foreach (GamePlayer p in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
     {
         p.Out.SendSpellEffectAnimation(target, target, 7036, 0, false, 1);
     }
     EffectOwner = target as GamePlayer;
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:9,代码来源:GiftOfPerizorEffect.cs

示例3: DealDamage

 private void DealDamage(GameLiving target)
 {
     int ticksToTarget = m_caster.GetDistanceTo(target) * 100 / 85; // 85 units per 1/10s
     int delay = 1 + ticksToTarget / 100;
     foreach (GamePlayer player in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
     {
         player.Out.SendSpellEffectAnimation(m_caster, target, m_spell.ClientEffect, (ushort)(delay), false, 1);
     }
     BoltOnTargetAction bolt = new BoltOnTargetAction(Caster, target, this);
     bolt.Start(1 + ticksToTarget);
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:11,代码来源:VampiirPowerBolt.cs

示例4: Start

 public override void Start(GameLiving target)
 {
     base.Start(target);
     EffectOwner = target;
     foreach (GamePlayer p in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
     {
         p.Out.SendSpellEffectAnimation(EffectOwner, EffectOwner, 7059, 0, false, 1);
     }
     GameEventMgr.AddHandler(EffectSource, GameLivingEvent.AttackFinished, new DOLEventHandler(EventHandler));
     GameEventMgr.AddHandler(EffectSource, GameLivingEvent.CastFinished, new DOLEventHandler(EventHandler));
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:11,代码来源:SelectiveBlindnessEffect.cs

示例5: Start

 public override void Start(GameLiving target)
 {
     base.Start(target);
     if (target is GamePlayer)
     {
         EffectOwner = target as GamePlayer;
         foreach (GamePlayer p in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
         {
             p.Out.SendSpellEffectAnimation(EffectOwner, p, 7069, 0, false, 1);
         }
         GameEventMgr.AddHandler(EffectOwner, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
     }
 }
开发者ID:mynew4,项目名称:DAoC,代码行数:13,代码来源:BlissfulIgnoranceEffect.cs

示例6: ApplyEffectOnTarget

        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            GamePlayer player=target as GamePlayer;
            base.ApplyEffectOnTarget(Caster,effectiveness);
            Caster.StopAttack();
            Caster.DisarmedTime = Caster.CurrentRegion.Time + Spell.Duration;
            foreach (GamePlayer visPlayer in Caster.GetPlayersInRadius((ushort)WorldMgr.VISIBILITY_DISTANCE))
                visPlayer.Out.SendCombatAnimation(Caster, target, 0x0000, 0x0000, (ushort)408, 0, 0x00, target.HealthPercent);
            if(Spell.ResurrectMana>0) foreach (GamePlayer visPlayer in target.GetPlayersInRadius((ushort)WorldMgr.VISIBILITY_DISTANCE))
                visPlayer.Out.SendSpellEffectAnimation(Caster, target, (ushort)Spell.ResurrectMana, 0, false, 0x01);

            if((Spell.Duration>0&&Spell.Target!="Area")||Spell.Concentration>0) OnDirectEffect(target,effectiveness);
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:13,代码来源:DoomHammer.cs

示例7: Start

        public override void Start(GameLiving target)
        {
            base.Start(target);

            foreach (GamePlayer p in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                p.Out.SendSpellEffectAnimation(target, target, 7055, 0, false, 1);
            }
            //Commented out for removal: Parry Chance for BladeBarrier is hardcoded in GameLiving.cs in the CalculateEnemyAttackResult method
            //m_owner.BuffBonusCategory4[(int)eProperty.ParryChance] += 90;
            GameEventMgr.AddHandler(target, GameLivingEvent.AttackFinished, new DOLEventHandler(attackEventHandler));
            GameEventMgr.AddHandler(target, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(TakeDamage));
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:13,代码来源:BladeBarrierEffect.cs

示例8: Execute

		/// <summary>
		/// Action
		/// </summary>
		/// <param name="living"></param>
		public override void Execute(GameLiving living)
		{
			if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

			ushort Icon = 7026;
			effectiveness = 0;
			owner = living;

			if(ServerProperties.Properties.USE_NEW_ACTIVES_RAS_SCALING)
			{
				switch (Level)
				{
					case 1: effectiveness = 300; break;
					case 2: effectiveness = 450; break;
					case 3: effectiveness = 600; break;
					case 4: effectiveness = 750; break;
					case 5: effectiveness = 900; break;
				}
			}
			else
			{
				switch (Level)
				{
					case 1: effectiveness = 300; break;
					case 2: effectiveness = 600; break;
					case 3: effectiveness = 900; break;
				}
			}

			if (living.GroundTarget == null)
				return;
			if (!living.IsWithinRadius( living.GroundTarget, 1500 ))
				return;
			GamePlayer player = living as GamePlayer;
			if (player == null)
				return;

			if (player.RealmAbilityCastTimer != null)
			{
				player.RealmAbilityCastTimer.Stop();
				player.RealmAbilityCastTimer = null;
				player.Out.SendMessage("You cancel your Spell!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
			}

			foreach (GamePlayer p in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
				p.Out.SendSpellCastAnimation(living, Icon, 20);

			player.RealmAbilityCastTimer = new RegionTimer(player);
			player.RealmAbilityCastTimer.Callback = new RegionTimerCallback(startSpell);
			player.RealmAbilityCastTimer.Start(2000);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:55,代码来源:DecimationTrap.cs

示例9: Start

		public override void Start(GameLiving living)
		{
			m_living = living;
			//Send messages
			if (m_living is GamePlayer)
			{
				((GamePlayer)m_living).Out.SendMessage("You begin to charge wildly!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
			}
			else if (m_living is GameNPC)
			{
				IControlledBrain icb = ((GameNPC)m_living).Brain as IControlledBrain;
				if (icb != null && icb.Body != null)
				{
					GamePlayer playerowner = icb.GetPlayerOwner();

					if (playerowner != null)
					{
						playerowner.Out.SendMessage("The " + icb.Body.Name + " charges its prey!", eChatType.CT_Say, eChatLoc.CL_SystemWindow);
					}
				}
			}
			else
				return;
			
			m_startTick = living.CurrentRegion.Time;
			foreach (GamePlayer t_player in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
			{
				t_player.Out.SendSpellEffectAnimation(living, living, 7035, 0, false, 1);
			}

			//sets player into combat mode
			living.LastAttackTickPvP = m_startTick;
			ArrayList speedSpells = new ArrayList();
			lock(living.EffectList)
			{
				foreach (IGameEffect effect in living.EffectList)
				{
					if (effect is GameSpellEffect == false) continue;
					if ((effect as GameSpellEffect).Spell.SpellType == "SpeedEnhancement")
						speedSpells.Add(effect);
				}
			}
			foreach (GameSpellEffect spell in speedSpells)
				spell.Cancel(false);
			m_living.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, PropertyCalc.MaxSpeedCalculator.SPEED3);
			m_living.TempProperties.setProperty("Charging", true);
			if (m_living is GamePlayer)
				((GamePlayer)m_living).Out.SendUpdateMaxSpeed();
			StartTimers();
			m_living.EffectList.Add(this);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:51,代码来源:ChargeEffect.cs

示例10: Start

  public override void Start(GameLiving target)
 {
 	base.Start(target);
     if (target is GamePlayer)
     {
         EffectOwner = target as GamePlayer;
         foreach (GamePlayer p in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
         {
             p.Out.SendSpellEffectAnimation(EffectOwner, p, 7088, 0, false, 1);
         }
         GameEventMgr.AddHandler(EffectOwner, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
     	EffectOwner.BaseBuffBonusCategory[(int)eProperty.MagicAbsorption] += RealmAbilities.FanatacismAbility.VALUE;
     }
 }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:14,代码来源:FanatacismEffect.cs

示例11: DamageTarget

        private void DamageTarget(GameLiving target, GameLiving caster)
        {
            if (!target.IsAlive)
                return;

            foreach (GamePlayer p in target.GetPlayersInRadius(false, WorldMgr.VISIBILITY_DISTANCE))
            {
                p.Out.SendSpellEffectAnimation(caster, target, 7072, 0, false, 1);
            }

            if (target.EffectList.GetOfType<EntwiningSnakesEffect>() == null)
            {
                EntwiningSnakesEffect effect = new EntwiningSnakesEffect();
                effect.Start(target);
            }
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:16,代码来源:EntwiningSnakesAbility.cs

示例12: Start

		public override void Start(GameLiving target)
		{
			if (target != null)
			{
				base.Start(target);

				if (target != null)
				{
					foreach (GamePlayer p in target.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
					{
						p.Out.SendSpellEffectAnimation(m_owner, target, Icon, 0, false, 1);
					}
				}

				GameEventMgr.AddHandler(m_owner, GameLivingEvent.AttackFinished, new DOLEventHandler(OnAttack));
			}
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:17,代码来源:FuryOfNatureEffect.cs

示例13: Execute

        public const Int32 m_duration = 45000; //45 seconds

        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            foreach (GamePlayer t_player in living.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
            {
                if (t_player == living && living is GamePlayer)
                {
                    (living as GamePlayer).Out.SendMessage("You clear your mind and become more resistant to magic damage!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                }
                else
                {
                    t_player.Out.SendMessage(living.Name + " casts a spell!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                }
            }
            new TheEmptyMindEffect(this.Level).Start(living);
            DisableSkill(living);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:20,代码来源:TheEmptyMindAbility.cs

示例14: Start

		/// <summary>
		/// Starts the effect on the living
		/// </summary>
		/// <param name="living"></param>
		public override void Start(GameLiving living)
		{
			base.Start(living);
			m_value = Value;
			m_owner.AbilityBonus[(int)eProperty.Resist_Body] += m_value;
			m_owner.AbilityBonus[(int)eProperty.Resist_Cold] += m_value;
			m_owner.AbilityBonus[(int)eProperty.Resist_Energy] += m_value;
			m_owner.AbilityBonus[(int)eProperty.Resist_Heat] += m_value;
			m_owner.AbilityBonus[(int)eProperty.Resist_Matter] += m_value;
			m_owner.AbilityBonus[(int)eProperty.Resist_Spirit] += m_value;
			if (m_owner is GamePlayer)
				(m_owner as GamePlayer).Out.SendCharResistsUpdate(); 

			foreach (GamePlayer visiblePlayer in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
			{
				visiblePlayer.Out.SendSpellEffectAnimation(living, living, 1197, 0, false, 1);
			}
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:22,代码来源:TheEmptyMindEffect.cs

示例15: Execute

		public const Int32 m_duration = 45000; //45 seconds

		public override void Execute(GameLiving living)
		{
			if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

			foreach (GamePlayer t_player in living.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
			{
				if (t_player == living && living is GamePlayer)
				{
					(living as GamePlayer).Out.SendMessage("You clear your mind and become more resistant to magic damage!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
				}
				else
				{
					t_player.Out.SendMessage(living.Name + " casts a spell!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
				}
			}
			
			int effectiveness = 10;
			if(ServerProperties.Properties.USE_NEW_ACTIVES_RAS_SCALING)
			{
				switch (Level)
				{
					case 1: effectiveness = 10; break;
					case 2: effectiveness = 15; break;
					case 3: effectiveness = 20; break;
					case 4: effectiveness = 25; break;
					case 5: effectiveness = 30; break;
					default: effectiveness = 0; break;
				}				
			}
			else
			{
				switch (Level)
				{
					case 1: effectiveness = 10; break;
					case 2: effectiveness = 20; break;
					case 3: effectiveness = 30; break;
					default: effectiveness = 0; break;
				}
			}
			
			
			new TheEmptyMindEffect(effectiveness).Start(living);
			DisableSkill(living);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:46,代码来源:TheEmptyMindAbility.cs


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