mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
fix(Core/Spells): melee spells on sitting targets guaranteed critical strikes (#7085)
- Closes #5986
This commit is contained in:
@@ -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:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user