Core/Auras: implemented SPELL_AURA_MOD_HEALING_DONE_PCT_VERSUS_TARGET_HEALTH

Port From (https://github.com/TrinityCore/TrinityCore/commit/ee2ebfe87db6e43fc0ee2e27d760d656eadf9526)
This commit is contained in:
hondacrx
2021-03-04 13:54:52 -05:00
parent b2041b1a58
commit 8a481dc9bd
2 changed files with 7 additions and 1 deletions
@@ -375,7 +375,7 @@ namespace Framework.Constants
ModCurrencyCategoryGainPct = 351, //NYI
Unk352 = 352,
ModCamouflage = 353, // Nyi
ModHealingDonePctVersusTargetHealth = 354, // NYI Restoration Shaman Mastery - Mod Healing Based On Target'S Health (Less = More Healing)
ModHealingDonePctVersusTargetHealth = 354, // Restoration Shaman Mastery - Mod Healing Based On Target'S Health (Less = More Healing)
ModCastingSpeed = 355, // NYI
ProvideTotemCategory = 356,
EnableBoss1UnitFrame = 357,
+6
View File
@@ -533,6 +533,12 @@ namespace Game.Entities
// Healing done percent
DoneTotalMod *= GetTotalAuraMultiplier(AuraType.ModHealingDonePercent);
// bonus from missing health of target
float healthPctDiff = 100.0f - victim.GetHealthPct();
foreach (AuraEffect healingDonePctVsTargetHealth in GetAuraEffectsByType(AuraType.ModHealingDonePctVersusTargetHealth))
if (healingDonePctVsTargetHealth.IsAffectingSpell(spellProto))
MathFunctions.AddPct(ref DoneTotalMod, MathFunctions.CalculatePct((float)healingDonePctVsTargetHealth.GetAmount(), healthPctDiff));
return DoneTotalMod;
}