Core/Auras: implemented SPELL_AURA_MOD_HEALING_DONE_PCT_VERSUS_TARGET_HEALTH (#26176)

This commit is contained in:
Ovah
2021-02-27 20:55:59 +01:00
committed by GitHub
parent e972f84e7b
commit ee2ebfe87d
3 changed files with 8 additions and 2 deletions

View File

@@ -7264,6 +7264,12 @@ float Unit::SpellHealingPctDone(Unit* victim, SpellInfo const* spellProto) const
// Healing done percent
DoneTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
// bonus from missing health of target
float healthPctDiff = 100.0f - victim->GetHealthPct();
for (AuraEffect const* healingDonePctVsTargetHealth : GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PCT_VERSUS_TARGET_HEALTH))
if (healingDonePctVsTargetHealth->IsAffectingSpell(spellProto))
AddPct(DoneTotalMod, CalculatePct(float(healingDonePctVsTargetHealth->GetAmount()), healthPctDiff));
return DoneTotalMod;
}