From edaf38c6c37eb6a1ef01fea059bf8058e175da8b Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Fri, 15 Sep 2023 23:30:15 +0000 Subject: [PATCH] refactor(Scripts/Spells): Check for existence of AD debuff instead of adding a custom cooldown to heal (#17265) * Update spell_paladin.cpp * whitespace --- src/server/scripts/Spells/spell_paladin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 14dfc2e24..55945914e 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -302,7 +302,8 @@ private: enum Spell { - PAL_SPELL_ARDENT_DEFENDER_HEAL = 66235 + PAL_SPELL_ARDENT_DEFENDER_DEBUFF = 66233, + PAL_SPELL_ARDENT_DEFENDER_HEAL = 66235 }; bool Validate(SpellInfo const* /*spellInfo*/) override @@ -329,7 +330,7 @@ private: int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage(); uint32 allowedHealth = victim->CountPctFromMaxHealth(35); // If damage kills us - if (remainingHealth <= 0 && !victim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL)) + if (remainingHealth <= 0 && !victim->ToPlayer()->HasAura(PAL_SPELL_ARDENT_DEFENDER_DEBUFF)) { // Cast healing spell, completely avoid damage absorbAmount = dmgInfo.GetDamage(); @@ -344,7 +345,6 @@ private: int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense))); victim->CastCustomSpell(PAL_SPELL_ARDENT_DEFENDER_HEAL, SPELLVALUE_BASE_POINT0, healAmount, victim, true, nullptr, aurEff); - victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, 120000); } else if (remainingHealth < int32(allowedHealth)) {