當前位置: 首頁>>代碼示例>>C#>>正文


C# NPCEntry.Create方法代碼示例

本文整理匯總了C#中WCell.RealmServer.NPCs.NPCEntry.Create方法的典型用法代碼示例。如果您正苦於以下問題:C# NPCEntry.Create方法的具體用法?C# NPCEntry.Create怎麽用?C# NPCEntry.Create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WCell.RealmServer.NPCs.NPCEntry的用法示例。


在下文中一共展示了NPCEntry.Create方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Summon

		public virtual NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
		{
			var caster = cast.CasterUnit;
			var duration = cast.Spell.GetDuration(cast.CasterReference);

			NPC minion;
			if (caster != null)
			{
				minion = caster.SpawnMinion(entry, ref targetLoc, duration);
			}
			else
			{
				minion = entry.Create(cast.TargetMap.DifficultyIndex);

				minion.Position = targetLoc;
				minion.Brain.IsRunning = true;
				minion.Phase = cast.Phase;
				cast.Map.AddObject(minion);
			}

			if (caster is Character)
			{
				minion.Level = caster.Level;
			}
			minion.Summoner = caster;
			minion.Creator = cast.CasterReference.EntityId;

			return minion;
		}
開發者ID:Jeroz,項目名稱:WCell,代碼行數:29,代碼來源:SpellSummons.cs

示例2: CreateMinion

		/// <summary>
		/// Creates and makes visible the Unit's controlled Minion
		/// </summary>
		/// <param name="entry">The template for the Minion</param>
		/// <param name="position">The place to spawn the minion.</param>
		/// <param name="duration">Time till the minion goes away.</param>
		/// <returns>A reference to the minion.</returns>
		public NPC CreateMinion(NPCEntry entry, int durationMillis)
		{
			var minion = entry.Create();
			minion.Phase = Phase;
			minion.Zone = Zone;
			minion.RemainingDecayDelay = durationMillis;
			minion.Brain.IsRunning = true;

			if (Health > 0)
			{
				Enslave(minion, durationMillis);
			}
			return minion;
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:21,代碼來源:Unit.cs

示例3: Summon

        public override NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
        {
            var npc = entry.Create(cast.CasterUnit.Region, targetLoc);
			npc.RemainingDecayDelay = cast.Spell.GetDuration(cast.Caster.CasterInfo);
            return npc;
        }
開發者ID:ray2006,項目名稱:WCell,代碼行數:6,代碼來源:SpellSummonHandlers.cs

示例4: Summon

		public override NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
		{
			var npc = entry.Create(cast.Map, targetLoc);
			npc.RemainingDecayDelayMillis = cast.Spell.GetDuration(cast.CasterReference);
			npc.Creator = cast.CasterReference.EntityId;	// should be right
			return npc;
		}
開發者ID:enjoii,項目名稱:WCell,代碼行數:7,代碼來源:SpellSummons.cs


注:本文中的WCell.RealmServer.NPCs.NPCEntry.Create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。