From 21b5fe44f51bcf0c4955e1668f98839bee4bf05b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 7 Sep 2022 15:43:21 -0400 Subject: [PATCH] Core/Auras: Implement SPELL_AURA_MOD_BONUS_ARMOR_PCT and rename HandleModStatBonusArmor Port From (https://github.com/TrinityCore/TrinityCore/commit/6e9a6700d83f0ad07c7c56becfc3a62434707208) --- Source/Game/Entities/StatSystem.cs | 1 + Source/Game/Spells/Auras/AuraEffect.cs | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Game/Entities/StatSystem.cs b/Source/Game/Entities/StatSystem.cs index e044b3bc4..37ffbd86c 100644 --- a/Source/Game/Entities/StatSystem.cs +++ b/Source/Game/Entities/StatSystem.cs @@ -1362,6 +1362,7 @@ namespace Game.Entities value += GetFlatModifierValue(unitMod, UnitModifierFlatType.Total); // bonus armor from auras and items value *= GetPctModifierValue(unitMod, UnitModifierPctType.Total); + value *= GetTotalAuraMultiplier(AuraType.ModBonusArmorPct); SetArmor((int)value, (int)(value - baseValue)); diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index ea0f18c18..d90028a3c 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -3225,7 +3225,7 @@ namespace Game.Spells } [AuraEffectHandler(AuraType.ModBonusArmor)] - void HandleModStatBonusArmor(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) + void HandleModBonusArmor(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) { if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat)) return; @@ -3233,6 +3233,15 @@ namespace Game.Spells aurApp.GetTarget().HandleStatFlatModifier(UnitMods.Armor, UnitModifierFlatType.Base, GetAmount(), apply); } + [AuraEffectHandler(AuraType.ModBonusArmorPct)] + void HandleModBonusArmorPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) + { + if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat)) + return; + + aurApp.GetTarget().UpdateArmor(); + } + [AuraEffectHandler(AuraType.ModStatBonusPct)] void HandleModStatBonusPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) {