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; }
/// <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; }
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; }
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; }