本文整理汇总了C#中GameLiving.GetNPCsInRadius方法的典型用法代码示例。如果您正苦于以下问题:C# GameLiving.GetNPCsInRadius方法的具体用法?C# GameLiving.GetNPCsInRadius怎么用?C# GameLiving.GetNPCsInRadius使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameLiving
的用法示例。
在下文中一共展示了GameLiving.GetNPCsInRadius方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: OnDirectEffect
/// <summary>
/// execute non duration spell effect on target
/// </summary>
/// <param name="target"></param>
/// <param name="effectiveness"></param>
public override void OnDirectEffect(GameLiving target, double effectiveness)
{
base.OnDirectEffect(target, effectiveness);
if (target == null || !target.IsAlive)
return;
foreach (GameNPC item in target.GetNPCsInRadius((ushort)m_spell.Radius))
{
if (item != null && item is GameMine)
{
(item as GameMine).Delete();
}
}
}
示例3: Execute
public override void Execute(GameLiving living)
{
if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;
SpellLine spline = SkillBase.GetSpellLine(GlobalSpellsLines.Character_Abilities);
Spell abSpell = SkillBase.GetSpellByID(7045);
if (spline != null && abSpell != null)
{
foreach (GameNPC enemy in living.GetNPCsInRadius(750))
{
if (enemy.IsAlive && enemy.Brain!=null)
if(enemy.Brain is IControlledBrain)
living.CastSpell(abSpell, spline);
}
}
DisableSkill(living);
}