Jump to content

[Fix][8934] Ghost Wolf movement speed while slowed


Auntie Mangos

Recommended Posts

* What bug does the patch fix? What features does the patch add?

This implements aura 305 (minimum movement speed) used by the spell Ghost Wolf. While under its effect the player doesn't move below a certain speed (100% in this case) when affected by slows. Also includes shapeshift boost and stacking rule to make it work.

* For which repository revision was the patch created?

8734

* Is there a thread in the bug report section or at lighthouse?

http://getmangos.eu/community/viewtopic.php?id=10662

* Who has been writing this patch? Please include either forum user names or email addresses.

darkstalker

diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
index 3ccdb1e..9ab4612 100644
--- a/src/game/SpellAuraDefines.h
+++ b/src/game/SpellAuraDefines.h
@@ -347,7 +347,7 @@ enum AuraType
    SPELL_AURA_302 = 302,
    SPELL_AURA_303 = 303,
    SPELL_AURA_304 = 304,
-    SPELL_AURA_305 = 305,
+    SPELL_AURA_MOD_MINIMUM_SPEED = 305,
    SPELL_AURA_306 = 306,
    TOTAL_AURAS = 307
};
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 582946a..77538dc 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -355,7 +355,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
    &Aura::HandleUnused,                                    //302 unused (3.2.2a)
    &Aura::HandleNULL,                                      //303 17 spells
    &Aura::HandleNULL,                                      //304 2 spells (alcohol effect?)
-    &Aura::HandleNULL,                                      //305 2 spells
+    &Aura::HandleAuraModIncreaseSpeed,                      //305 SPELL_AURA_MOD_MINIMUM_SPEED
    &Aura::HandleNULL                                       //306 1 spell
};

@@ -5599,6 +5599,8 @@ void Aura::HandleShapeshiftBoosts(bool apply)
                ((Player*)m_target)->RemoveSpellCooldown(49868);
            break;
        case FORM_GHOSTWOLF:
+            spellId1 = 67116;
+            break;
        case FORM_AMBIENT:
        case FORM_GHOUL:
        case FORM_STEALTH:
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 75e07ff..688c534 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1658,6 +1658,10 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
                if( spellInfo_1->SpellIconID==220 && spellInfo_2->SpellIconID==220 &&
                    spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags )
                    return false;
+
+                // Ghost Wolf
+                if (spellInfo_1->SpellIconID == 67 && spellInfo_2->SpellIconID == 67)
+                    return false;
            }
            // Bloodlust and Bloodthirst (multi-family check)
            if( spellInfo_1->Id == 2825 && spellInfo_2->SpellIconID == 38 && spellInfo_2->SpellVisual[0] == 0 )
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index a282c96..3cea7aa 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10063,7 +10063,12 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
    // Apply strongest slow aura mod to speed
    int32 slow = GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
    if (slow)
+    {
        speed *=(100.0f + slow)/100.0f;
+        float min_speed = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_MINIMUM_SPEED) / 100.0f;
+        if (speed < min_speed)
+            speed = min_speed;
+    }
    SetSpeed(mtype, speed, forced);
}

Link to comment
Share on other sites

  • 39 years later...
Should be HandleNULL.

You should stop suggesting, before actually knowing what you are doing.

EDIT: To explain it a little more, OP has his patch in order, you need to update current speed (that's what the handler does), otherwise applying/unapplying form will have no effect on existing snares.

Also changing to HandleNULL would make server ignore that aura effect completly

Link to comment
Share on other sites

  • 5 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • 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