aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorGildor <gildor55@gmail.com>2021-07-24 14:48:57 +0200
committerGitHub <noreply@github.com>2021-07-24 14:48:57 +0200
commitbd6de8eb6104e5e3e08149dfd44008ef0fb4c74a (patch)
tree8037a1a639213c136478bac4333ec53de1c55b8e /src/server/game/Entities/Unit
parentba4f2e5a83629fa6043784781847416b61c8511f (diff)
Core/Spells: defined and implemented SPELL_ATTR7_CANT_DODGE, SPELL_ATTR7_CANT_PARRY and SPELL_ATTR7_CANT_MISS (#26742)
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 24e0742bbc5..8d711548b6c 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -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();