本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}