From 24b84ba98094503aa95bc76249139c0aee9daf26 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Wed, 31 Aug 2022 19:15:47 +0200 Subject: [PATCH] Core/Spells: Eye for an Eye will now deal damage to the attacker instead of attempting (and failing) to target the caster himself --- sql/updates/world/4.3.4/2022_08_31_02_world.sql | 1 + src/server/scripts/Spells/spell_paladin.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/4.3.4/2022_08_31_02_world.sql diff --git a/sql/updates/world/4.3.4/2022_08_31_02_world.sql b/sql/updates/world/4.3.4/2022_08_31_02_world.sql new file mode 100644 index 0000000000..f9da173d74 --- /dev/null +++ b/sql/updates/world/4.3.4/2022_08_31_02_world.sql @@ -0,0 +1 @@ +UPDATE `spell_proc` SET `HitMask`= 0 WHERE `SpellId`= -9799; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index cdeca830ff..d5fbbb1eb5 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -450,15 +450,22 @@ class spell_pal_eye_for_an_eye : public AuraScript return ValidateSpellInfo({ SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE }); } + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetDamageInfo() && eventInfo.GetDamageInfo()->GetDamage() > 0; + } + void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()); - GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, CastSpellExtraArgs(aurEff).AddSpellBP0(damage)); + if (damage) + GetTarget()->CastSpell(eventInfo.GetActor(), SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, CastSpellExtraArgs(aurEff).AddSpellBP0(damage)); } void Register() override { + DoCheckProc.Register(&spell_pal_eye_for_an_eye::CheckProc); OnEffectProc.Register(&spell_pal_eye_for_an_eye::HandleEffectProc, EFFECT_0, m_scriptSpellId == SPELL_PALADIN_EYE_FOR_AN_EYE_RANK_1 ? SPELL_AURA_DUMMY : SPELL_AURA_PROC_TRIGGER_SPELL); } };