diff --git a/Source/Scripts/Spells/Priest.cs b/Source/Scripts/Spells/Priest.cs index af737c9fa..4932df01b 100644 --- a/Source/Scripts/Spells/Priest.cs +++ b/Source/Scripts/Spells/Priest.cs @@ -41,6 +41,7 @@ namespace Scripts.Spells.Priest public const uint DivineStarShadowDamage = 390845; public const uint DivineStarShadowHeal = 390981; public const uint DivineWrath = 40441; + public const uint EmpoweredRenewHeal = 391359; public const uint FlashHeal = 2061; public const uint GuardianSpiritHeal = 48153; public const uint HaloHoly = 120517; @@ -502,6 +503,35 @@ namespace Scripts.Spells.Priest }); } } + + [Script] // 391339 - Empowered Renew + class spell_pri_empowered_renew : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.Renew, SpellIds.EmpoweredRenewHeal) + && ValidateSpellEffect(SpellIds.Renew, 0) + && Global.SpellMgr.GetSpellInfo(SpellIds.Renew, Difficulty.None).GetEffect(0).IsAura(AuraType.PeriodicHeal); + } + + void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) + { + Unit caster = eventInfo.GetActor(); + Unit target = eventInfo.GetProcTarget(); + + SpellInfo renewSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.Renew, GetCastDifficulty()); + SpellEffectInfo renewEffect = renewSpellInfo.GetEffect(0); + int estimatedTotalHeal = (int)AuraEffect.CalculateEstimatedfTotalPeriodicAmount(caster, target, renewSpellInfo, renewEffect, renewEffect.CalcValue(caster), 1); + int healAmount = MathFunctions.CalculatePct(estimatedTotalHeal, aurEff.GetAmount()); + + caster.CastSpell(target, SpellIds.EmpoweredRenewHeal, new CastSpellExtraArgs(aurEff).AddSpellMod(SpellValueMod.BasePoint0, healAmount)); + } + + public override void Register() + { + OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy)); + } + } [Script] // 47788 - Guardian Spirit class spell_pri_guardian_spirit : AuraScript