diff options
| author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2022-02-07 20:53:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-07 20:53:32 +0100 |
| commit | d22d4616339a966ce5e5fe959dca622fc21b7988 (patch) | |
| tree | b25cbc55d186373400e43f5cdbe15e795ecfb7e3 /src/server/game/Entities/Unit | |
| parent | 2ae67de4c0f327edc60d5da9cc815016d48b7228 (diff) | |
Core/Spells: Implement SPELL_ATTR7_NO_ATTACK_DODGE, SPELL_ATTR7_NO_ATTACK_PARRY and SPELL_ATTR7_NO_ATTACK_MISS (#27715)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f9e66caa44d..cfb20a015b8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2363,8 +2363,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_NO_ATTACK_DODGE); + bool canParry = !spellInfo->HasAttribute(SPELL_ATTR7_NO_ATTACK_PARRY); bool canBlock = spellInfo->HasAttribute(SPELL_ATTR3_BLOCKABLE_SPELL); // if victim is casting or cc'd it can't avoid attacks @@ -11559,6 +11559,9 @@ 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, SpellInfo const* spellInfo) const { + if (spellInfo && spellInfo->HasAttribute(SPELL_ATTR7_NO_ATTACK_MISS)) + return 0.f; + //calculate miss chance float missChance = victim->GetUnitMissChance(); |
