當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。