Jump to content

[patch] King of the Jungle


Guest Neveragain

Recommended Posts

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

Implement King of the Jungle talent

For which repository revision was the patch created?

8276

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

I didn't find any

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

me.

SQL pach

delete from spell_proc_event where entry in (48492, 48494, 48495);
insert into spell_proc_event () VALUES 
(48492, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0),
(48494, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0),
(48495, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0);

I think by Enrage should we check Id because it has only one rank

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 21e0270..cfdbc02 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5746,7 +5746,11 @@ void Aura::CleanupTriggeredSpells()
        m_target->RemoveAurasDueToSpell(30070);
        return;
    }
-
+    if(m_spellProto->Id == 5229)
+    {
+        // King of the Jungle
+        m_target->RemoveAurasDueToSpell(51185);
+    }
    uint32 tSpellId = m_spellProto->EffectTriggerSpell[GetEffIndex()];
    if(!tSpellId)
        return;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 83e1a43..81e2794 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5372,6 +5372,30 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                basepoints0 = triggerAmount * damage / 100;
                break;
            }
+            // King of the Jungle
+            else if (dummySpell->SpellIconID == 2850)
+            {
+                if (!procSpell)
+                    return false;
+
+                // Tiger's Fury
+                if (procSpell->SpellFamilyFlags2 & 0x800 && effIndex == 1)
+                {
+                    basepoints0 = triggerAmount;
+                    triggered_spell_id = 51178;
+                    target = this;
+                    break;
+                }                
+                // Enrage                                    
+                if (procSpell->Id == 5229 && effIndex == 0)
+                {
+                    basepoints0 = triggerAmount;
+                    triggered_spell_id = 51185;
+                    target = this;
+                    break;
+                }
+                return false;
+            }
            break;
        }
        case SPELLFAMILY_ROGUE:

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Roudhouse kick with a fix

I made some cleaning, but the original code was working fine. Here's an updated version, currently working.

Repository : 8734

sql part :

delete from spell_proc_event where entry in (48492, 48494, 48495);
insert into spell_proc_event () VALUES 
(48492, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0),
(48494, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0),
(48495, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0);

code patch :

diff --git "a/8734\\\\mangos\\\\src\\\\game\\\\unit.cpp" "b/8734_mod\\\\mangos\\\\src\\\\game\\\\unit.cpp"
index a282c96..6ef5f4e 100644
--- "a/8734\\\\mangos\\\\src\\\\game\\\\unit.cpp"
+++ "b/8734_mod\\\\mangos\\\\src\\\\game\\\\unit.cpp"
@@ -5571,6 +5571,34 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                    triggered_spell_id = 32747;
                    break;
                }
+                // King of the Jungle (Bear and Cat)
+                case 48492: // Rank  1
+                case 48494: // Rank  2
+                case 48495: // Rank  3
+                {
+                    if (!procSpell)
+                        return false;
+
+                    // Enrage (bear) - single rank - the aura for the bear form from the 2 existing kotj auras has a miscValue == 126
+                    if (procSpell->Id == 5229 && triggeredByAura->GetMiscValue() == 126)
+                    {
+                        // note : given the infinite duration and the enrage spell already having 3 modifiers, the remove is done in spellAuras/_RemoveAura
+                        basepoints0 = triggerAmount;
+                        triggered_spell_id = 51185;
+                        target = this;
+                        break;
+                    }
+
+                    // Tiger Fury (cat) - all ranks - the aura for the cat form from the 2 existing kotj auras has a miscValue != 126
+                    if (procSpell->SpellFamilyFlags2 & 0x00000800  && triggeredByAura->GetMiscValue() != 126)
+                    {
+                        basepoints0 = triggerAmount;
+                        triggered_spell_id = 51178;
+                        target = this;
+                        break;
+                    }
+                    break;
+                }
            }
            // Eclipse
            if (dummySpell->SpellIconID == 2856)
diff --git "a/8734\\\\mangos\\\\src\\\\game\\\\SpellAuras.cpp" "b/8734_mod\\\\mangos\\\\src\\\\game\\\\SpellAuras.cpp"
index 582946a..7509e80 100644
--- "a/8734\\\\mangos\\\\src\\\\game\\\\SpellAuras.cpp"
+++ "b/8734_mod\\\\mangos\\\\src\\\\game\\\\SpellAuras.cpp"
@@ -1089,6 +1089,10 @@ bool Aura::_RemoveAura()
    // except same aura replace case
    if(m_removeMode!=AURA_REMOVE_BY_STACK)
        CleanupTriggeredSpells();
