Core/Units: added crit chance supression

According to blueposts and wikis, there is a supression to crit chances if the target is having a higher level than the attacker. Each level that the target is above the one of the attacker, the crit chance is reduced by 1%. Though this number is solely based on bluepost data so this needs extensive testing since fan made calculations point more towards 0.7%.
This commit is contained in:
Ovahlord committed 2020-08-27 17:00:00 +02:00
1 parent f729891536
commit 4ab66b1462
1 file changed
+5
+5
View File
@@ -2896,6 +2896,11 @@ float Unit::GetUnitCriticalChanceTaken(Unit const* attacker, WeaponAttackType at
{
float chance = critDone;
// crit chance supression (-1% of the base crit chance per level difference according to bluepost. Fan-made tests seem to be more moving arround 0.7% but that has yet to be confirmed.)
int8 levelDifference = getLevel() - attacker->getLevel();
if (levelDifference > 0)
chance -= levelDifference;
// flat aura mods
if (attackType == RANGED_ATTACK)
chance += GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE);