Core/Spells: defined and implemented SPELL_ATTR7_CANT_DODGE, SPELL_ATTR7_CANT_PARRY and SPELL_ATTR7_CANT_MISS (#26742)

This commit is contained in:
Gildor
2021-07-24 14:48:57 +02:00
committed by GitHub
parent ba4f2e5a83
commit bd6de8eb61
4 changed files with 21 additions and 14 deletions
+6 -2
View File
@@ -2421,8 +2421,8 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
if (spellInfo->HasAttribute(SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK))
return SPELL_MISS_NONE;
bool canDodge = true;
bool canParry = true;
bool canDodge = !spellInfo->HasAttribute(SPELL_ATTR7_CANT_DODGE);
bool canParry = !spellInfo->HasAttribute(SPELL_ATTR7_CANT_PARRY);
bool canBlock = spellInfo->HasAttribute(SPELL_ATTR3_BLOCKABLE_SPELL);
// if victim is casting or cc'd it can't avoid attacks
@@ -12050,6 +12050,10 @@ int32 Unit::CalculateAOEAvoidance(int32 damage, uint32 schoolMask, ObjectGuid co
// Crit or block - determined on damage calculation phase! (and can be both in some time)
float Unit::MeleeSpellMissChance(Unit const* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const
{
SpellInfo const* spellInfo = spellId ? sSpellMgr->GetSpellInfo(spellId) : nullptr;
if (spellInfo && spellInfo->HasAttribute(SPELL_ATTR7_CANT_MISS))
return 0.f;
//calculate miss chance
float missChance = victim->GetUnitMissChance();