diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 08976f1e3..943a3a7f2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11598,30 +11598,36 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto case SPELL_DAMAGE_CLASS_MELEE: // Custom crit by class if (caster) + { switch (spellProto->SpellFamilyName) { - case SPELLFAMILY_DRUID: - // Rend and Tear - bonus crit chance for Ferocious Bite on bleeding targets - if (spellProto->SpellFamilyFlags[0] & 0x00800000 - && spellProto->SpellIconID == 1680 - && HasAuraState(AURA_STATE_BLEEDING)) - { - if (AuraEffect const* rendAndTear = caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, 1)) - crit_chance += rendAndTear->GetAmount(); - break; - } + case SPELLFAMILY_DRUID: + // Rend and Tear - bonus crit chance for Ferocious Bite on bleeding targets + if (spellProto->SpellFamilyFlags[0] & 0x00800000 && spellProto->SpellIconID == 1680 && HasAuraState(AURA_STATE_BLEEDING)) + { + if (AuraEffect const* rendAndTear = caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, 1)) + crit_chance += rendAndTear->GetAmount(); break; - case SPELLFAMILY_WARRIOR: - // Victory Rush - if (spellProto->SpellFamilyFlags[1] & 0x100) - { - // Glyph of Victory Rush - if (AuraEffect const* aurEff = caster->GetAuraEffect(58382, 0)) - crit_chance += aurEff->GetAmount(); - break; - } + } + break; + case SPELLFAMILY_WARRIOR: + // Victory Rush + if (spellProto->SpellFamilyFlags[1] & 0x100) + { + // Glyph of Victory Rush + if (AuraEffect const* aurEff = caster->GetAuraEffect(58382, 0)) + crit_chance += aurEff->GetAmount(); break; + } + break; } + } + + // 100% critical chance against sitting target + if (GetTypeId() == TYPEID_PLAYER && (IsSitState() || getStandState() == UNIT_STAND_STATE_SLEEP)) + { + return 100.0f; + } [[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked. case SPELL_DAMAGE_CLASS_RANGED: {