Core/Players: Corrected shield block value calculations

Port From (https://github.com/TrinityCore/TrinityCore/commit/31d3080091643d4e348ec53c5bec3caf0e17110f)
This commit is contained in:
hondacrx
2021-02-21 21:44:30 -05:00
parent baa44cc4ee
commit 26c57969fb
5 changed files with 20 additions and 9 deletions
@@ -4239,7 +4239,11 @@ namespace Game.Entities
uint armor = proto.GetArmor(itemLevel);
if (armor != 0)
{
HandleStatFlatModifier(UnitMods.Armor, UnitModifierFlatType.Base, (float)armor, apply);
if (proto.GetClass() == ItemClass.Armor && (ItemSubClassArmor)proto.GetSubClass() == ItemSubClassArmor.Shield)
SetUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.ShieldBlock), apply ? (uint)(armor * 2.5f) : 0);
}
WeaponAttackType attType = GetAttackBySlot(slot, proto.GetInventoryType());
if (attType != WeaponAttackType.Max && CanUseAttackType(attType))