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


C# GameObject.GetNearbyNPC方法代码示例

本文整理汇总了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;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:51,代码来源:DeathKnightQuests.cs


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