本文整理汇总了C#中WCell.RealmServer.Entities.GameObject.GetNearbyNPC方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.GetNearbyNPC方法的具体用法?C# GameObject.GetNearbyNPC怎么用?C# GameObject.GetNearbyNPC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Entities.GameObject
的用法示例。
在下文中一共展示了GameObject.GetNearbyNPC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SoulPrisonUsed
private static bool SoulPrisonUsed(GameObject go, Character user)
{
var nearest = go.GetNearbyNPC(NPCId.UnworthyInitiateAnchor, 2);
if (nearest == null) return false;
var shackled = nearest.ChannelObject as NPC;
if (shackled == null) return false;
var transformSpellId = GetTransformSpellIdFor(shackled.DisplayId);
//just clear all auras! uh oh...not
shackled.Auras.Clear();
shackled.IsInvulnerable = false;
go.Flags = GameObjectFlags.None;
shackled.StandState = StandState.Stand;
shackled.Emote(EmoteType.SimpleTalk);
shackled.Say("They brand me unworthy? I will show them unworthy!");
shackled.Spells.Clear();
shackled.Spells.AddSpell(
SpellId.ClassSkillPlagueStrikeRank1_2,
SpellId.ClassSkillIcyTouchRank1_2,
SpellId.ClassSkillBloodStrikeRank1_2,
SpellId.ClassSkillDeathCoil,
SpellId.ClassSkillDeathCoilRank1_3);
shackled.CallDelayed(3000, wObj => ((NPC)wObj).MoveInFrontThenExecute(go, npc =>
{
npc.Emote(EmoteType.SimpleLoot);
npc.CallDelayed(4000, obj =>
{
obj.SpellCast.TriggerSelf(SpellId.DeathKnightInitiateVisual);
obj.SpellCast.TriggerSelf(transformSpellId);
((NPC) obj).VirtualItem1 = ItemId.RunedSoulblade;
obj.FactionId = FactionId.ActorEvil;
});
npc.CallDelayed(7000, obj =>
{
((NPC)obj).Emote(EmoteType.SimplePointNosheathe);
obj.Say("To battle!");
});
npc.CallDelayed(9000, obj =>
{
((NPC)obj).ThreatCollection[user] += 10000;
((NPC)obj).UnitFlags &= ~UnitFlags.SelectableNotAttackable;
((NPC)obj).UnitFlags &= ~UnitFlags.NotAttackable;
((NPC) obj).Target = user;
((NPC)obj).Brain.State = BrainState.Combat;
});
}));
return true;
}