From 4ab66b1462e7035f28447c6212e347dd92dc67db Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Thu, 27 Aug 2020 16:51:41 +0200 Subject: [PATCH] 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%. --- src/server/game/Entities/Unit/Unit.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index defb6a0162..ce4ec9c31a 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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);