From ec8b00a385ba34a1aad9bf85b85ed9d3fbf38e75 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Tue, 30 Jul 2019 15:58:00 +0200 Subject: [PATCH] Core/Spells: corrected Light of Dawn calculations --- src/server/game/Spells/SpellMgr.cpp | 6 ++++++ src/server/scripts/Spells/spell_paladin.cpp | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 0709badfd29..03f1fd6e8cb 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -5442,6 +5442,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; }); + // Light of Dawn + ApplySpellFix({ 85222 }, [](SpellInfo* spellInfo) + { + spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 9e2cb0ff826..ab12657979f 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1914,21 +1914,21 @@ class spell_pal_light_of_dawn: public SpellScript if (!caster) return; - int32 heal = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster, nullptr, GetHitUnit()); - if (Player* modOwner = caster->GetSpellModOwner()) - modOwner->ApplySpellMod(GetSpellInfo()->Id, SPELLMOD_DAMAGE, heal); - - heal += caster->SpellHealingBonusDone(GetHitUnit(), GetSpellInfo(), heal, HEAL, EFFECT_1); + int32 heal = GetHitHeal(); heal += heal * caster->GetPower(POWER_HOLY_POWER); - // For some reason there is a 2nd effect that is being calculated correctly so we will use its data - PreventHitEffect(EFFECT_1); SetHitHeal(heal); } + void BlockHeal(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + } + void Register() override { OnEffectHitTarget += SpellEffectFn(spell_pal_light_of_dawn::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + OnEffectLaunchTarget += SpellEffectFn(spell_pal_light_of_dawn::BlockHeal, EFFECT_1, SPELL_EFFECT_HEAL); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_light_of_dawn::FilterTargets, EFFECT_0, TARGET_UNIT_CONE_ALLY); } };