Jump to content

[patch]Stoneclaw Totem & Glyph


Guest laise

Recommended Posts

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

- fixes Stoneclaw Totem absorb effect and Glyph of Stoneclaw Totem

For which repository revision was the patch created?

- 8827

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

- haven't seen any

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

- me

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 4d819fd..d225e22 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1768,6 +1768,12 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
            break;
        case TARGET_DUELVSPLAYER:
        {
+            if (m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellIconID == 276) // Stoneclaw Totem absorb has wrong target
+            {
+                TagUnitMap.push_back(m_caster);
+                break;
+            }
+
            Unit *target = m_targets.getUnitTarget();
            if(target)
            {
@@ -2481,6 +2487,21 @@ void Spell::cast(bool skipCheck)
                AddPrecastSpell(23230);                     // Blood Fury - Healing Reduction
            else if(m_spellInfo->Id == 20594)               // Stoneskin
                AddTriggeredSpell(65116);                   // Stoneskin - armor 10% for 8 sec
+
+            switch(m_spellInfo->Id)                         
+            {
+                case 5728: AddTriggeredSpell(55328); break;// Stoneclaw Totem, rank 1
+                case 6397: AddTriggeredSpell(55329); break;// Stoneclaw Totem, rank 2
+                case 6398: AddTriggeredSpell(55330); break;// Stoneclaw Totem, rank 3
+                case 6399: AddTriggeredSpell(55332); break;// Stoneclaw Totem, rank 4
+                case 10425: AddTriggeredSpell(55333); break;// Stoneclaw Totem, rank 5
+                case 10426: AddTriggeredSpell(55335); break;// Stoneclaw Totem, rank 6
+                case 25513: AddTriggeredSpell(55278); break;// Stoneclaw Totem, rank 7
+                case 58583: AddTriggeredSpell(58589); break;// Stoneclaw Totem, rank 8
+                case 58584: AddTriggeredSpell(58590); break;// Stoneclaw Totem, rank 9
+                case 58585: AddTriggeredSpell(58591); break;// Stoneclaw Totem, rank 10
+                default:break;
+            }
            break;
        }
        case SPELLFAMILY_MAGE:
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index c2102ec..c63fe3c 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5079,6 +5079,39 @@ void Spell::EffectScriptEffect(uint32 effIndex)
                    unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_STUN);
                    return;
                }
+                // Stoneclaw Totem absorb 
+                case 55278:
+                case 55328:
+                case 55329:
+                case 55330:
+                case 55332:
+                case 55333:
+                case 55335:
+                case 58589:
+                case 58590:
+                case 58591:
+                {
+                    if(!unitTarget)
+                        return;
+
+                    for(int slot = 0;  slot < MAX_TOTEM; ++slot)
+                    {
+                        if(!unitTarget->m_TotemSlot[slot])
+                            continue;
+
+                        Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_TotemSlot[slot]);
+                        if(totem && totem->isTotem())
+                            totem->CastCustomSpell(totem, 55277, &damage, NULL, NULL, true);
+                    }
+                    
+                    // Glyph of Stoneclaw Totem
+                    if (Aura *aur = unitTarget->GetAura(63298, 0))
+                    {
+                        int32 totalAbsorb = aur->GetModifier()->m_amount * damage;
+                        if (totalAbsorb)
+                            unitTarget->CastCustomSpell(unitTarget, 55277, &totalAbsorb, NULL, NULL, true);
+                    }
+                    return;
+                }
                // Escape artist
                case 20589:
                {

I think "absorb on them" means each one absorbs amount listed on spell but idk for sure..

and shield spell has wrong target type in dbc (blz made hotfix for it, but apparently not in dbc)

Link to comment
Share on other sites

As that target can be both friendly or unfriendly unit, I'd be quite a good question to ask why you do that hack...

as i understand if i leave it as it is shield would be cast on targets of totems/player which is not correct because shield should be cast on self only - like totem->CastSpell(shield_spell_id, totem....);

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