diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2018-02-10 16:43:01 -0300 |
|---|---|---|
| committer | Ariel Silva <ariel-@users.noreply.github.com> | 2018-03-09 14:41:28 -0300 |
| commit | 45c5e1b9d63796d168339a44f63418f220cf2403 (patch) | |
| tree | c5c2ef9917147e38779d1f94e6ffc38386b9b251 /src/server/scripts/Spells | |
| parent | 080d2c6cd439acb2059adc4e24a279de98aa0db6 (diff) | |
Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 22 |
4 files changed, 18 insertions, 16 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 238637a13f2..deddf88b3dc 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -691,7 +691,7 @@ class spell_dk_corpse_explosion : public SpellScriptLoader } else if (effIndex == EFFECT_1) { - args.AddSpellBP0(GetSpell()->CalculateDamage(EFFECT_0, nullptr)); + args.AddSpellBP0(GetSpell()->CalculateDamage(EFFECT_0)); GetCaster()->CastSpell(target, GetEffectValue(), args); } } @@ -1136,7 +1136,7 @@ class spell_dk_death_strike : public SpellScriptLoader int32 bp = int32(count * caster->CountPctFromMaxHealth(int32(GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier))); // Improved Death Strike if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, DK_ICON_ID_IMPROVED_DEATH_STRIKE, 0)) - AddPct(bp, caster->CalculateSpellDamage(caster, aurEff->GetSpellInfo(), 2)); + AddPct(bp, caster->CalculateSpellDamage(aurEff->GetSpellInfo(), EFFECT_2)); // @todo castspell refactor note: this is not triggered - is this intended?? CastSpellExtraArgs args; @@ -1277,7 +1277,7 @@ class spell_dk_hysteria : public AuraScript void PeriodicTick(AuraEffect const* aurEff) { - uint32 const damage = GetTarget()->CountPctFromMaxHealth(GetTarget()->CalculateSpellDamage(nullptr, GetSpellInfo(), aurEff->GetEffIndex())); + uint32 const damage = GetTarget()->CountPctFromMaxHealth(GetTarget()->CalculateSpellDamage(GetSpellInfo(), aurEff->GetEffIndex())); Unit::DealDamage(GetTarget(), GetTarget(), damage, nullptr, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 9f8775e9bb9..1a0ffe8318a 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -505,7 +505,7 @@ class spell_dru_frenzied_regeneration : public AuraScript return; int32 const mod = std::min(static_cast<int32>(rage), 100); - int32 const regen = CalculatePct(GetTarget()->GetMaxHealth(), GetTarget()->CalculateSpellDamage(nullptr, GetSpellInfo(), EFFECT_1) * mod / 100.f); + int32 const regen = CalculatePct(GetTarget()->GetMaxHealth(), GetTarget()->CalculateSpellDamage(GetSpellInfo(), EFFECT_1) * mod / 100.f); CastSpellExtraArgs args(aurEff); args.AddSpellBP0(regen); GetTarget()->CastSpell(nullptr, SPELL_DRUID_FRENZIED_REGENERATION_HEAL, args); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 7e4d4b029a9..b27267571d8 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -1369,7 +1369,7 @@ class spell_hun_sniper_training : public SpellScriptLoader if (Player* playerTarget = GetUnitOwner()->ToPlayer()) { int32 baseAmount = aurEff->GetBaseAmount(); - int32 amount = playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount); + int32 amount = playerTarget->CalculateSpellDamage(GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount); GetEffect(EFFECT_0)->SetAmount(amount); } } @@ -1381,7 +1381,7 @@ class spell_hun_sniper_training : public SpellScriptLoader { int32 baseAmount = aurEff->GetBaseAmount(); int32 amount = playerTarget->isMoving() ? - playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) : + playerTarget->CalculateSpellDamage(GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount) : aurEff->GetAmount() - 1; aurEff->SetAmount(amount); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 2746dc65144..316bb1fe3f3 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -425,7 +425,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader case CREATURE_FAMILY_VOIDWALKER: { SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); - int32 hp = targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)); + int32 hp = targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(spellInfo, EFFECT_0)); CastSpellExtraArgs args(TRIGGERED_FULL_MASK); args.AddSpellBP0(hp); targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, args); @@ -1475,15 +1475,17 @@ class spell_warl_unstable_affliction : public SpellScriptLoader { if (AuraEffect const* aurEff = GetEffect(EFFECT_0)) { - Unit* target = dispelInfo->GetDispeller(); - int32 bp = aurEff->GetAmount(); - bp = target->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), bp, DOT); - bp *= 9; - - // backfire damage and silence - CastSpellExtraArgs args(aurEff); - args.AddSpellBP0(bp); - caster->CastSpell(target, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, args); + if (Unit* target = dispelInfo->GetDispeller()->ToUnit()) + { + int32 bp = aurEff->GetAmount(); + bp = target->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), bp, DOT); + bp *= 9; + + // backfire damage and silence + CastSpellExtraArgs args(aurEff); + args.AddSpellBP0(bp); + caster->CastSpell(target, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, args); + } } } } |
