Jump to content

[Patch] Stoneclaw Totem


Auntie Mangos

Recommended Posts

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

Adds cast of absorb shields on totems and on owner with glyph

For which repository revision was the patch created?

8946

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

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

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

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

Me

DB part

UPDATE creature_template SET spell1 = 55328 WHERE entry IN (3579);
UPDATE creature_template SET spell1 = 55329 WHERE entry IN (3911);
UPDATE creature_template SET spell1 = 55330 WHERE entry IN (3912);
UPDATE creature_template SET spell1 = 55332 WHERE entry IN (3913);
UPDATE creature_template SET spell1 = 55333 WHERE entry IN (7398);
UPDATE creature_template SET spell1 = 55335 WHERE entry IN (7399);
UPDATE creature_template SET spell1 = 55278 WHERE entry IN (15478);
UPDATE creature_template SET spell1 = 58589 WHERE entry IN (31120);
UPDATE creature_template SET spell1 = 58590 WHERE entry IN (31121);
UPDATE creature_template SET spell1 = 58591 WHERE entry IN (31122);

Core part

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index c4d4792..c08e9f2 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5247,6 +5247,34 @@ void Spell::EffectScriptEffect(uint32 effIndex)
                    }
                    return;
                }
+				case 55328:									// Stoneclaw Totem I
+				case 55329:									// Stoneclaw Totem II
+				case 55330:									// Stoneclaw Totem III
+				case 55332:									// Stoneclaw Totem IV
+				case 55333:									// Stoneclaw Totem V
+				case 55335:									// Stoneclaw Totem VI
+				case 55278:									// Stoneclaw Totem VII
+				case 58589:									// Stoneclaw Totem VIII
+				case 58590:									// Stoneclaw Totem IX
+				case 58591:									// Stoneclaw Totem X
+				{
+				    if ( !unitTarget )	// Stoneclaw Totem owner
+						return;
+					// Absorb shield for totems
+					for(int itr = 0; itr < MAX_TOTEM; ++itr)
+					{
+						Unit* totem = ObjectAccessor::GetUnit( *unitTarget,  unitTarget->m_TotemSlot[itr] );
+						if( totem )
+							m_caster->CastCustomSpell( totem, 55277, &damage, NULL, NULL, true );
+					}
+					// Glyph of Stoneclaw Totem
+					if( Aura* auraGlyph = unitTarget->GetAura( 63298,0 ) )
+					{
+						int32 playerAbsorb = damage * auraGlyph->GetModifier()->m_amount;
+						m_caster->CastCustomSpell( unitTarget, 55277, &playerAbsorb, NULL, NULL, true );
+					}
+					return;
+				}
                case 55693:                                 // Remove Collapsing Cave Aura
                    if(!unitTarget)
                        return;
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 785ea9e..2983e96 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2276,6 +2276,37 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                if(m_target->GetTypeId() == TYPEID_PLAYER)
                    ((Player*)m_target)->RemoveAmmo();      // not use ammo and not allow use
                return;
+			case 55328:									// Stoneclaw Totem I
+				m_target->CastSpell( m_target, 5728, true );
+				return;
+			case 55329:									// Stoneclaw Totem II
+				m_target->CastSpell( m_target, 6397, true );
+				return;
+			case 55330:									// Stoneclaw Totem III
+				m_target->CastSpell( m_target, 6398, true );
+				return;
+			case 55332:									// Stoneclaw Totem IV
+				m_target->CastSpell( m_target, 6399, true );
+				return;
+			case 55333:									// Stoneclaw Totem V
+				m_target->CastSpell( m_target, 10425, true );
+				return;
+			case 55335:									// Stoneclaw Totem VI
+				m_target->CastSpell( m_target, 10426, true );
+				return;
+			case 55278:									// Stoneclaw Totem VII
+				m_target->CastSpell( m_target, 25513, true );
+				return;
+			case 58589:									// Stoneclaw Totem VIII
+				m_target->CastSpell( m_target, 58583, true );
+				return;
+			case 58590:									// Stoneclaw Totem IX
+				m_target->CastSpell( m_target, 58584, true );
+				return;
+			case 58591:									// Stoneclaw Totem X
+				m_target->CastSpell( m_target, 58585, true );
+				return;
+
        }

        switch(m_spellProto->SpellFamilyName)

Link to comment
Share on other sites

  • 39 years later...
  • 1 month later...

Like this?

diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp
index 4b15b26..d70a6c8 100644
--- a/src/game/Totem.cpp
+++ b/src/game/Totem.cpp
@@ -76,7 +76,9 @@ void Totem::Summon(Unit* owner)
    switch(m_type)
    {
        case TOTEM_PASSIVE:
-            CastSpell(this, GetSpell(), true);
+            // Cast more than one spell
+            for (int i=0; i<MAX_CREATURE_SPELL_DATA_SLOT; ++i)
+                CastSpell(this, m_spells[i], true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 5 months 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