From 8594fcfe8a0085a087bce510e3b4cb14f632434f Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 2 Aug 2023 00:12:16 +0200 Subject: Scripts/Spells: Converted some damage calculating scripts to use new hooks as examples --- src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server/scripts/Shadowlands') diff --git a/src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp b/src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp index f1911ac9c53..adbcbe4b4d9 100644 --- a/src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp +++ b/src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp @@ -102,16 +102,16 @@ class spell_torghast_touch_of_the_unseen : public AuraScript // 305060 - Yel'Shir's Powerglove class spell_torghast_yelshirs_powerglove : public SpellScript { - void HandleEffect(SpellEffIndex /*effIndex*/) + void CalculateDamage(Unit const* /*victim*/, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const { if (SpellInfo const* triggeringSpell = GetTriggeringSpell()) if (Aura const* triggerAura = GetCaster()->GetAura(triggeringSpell->Id)) - SetEffectValue(GetEffectValue() * triggerAura->GetStackAmount()); + pctMod *= triggerAura->GetStackAmount(); } void Register() override { - OnEffectLaunchTarget += SpellEffectFn(spell_torghast_yelshirs_powerglove::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + CalcDamage += SpellCalcDamageFn(spell_torghast_yelshirs_powerglove::CalculateDamage); } }; @@ -313,7 +313,7 @@ class spell_torghast_potent_potion_calc : public SpellScript void SetValue(SpellEffIndex effIndex) { SetEffectValue(sSpellMgr->AssertSpellInfo(SPELL_LABEL_SPIRITUAL_REJUVENATION_POTION, GetCastDifficulty())->GetEffect(effIndex) - .CalcValue(GetCaster(), nullptr, GetHitUnit()));; + .CalcValue(GetCaster(), nullptr, GetHitUnit())); } void Register() override -- cgit v1.2.3