Jump to content

[BUG + FIX] Glyph of Thorns


Recommended Posts

Posted

I'm not a c++ pro and just learning Mangos architecture, so I ask you to point out mistakes if you find any. Aura constructor probably is not the best place for this, but here is the code:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index d196874..e9123ad 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -432,6 +432,32 @@ m_isRemovedOnShapeLost(true), m_in_use(0), m_deleted(false)
        }
    }

+    // Handling spell duration modifiers (glyphs for example)
+    switch(m_spellProto->SpellFamilyName)
+    {
+        case SPELLFAMILY_DRUID :
+            // Glyph of thorns
+            switch (m_spellProto->Id)
+            {
+                case 467 :
+                case 782 :
+                case 1075 :
+                case 8914 :
+                case 9756 :
+                case 9910 :
+                case 26992 :
+                case 53307 :
+                    if ((m_caster_guid == m_target->GetGUID()) && (m_target->HasAura(57862)))
+                        m_maxduration += 50*MINUTE*IN_MILISECONDS;
+                    break;
+                default :
+                    break;
+            }
+            break;
+        default :
+            break;
+    }
+
    if(m_maxduration == -1 || m_isPassive && m_spellProto->DurationIndex == 0)
        m_permanent = true;

UPDATE: Indentation was corrected.

  • 3 months later...
Posted

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index d196874..e9123ad 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -432,6 +432,32 @@ m_isRemovedOnShapeLost(true), m_in_use(0), m_deleted(false)
        }
    }

+    // Handling spell duration modifiers (glyphs for example)
+    switch(m_spellProto->SpellFamilyName)
+    {
+        case SPELLFAMILY_DRUID :
+            // Glyph of thorns
+            switch (m_spellProto->Id)
+            {
+                case 467 :
+                case 782 :
+                case 1075 :
+                case 8914 :
+                case 9756 :
+                case 9910 :
+                case 26992 :
+                case 53307 :
+                    if ((m_caster_guid == m_target->GetGUID()) && (m_target->HasAura(57862)))
+                        m_maxduration += 50*MINUTE*IN_MILLISECONDS;
+                    break;
+                default :
+                    break;
+            }
+            break;
+        default :
+            break;
+    }
+
    if(m_maxduration == -1 || m_isPassive && m_spellProto->DurationIndex == 0)
        m_permanent = true;

Works good with Revision 9891, but the place is strange.

Kyle you made a mistake in your Code

m_maxduration += 50*MINUTE*IN_MILLISECONDS; is better

My first post :)

×
×
  • 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