Core/Units: Corrected values of UnitData::Resistances (should be total value)

Port From (https://github.com/TrinityCore/TrinityCore/commit/88f4d30445937b9de42f5cb25acad75fc89bdccb)
This commit is contained in:
hondacrx
2021-03-29 12:18:59 -04:00
parent 6e2c9a32e7
commit 6977599b1b
3 changed files with 23 additions and 15 deletions
+1 -1
View File
@@ -2210,7 +2210,7 @@ namespace Game.Entities
stmt.AddValue(index++, GetStat((Stats)i));
for (int i = 0; i < (int)SpellSchools.Max; ++i)
stmt.AddValue(index++, GetResistance((SpellSchools)i) + GetBonusResistanceMod((SpellSchools)i));
stmt.AddValue(index++, GetResistance((SpellSchools)i)));
stmt.AddValue(index++, (float)m_activePlayerData.BlockPercentage);
stmt.AddValue(index++, (float)m_activePlayerData.DodgePercentage);
+2 -2
View File
@@ -3828,7 +3828,7 @@ namespace Game.Entities
uint armor = proto.GetArmor(itemLevel);
if (armor != 0)
{
HandleStatFlatModifier(UnitMods.Armor, UnitModifierFlatType.Base, (float)armor, apply);
HandleStatFlatModifier(UnitMods.Armor, UnitModifierFlatType.Total, (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);
}
@@ -6691,7 +6691,7 @@ namespace Game.Entities
});
// If main hand is a 2h weapon, count it twice
if (!bestItemLevels.TryGetValue(EquipmentSlot.MainHand, out Tuple<InventoryType, uint> mainHand) && mainHand.Item1 == InventoryType.Weapon2Hand)
if (bestItemLevels.TryGetValue(EquipmentSlot.MainHand, out Tuple<InventoryType, uint> mainHand) && mainHand.Item1 == InventoryType.Weapon2Hand)
sum += mainHand.Item2;
sum /= 16.0f;