Core/Creatures: Update creature scaling to use content tuning
Port From (https://github.com/TrinityCore/TrinityCore/commit/314a35f0cd912daed7c0663f4f13552b6747fd98)
This commit is contained in:
@@ -2760,14 +2760,13 @@ namespace Game.Entities
|
||||
return damage;
|
||||
|
||||
uint attackerLevel = attacker.GetLevelForTarget(victim);
|
||||
if (attackerLevel > CliDB.ArmorMitigationByLvlGameTable.GetTableRowCount())
|
||||
attackerLevel = (uint)CliDB.ArmorMitigationByLvlGameTable.GetTableRowCount();
|
||||
// Expansion and ContentTuningID necessary? Does Player get a ContentTuningID too ?
|
||||
float armorConstant = Global.DB2Mgr.EvaluateExpectedStat(ExpectedStatType.ArmorConstant, attackerLevel, -2, 0, attacker.GetClass());
|
||||
|
||||
GtArmorMitigationByLvlRecord ambl = CliDB.ArmorMitigationByLvlGameTable.GetRow(attackerLevel);
|
||||
if (ambl == null)
|
||||
if (armorConstant == 0)
|
||||
return damage;
|
||||
|
||||
float mitigation = Math.Min(armor / (armor + ambl.Mitigation), 0.85f);
|
||||
float mitigation = Math.Min(armor / (armor + armorConstant), 0.85f);
|
||||
return Math.Max((uint)(damage * (1.0f - mitigation)), 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user