From bd6de8eb6104e5e3e08149dfd44008ef0fb4c74a Mon Sep 17 00:00:00 2001 From: Gildor Date: Sat, 24 Jul 2021 14:48:57 +0200 Subject: Core/Spells: defined and implemented SPELL_ATTR7_CANT_DODGE, SPELL_ATTR7_CANT_PARRY and SPELL_ATTR7_CANT_MISS (#26742) --- src/server/game/Entities/Unit/Unit.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/server/game/Entities/Unit') 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(); -- cgit v1.2.3