mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
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:
@@ -302,7 +302,8 @@ private:
|
|||||||
|
|
||||||
enum Spell
|
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
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||||
@@ -329,7 +330,7 @@ private:
|
|||||||
int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
|
int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
|
||||||
uint32 allowedHealth = victim->CountPctFromMaxHealth(35);
|
uint32 allowedHealth = victim->CountPctFromMaxHealth(35);
|
||||||
// If damage kills us
|
// 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
|
// Cast healing spell, completely avoid damage
|
||||||
absorbAmount = dmgInfo.GetDamage();
|
absorbAmount = dmgInfo.GetDamage();
|
||||||
@@ -344,7 +345,6 @@ private:
|
|||||||
|
|
||||||
int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
|
int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
|
||||||
victim->CastCustomSpell(PAL_SPELL_ARDENT_DEFENDER_HEAL, SPELLVALUE_BASE_POINT0, healAmount, victim, true, nullptr, aurEff);
|
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))
|
else if (remainingHealth < int32(allowedHealth))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user