refactor(Scripts/Spells): Check for existence of AD debuff instead of adding a custom cooldown to heal (#17265)

* Update spell_paladin.cpp

* whitespace
This commit is contained in:
Tereneckla
2023-09-15 23:30:15 +00:00
committed by GitHub
parent d18368ad60
commit edaf38c6c3

View File

@@ -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))
{