Jump to content

Dont block Spell_attr_impossible_dodge_parry_block


michalpolko

Recommended Posts

MaNGOS revision: 10154

What does the patch fix?

Checking if a spell has attribute SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK in IsSpellBlocked().

As a bug report: currently Overpower can be blocked (but shouldn't).

diff:

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index d56e6de..a666e38 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -2843,11 +2843,11 @@ void Unit::SendMeleeAttackStop(Unit* victim)
    ((Creature*)victim)->AI().EnterEvadeMode(this);*/
}

-bool Unit::IsSpellBlocked(Unit *pCaster, SpellEntry const * /*spellProto*/, WeaponAttackType attackType)
+bool Unit::IsSpellBlocked(Unit *pCaster, SpellEntry const *spellEntry, WeaponAttackType attackType)
{
    if (HasInArc(M_PI_F,pCaster))
    {
-        /* Currently not exist spells with ignore block
+        /*
        // Ignore combat result aura (parry/dodge check on prepare)
        AuraList const& ignore = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
        for(AuraList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
@@ -2859,6 +2859,13 @@ bool Unit::IsSpellBlocked(Unit *pCaster, SpellEntry const * /*spellProto*/, Weap
        }
        */

+        if (spellEntry)
+        {
+            // Some spells cannot be blocked
+            if (spellEntry->Attributes & SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK)
+                return false;
+        }
+
        // Check creatures flags_extra for disable block
        if(GetTypeId()==TYPEID_UNIT &&
           ((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK )

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use