+        
+    // King of the Jungle talent - triggered but not attached to enrage bear spell (5229). Need a 4th trigger slot to be cleared properly.
+    if (m_spellProto->Id == 5229 )
+        m_target->RemoveAurasDueToSpell(51185);

    Unit* caster = GetCaster();

I'm not really happy with the explicit RemoveAurasDueToSpell(51185), but I didn't find a working and clean way to attach the damage buff to the enrage aura

Link to comment
Share on other sites

  • 4 weeks later...

I'm still wondering about where the enrage +dmg% bonus remove should be placed.

It's an aura with infinite duration, and clears out when enrage does (as of shapeshifting or when enrage expires).

Problem is, the current limit for attached boost is 3 and bear's enrage is already full, so it can't be handled automatically, it must explicitly declared :/

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Updated for 9203

sql part :

delete from spell_proc_event where entry in (48492, 48494, 48495);
insert into spell_proc_event () VALUES 
(48492, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0),
(48494, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0),
(48495, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0);

diff --git "a/src\\\\game\\\\SpellAuras.cpp" "b/src\\\\game\\\\SpellAuras.cpp"
index 30f2d93..6fd3437 100644
--- "a/src\\\\game\\\\SpellAuras.cpp"
+++ "b/src\\\\game\\\\SpellAuras.cpp"
@@ -4575,7 +4575,18 @@ void Aura::HandlePeriodicEnergize(bool apply, bool Real)
                break;
        }
    }
-
+    if (!apply && !loading)
+    {
+        switch (GetId())
+        {
+            case 5229:                                      // Druid Bear Enrage
+                if (m_target->HasAura(51185))               // King of the Jungle self Enrage bonus with infinite duration
+                    m_target->RemoveAurasDueToSpell(51185);
+                break;
+            default:
+                break;
+        }
+    }
    m_isPeriodic = apply;
}

diff --git "a/src\\\\game\\\\Unit.cpp" "b/src\\\\game\\\\Unit.cpp"
index b79f4bb..8079ce2 100644
--- "a/src\\\\game\\\\Unit.cpp"
+++ "b/src\\\\game\\\\Unit.cpp"
@@ -5840,7 +5840,33 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                    triggered_spell_id = 54755;
                    break;
                }
-            }
+                // King of the Jungle (Bear and Cat)
+                case 48492: // Rank  1
+                case 48494: // Rank  2
+                case 48495: // Rank  3
+                {
+                    if (!procSpell)
+                        return false;
+                    // Enrage (bear) - single rank - the aura for the bear form from the 2 existing kotj auras has a miscValue == 126
+                    if (procSpell->Id == 5229 && triggeredByAura->GetMiscValue() == 126)
+                    {
+                        // note : the remove part is done in spellAuras/HandlePeriodicEnergize as RemoveAurasDueToSpell
+                        basepoints0 = triggerAmount;
+                        triggered_spell_id = 51185;
+                        target = this;
+                        break;
+                    }
+                    // Tiger Fury (cat) - all ranks - the aura for the cat form from the 2 existing kotj auras has a miscValue != 126
+                    if (procSpell->SpellFamilyFlags2 & 0x00000800  && triggeredByAura->GetMiscValue() != 126)
+                    {
+                        basepoints0 = triggerAmount;
+                        triggered_spell_id = 51178;
+                        target = this;
+                        break;
+                    }
+                    break;
+                }
+            }            
            // Eclipse
            if (dummySpell->SpellIconID == 2856)
            {

Followed your advice, Sarjuuk. It's working perfectly, just needed to implement the !apply part ^_^

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 4 weeks later...
  • 2 months later...

Updated for 9995

sql part :

delete from spell_proc_event where entry in (48492, 48494, 48495);
insert into spell_proc_event () VALUES 
(48492, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0),
(48494, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0),
(48495, 0, 7, 524288, 0, 2048, 16384, 0, 0, 0, 0);

mangos part :

diff --git "a/9995\\\\mangos\\\\src\\\\game\\\\SpellAuras.cpp" "b/9995_mod\\\\mangos\\\\src\\\\game\\\\SpellAuras.cpp"
index be54aa6..b2cd114 100644
--- "a/9995\\\\mangos\\\\src\\\\game\\\\SpellAuras.cpp"
+++ "b/9995_mod\\\\mangos\\\\src\\\\game\\\\SpellAuras.cpp"
@@ -4759,6 +4759,19 @@ void Aura::HandlePeriodicEnergize(bool apply, bool Real)
        }
    }

