From 86d1f0ea1c8d72d54e6f0392705f7f61eb27e723 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 27 Feb 2022 14:03:46 -0500 Subject: [PATCH] Scripts/Spells: Updated Power Word: Shield script Port From (https://github.com/TrinityCore/TrinityCore/commit/03dd82b52d340e9e21e22fff0c3e5fee1a35a52d) --- Source/Scripts/Spells/Priest.cs | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/Source/Scripts/Spells/Priest.cs b/Source/Scripts/Spells/Priest.cs index 71df1bc25..6010f8161 100644 --- a/Source/Scripts/Spells/Priest.cs +++ b/Source/Scripts/Spells/Priest.cs @@ -52,6 +52,7 @@ namespace Scripts.Spells.Priest public const uint LevitateEffect = 111759; public const uint MasochismTalent = 193063; public const uint MasochismPeriodicHeal = 193065; + public const uint MasteryGrace = 271534; public const uint MindBombStun = 226943; public const uint OracularHeal = 26170; public const uint PenanceR1 = 47540; @@ -61,6 +62,7 @@ namespace Scripts.Spells.Priest public const uint PrayerOfMendingHeal = 33110; public const uint PrayerOfMendingJump = 155793; public const uint PrayerOfHealing = 596; + public const uint Rapture = 47536; public const uint Renew = 139; public const uint RenewedHope = 197469; public const uint RenewedHopeEffect = 197470; @@ -572,22 +574,34 @@ namespace Scripts.Spells.Priest { return ValidateSpellInfo(SpellIds.BodyAndSoul, SpellIds.BodyAndSoulSpeed, SpellIds.StrengthOfSoul, SpellIds.StrengthOfSoulEffect, SpellIds.RenewedHope, SpellIds.RenewedHopeEffect, SpellIds.VoidShield, SpellIds.VoidShieldEffect, SpellIds.Atonement, SpellIds.Trinity, SpellIds.AtonementTriggered, SpellIds.AtonementTriggeredPowerTrinity, SpellIds.ShieldDisciplinePassive, - SpellIds.ShieldDisciplineEnergize); + SpellIds.ShieldDisciplineEnergize, SpellIds.Rapture, SpellIds.MasteryGrace); } void CalculateAmount(AuraEffect auraEffect, ref int amount, ref bool canBeRecalculated) { canBeRecalculated = false; - Player player = GetCaster().ToPlayer(); - if (player) + Unit caster = GetCaster(); + if (caster != null) { - int playerMastery = (int)player.GetRatingBonusValue(CombatRating.Mastery); - int playerSpellPower = player.SpellBaseDamageBonusDone(SpellSchoolMask.Holy); - int playerVersatileDamage = (int)player.GetRatingBonusValue(CombatRating.VersatilityDamageDone); + float amountF = caster.SpellBaseDamageBonusDone(GetSpellInfo().GetSchoolMask()) * 1.65f; - //Formula taken from SpellWork - amount = (int)((playerSpellPower * 5.5f) + playerMastery) * (1 + playerVersatileDamage); + Player player = caster.ToPlayer(); + if (player != null) + { + MathFunctions.AddPct(ref amountF, player.GetRatingBonusValue(CombatRating.VersatilityDamageDone)); + + AuraEffect mastery = caster.GetAuraEffect(SpellIds.MasteryGrace, 0); + if (mastery != null) + if (GetUnitOwner().HasAura(SpellIds.AtonementTriggered) || GetUnitOwner().HasAura(SpellIds.AtonementTriggeredPowerTrinity)) + MathFunctions.AddPct(ref amountF, mastery.GetAmount()); + } + + AuraEffect rapture = caster.GetAuraEffect(SpellIds.Rapture, 1); + if (rapture != null) + MathFunctions.AddPct(ref amountF, rapture.GetAmount()); + + amount = (int)amountF; } }