Core/Spells: fixed a typo that caused Divine Aegis to absorb 0 damage in all cases and corrected proc behavior

This commit is contained in:
Ovahlord
2021-02-21 11:23:17 +01:00
parent 768704187c
commit 42f3e722f6
2 changed files with 10 additions and 2 deletions

View File

@@ -276,7 +276,14 @@ class spell_pri_divine_aegis : public AuraScript
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetProcTarget() != nullptr;
if (!eventInfo.GetProcTarget() || !eventInfo.GetSpellInfo())
return false;
// Prayer of Healing always triggers Divine Aegis
if (eventInfo.GetSpellInfo()->SpellFamilyFlags[0] & 0x200)
return true;
return (eventInfo.GetHitMask() & PROC_HIT_CRITICAL);
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
@@ -294,7 +301,7 @@ class spell_pri_divine_aegis : public AuraScript
absorb = std::min(absorb, int32(CalculatePct(eventInfo.GetProcTarget()->GetMaxHealth(), 40)));
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_DIVINE_AEGIS, CastSpellExtraArgs(aurEff).AddSpellBP0(SPELLVALUE_BASE_POINT0));
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_DIVINE_AEGIS, CastSpellExtraArgs(aurEff).AddSpellBP0(absorb));
}
void Register() override