+    if (!apply && !loading)
+    {
+        switch (GetId())
+        {
+            case 5229:                                      // Druid Bear Enrage
+                if (m_target->HasAura(51185))               // King of the Jungle - infinite duration
+                    m_target->RemoveAurasDueToSpell(51185);
+                break;
+            default:
+                break;
+        }
+    }
+
    m_isPeriodic = apply;
}

diff --git "a/9995\\\\mangos\\\\src\\\\game\\\\Unit.cpp" "b/9995_mod\\\\mangos\\\\src\\\\game\\\\Unit.cpp"
index ddf3e35..9f0a2a0 100644
--- "a/9995\\\\mangos\\\\src\\\\game\\\\Unit.cpp"
+++ "b/9995_mod\\\\mangos\\\\src\\\\game\\\\Unit.cpp"
@@ -6099,6 +6099,32 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                    triggered_spell_id = 32747;
                    break;
                }
+                // King of the Jungle (Bear and Cat)
+                case 48492: // Rank  1
+                case 48494: // Rank  2
+                case 48495: // Rank  3
+                {
+                    if (!procSpell)
+                        return false;
+                    // Enrage (bear) - single rank - bear miscvalue == 126
+                    if (procSpell->Id == 5229 && triggeredByAura->GetMiscValue() == 126)
+                    {
+                        // note : the remove part is done in spellAuras/HandlePeriodicEnergize as RemoveAurasDueToSpell
+                        basepoints[0] = triggerAmount;
+                        triggered_spell_id = 51185;
+                        target = this;
+                        break;
+                    }
+                    // Tiger Fury (cat) - all ranks - cat miscvalue != 126
+                    if (procSpell->SpellFamilyFlags2 & 0x00000800  && triggeredByAura->GetMiscValue() != 126)
+                    {
+                        basepoints[0] = triggerAmount;
+                        triggered_spell_id = 51178;
+                        target = this;
+                        break;
+                    }
+                    break;
+                }
                // Glyph of Rejuvenation
                case 54754:
                {

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

UPDATE to REVISION: 10434

SQL Part:

delete from spell_proc_event where entry in (48492, 48494, 48495);
insert into spell_proc_event () VALUES 
(48492, 0, 7, 524288,524288,524288, 0, 0, 0, 2048, 2048, 2048, 16384, 0, 0, 0, 0),
(48494, 0, 7, 524288,524288,524288, 0, 0, 0, 2048, 2048, 2048, 16384, 0, 0, 0, 0),
(48495, 0, 7, 524288,524288,524288, 0, 0, 0, 2048, 2048, 2048, 16384, 0, 0, 0, 0);

Mangos Part:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 59d5192..6a2cdcb 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -4580,6 +4635,18 @@ void Aura::HandlePeriodicEnergize(bool apply, bool Real)
                break;
        }
    }
+    if (!apply && !loading)
+    {
+        switch (GetId())
+        {
+            case 5229:                                      // Druid Bear Enrage
+                if (target->HasAura(51185))               // King of the Jungle self Enrage bonus with infinity duration
+                     target->RemoveAurasDueToSpell(51185);
+                break;
+            default:
+                break;
+        }
+    }

    m_isPeriodic = apply;
}
diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp
index 68cdadd..3d26861 100644
--- a/src/game/UnitAuraProcHandler.cpp
+++ b/src/game/UnitAuraProcHandler.cpp
@@ -1570,6 +1591,28 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
                    return SPELL_AURA_PROC_OK;
                }
            }
+            // King of the Jungle
+            if (dummySpell->SpellIconID == 2850)
+            {
+                // Enrage (bear)
+                if (procSpell->Id == 5229 && triggeredByAura->GetEffIndex() == EFFECT_INDEX_0)
+                {
+                    // note : the remove part is done in spellAuras/HandlePeriodicEnergize as RemoveAurasDueToSpell
+                    basepoints[0] = triggerAmount;
+                    triggered_spell_id = 51185;
+                    target = this;
+                    break;
+                }
+                // Tiger Fury (cat)
+                if (procSpell->SpellFamilyFlags2 & 0x00000800 && triggeredByAura->GetEffIndex() == EFFECT_INDEX_1)
+                {
+                    basepoints[0] = triggerAmount;
+                    triggered_spell_id = 51178;
+                    target = this;
+                    break;
+                }
+                return SPELL_AURA_PROC_FAILED;
+            }
            // Eclipse
            if (dummySpell->SpellIconID == 2856)
            {

Link to comment
Share on other sites

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