protected virtual void Summon(SpellSummonEntry summonEntry) { Vector3 targetLoc = (double)this.m_cast.TargetLoc.X == 0.0 ? this.m_cast.CasterUnit.Position : this.m_cast.TargetLoc; int num1 = this.CalcEffectValue(); int num2 = !summonEntry.DetermineAmountBySpellEffect ? 1 : (num1 > 0 ? num1 : 1); for (int index = 0; index < num2; ++index) { NPC npc = summonEntry.Handler.Summon(this.m_cast, ref targetLoc, this.entry); npc.CreationSpellId = this.Effect.Spell.SpellId; if (!summonEntry.DetermineAmountBySpellEffect && num1 > 1) { npc.Health = npc.BaseHealth = num1; } } }
protected virtual void Summon(SpellSummonEntry summonEntry) { var caster = m_cast.CasterUnit; Vector3 targetLoc; if (m_cast.TargetLoc.X != 0) { targetLoc = m_cast.TargetLoc; } else { targetLoc = caster.Position; } var effectValue = CalcEffectValue(); int amount; if (summonEntry.DetermineAmountBySpellEffect) { amount = effectValue; if (amount < 1) { amount = 1; } } else { amount = 1; } for (var i = 0; i < amount; i++) { var minion = summonEntry.Handler.Summon(m_cast, ref targetLoc, entry); minion.CreationSpellId = Effect.Spell.SpellId; if (!summonEntry.DetermineAmountBySpellEffect && effectValue > 1) { // effectValue represents the health minion.Health = minion.BaseHealth = effectValue; } } }
protected virtual void Summon(SpellSummonEntry summonEntry) { var caster = m_cast.CasterUnit; Vector3 targetLoc; if (m_cast.TargetLoc.X != 0) { targetLoc = m_cast.TargetLoc; } else { targetLoc = caster.Position; } var effectValue = CalcEffectValue(); int amount; if (summonEntry.DetermineAmountBySpellEffect) { amount = effectValue > 0 ? effectValue : 1; } else { amount = 1; } for (var i = 0; i < amount; i++) { var minion = summonEntry.Handler.Summon(m_cast, ref targetLoc, entry); minion.CreationSpellId = Effect.Spell.SpellId; if (!summonEntry.DetermineAmountBySpellEffect && effectValue > 1) { // effectValue represents the health minion.Health = minion.BaseHealth = effectValue; } } }