Core/Auras: Implemented aura to increase armor by percentage of primary stat

Port From (https://github.com/TrinityCore/TrinityCore/commit/b574be08ae552dcc4bba09e15422d74866a0e7d2)
This commit is contained in:
hondacrx
2021-03-29 12:12:49 -04:00
parent b00a895f19
commit 6e2c9a32e7
3 changed files with 30 additions and 4 deletions
+15
View File
@@ -3079,6 +3079,21 @@ namespace Game.Spells
target.ToPlayer().UpdateExpertise(WeaponAttackType.OffAttack);
}
// Increase armor by <AuraEffect.BasePoints> % of your <primary stat>
[AuraEffectHandler(AuraType.ModArmorPctFromStat)]
void HandleModArmorPctFromStat(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat))
return;
// only players have primary stats
Player player = aurApp.GetTarget().ToPlayer();
if (!player)
return;
player.UpdateArmor();
}
[AuraEffectHandler(AuraType.ModStatBonusPct)]
void HandleModStatBonusPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{