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
+25 -19
View File
@@ -11598,30 +11598,36 @@ 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))
{ crit_chance += rendAndTear->GetAmount();
if (AuraEffect const* rendAndTear = caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, 1))
crit_chance += rendAndTear->GetAmount();
break;
}
break; break;
case SPELLFAMILY_WARRIOR: }
// Victory Rush break;
if (spellProto->SpellFamilyFlags[1] & 0x100) case SPELLFAMILY_WARRIOR:
{ // Victory Rush
// Glyph of Victory Rush if (spellProto->SpellFamilyFlags[1] & 0x100)
if (AuraEffect const* aurEff = caster->GetAuraEffect(58382, 0)) {
crit_chance += aurEff->GetAmount(); // Glyph of Victory Rush
break; if (AuraEffect const* aurEff = caster->GetAuraEffect(58382, 0))
} crit_chance += aurEff->GetAmount();
break; 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:
{ {