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 committed 2021-02-21 11:23:17 +01:00
1 parent 768704187c
commit 42f3e722f6
2 files changed
+10 -2

No files matched your search

@@ -0,0 +1 @@
UPDATE `spell_proc` SET `HitMask`= 0, `SpellFamilyName`= 6 WHERE `SpellId`= -47509;
+9 -2
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