fix(Core/Spells): melee spells on sitting targets guaranteed critical strikes (#7085)

- Closes #5986
This commit is contained in:
UltraNix
2021-07-27 13:37:47 +02:00
committed by GitHub
parent f9125f130e
commit 47f7c46f96
+9 -3
View File
@@ -11598,13 +11598,12 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
case SPELL_DAMAGE_CLASS_MELEE: case SPELL_DAMAGE_CLASS_MELEE:
// Custom crit by class // Custom crit by class
if (caster) if (caster)
{
switch (spellProto->SpellFamilyName) switch (spellProto->SpellFamilyName)
{ {
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
// Rend and Tear - bonus crit chance for Ferocious Bite on bleeding targets // Rend and Tear - bonus crit chance for Ferocious Bite on bleeding targets
if (spellProto->SpellFamilyFlags[0] & 0x00800000 if (spellProto->SpellFamilyFlags[0] & 0x00800000 && spellProto->SpellIconID == 1680 && HasAuraState(AURA_STATE_BLEEDING))
&& spellProto->SpellIconID == 1680
&& HasAuraState(AURA_STATE_BLEEDING))
{ {
if (AuraEffect const* rendAndTear = caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, 1)) if (AuraEffect const* rendAndTear = caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, 1))
crit_chance += rendAndTear->GetAmount(); crit_chance += rendAndTear->GetAmount();
@@ -11622,6 +11621,13 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
} }
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. [[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: case SPELL_DAMAGE_CLASS_RANGED:
{ {