aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2021-02-27 20:55:59 +0100
committerGitHub <noreply@github.com>2021-02-27 20:55:59 +0100
commitee2ebfe87db6e43fc0ee2e27d760d656eadf9526 (patch)
treec0dc3b8f72dc562296e93a1fc760d9bd43b0cb98 /src/server/game/Entities/Unit
parente972f84e7b29fbd3597a3850fb4751002c9eceee (diff)
Core/Auras: implemented SPELL_AURA_MOD_HEALING_DONE_PCT_VERSUS_TARGET_HEALTH (#26176)
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index db9c5d5eacb..ffd44153cd0 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -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;
}