Jump to content

[fix] Correct SPELL_AURA_FLY check


Guest danbst

Recommended Posts

Change check of SPELL_AURA_FLY. Will fix spells: 28622 (Web Wrap, used by Maexxna), 39432 (Gravity Lapse, used by Kael'thas), 55173 (flying form of wysp) + 51 other spells (maybe not full fix, but one more bug removed)

Full list of spells using SPELL_AURA_FLY you can get by

SELECT id, entry FROM wowd.wowd_spell WHERE EffectApplyAuraName_1=201 OR EffectApplyAuraName_2=201 OR EffectApplyAuraName_3=201

or here - http://thottbot.com/?e=Apply%20Aura%3A%20Cannot%20be%20Dodged#A::30

Copy post from getmangos.ru

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index d9c9722..a0c17b6 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4459,6 +4459,25 @@ SpellCastResult Spell::CheckCast(bool strict)

                break;
            }
+            //SPELL_AURA_FLY means player can fly without a mount. Here we check only for flying shapeshifting spells
+            //If spell is shapeshifting we will go to SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED check.
+            case SPELL_AURA_FLY:
+            {
+                if((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND) == 0)
+                    break;//Perhaps this is not a mount
+            }
+            //check for flying mounts. mount, that has SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED also has SPELL_AURA_MOUNTED
+            //exception is spell 49851, wich is Blizz internal and not used
+            case SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED:
+            {
+                // not allow cast mount spells at old maps by players (all spells are self target)
+                if(m_caster->GetTypeId() == TYPEID_PLAYER)
+                {
+                    if( !((Player*)m_caster)->IsAllowUseFlyMountsHere() )
+                        return SPELL_FAILED_NOT_HERE;
+                }
+                break;
+            }
            case SPELL_AURA_MOUNTED:
            {
                if (m_caster->IsInWater())
@@ -4491,18 +4510,6 @@ SpellCastResult Spell::CheckCast(bool strict)

                break;
            }
-            case SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED:
-            case SPELL_AURA_FLY:
-            {
-                // not allow cast fly spells at old maps by players (all spells is self target)
-                if(m_caster->GetTypeId()==TYPEID_PLAYER)
-                {
-                    if( !((Player*)m_caster)->IsAllowUseFlyMountsHere() )
-                        return SPELL_FAILED_NOT_HERE;
-                }
-
-                break;
-            }
            case SPELL_AURA_PERIODIC_MANA_LEECH:
            {
                if (!m_targets.getUnitTarget())

Wish this will help someone =)

Link to comment
Share on other sites

  • 4 weeks 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