mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 14:39:43 -04:00
Core/Spells: defined and implemented SPELL_ATTR7_CANT_DODGE, SPELL_ATTR7_CANT_PARRY and SPELL_ATTR7_CANT_MISS (#26742)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user