Trinitycore: [3.3.5] Polymorph & Grounding Totem

Created on 19 Feb 2018  路  27Comments  路  Source: TrinityCore/TrinityCore

Description:

Casting polymorph on a shaman redirects it properly to the grounding totem, but the grounding totem turns into an actual sheep and starts walking around instead of just "eating it" and then dissapearing.

Current behaviour:

Grounding Totem turns into a sheep.

Expected behaviour:

Should just eat the polymorph and dissapear.

Steps to reproduce the problem:

  1. Cast grounding totem as shaman.
  2. Cast polymorph on shaman.

Branch(es):

3.3.5

TC rev. hash/commit:

https://github.com/TrinityCore/TrinityCore/commit/1cc3d33cfe7e51d66925d5df536a952165a88094

TDB version:

TDB 335.64

Operating system: Ubuntu

Branch-3.3.5a Comp-Core Feedback-FixOutdatedMissingWIP Priority-Cosmetic Sub-Spells

Most helpful comment

Ok, i did temp solution for you. I think @ariel- will rewrite it, but right now you can use this a little present from rustemu.

video: https://www.youtube.com/watch?v=Fa0R-coPgTQ&feature=youtu.be

p.s. Spells with attr SPELL_ATTR1_UNK18 : Stun / Polymorph / Hex. All this spells should be taken by totem.

 src/server/game/Spells/Spell.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 731fded5b2..9f1b76c1cb 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2579,7 +2579,18 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
             return SPELL_MISS_EVADE;

         if (m_caster->_IsValidAttackTarget(unit, m_spellInfo))
+        {
             unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);
+
+            if (unit->IsTotem() && unit->IsMagnet())
+            {
+                if (m_spellInfo->HasAttribute(SPELL_ATTR1_UNK18) && m_damage <= 0)
+                {
+                    unit->KillSelf();
+                    return SPELL_MISS_IMMUNE;
+                }
+            }
+        }
         else if (m_caster->IsFriendlyTo(unit))
         {
             // for delayed spells ignore negative spells (after duel end) for friendly targets

All 27 comments

cool bug xD

Ya xD looks so odd

Looks like this happens because the totem is a de facto NPC and the grounding totem redirects the spell onto itself, while the check for humanoid target is skipped.

@tkrokli What do you mean about it being a de facto npc? Do you know whats causing it?

@Persephone , look at this :
https://dbwotlk.com/?spell=8177 - spell summoning totem (npc Grounding Totem https://dbwotlk.com/?npc=5925)

spell Grounding Totem: https://woehead.way-of-elendil.fr/?spell=8177
Effect #1 Summon: (Grounding Totem) https://woehead.way-of-elendil.fr/?npc=5925

Grounding Totem is NPC entry 5925 (creature)

Ya its an npc summoned, but what does that have to do with the humanoid check?

Maybe I don't know the spell well enough, but can you polymorph anything into a sheep in-game? (Beast, Dragonkin, Demon, Elemental, Giant, Undead, Humanoid, Critter, Mechanical, Totem, Non-Combat Pet, Gas Cloud, Wild Pet)

beast 100% available, mechanical no.

I presume this will be dealt with when we are tired of laughing at the Grounding Sheep 馃悜 - I mean Totem :-P

Haha I am tired of seeing it xD wish i knew how to fix it

Perhaps you could check SpellWork for how the related spells are handled:
https://woehead.way-of-elendil.fr/?spell=8178 (Grounding Totem Effect)
Apply Area Aura Party: Spell Magnet
https://woehead.way-of-elendil.fr/?spell=8179 (Grounding Totem Passive)
Apply Aura: Periodic Trigger Spell

Also check if the Polymorph Visual used by the totem is the same as
https://woehead.way-of-elendil.fr/?spell=32826 (Polymorph Cast Visual)

don't touch grounding totem!

OK, so you believe this is caused by something very distant from the totem itself?
Feel free to elaborate, if you have got any ideas.

Ok, i did temp solution for you. I think @ariel- will rewrite it, but right now you can use this a little present from rustemu.

video: https://www.youtube.com/watch?v=Fa0R-coPgTQ&feature=youtu.be

p.s. Spells with attr SPELL_ATTR1_UNK18 : Stun / Polymorph / Hex. All this spells should be taken by totem.

 src/server/game/Spells/Spell.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 731fded5b2..9f1b76c1cb 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2579,7 +2579,18 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
             return SPELL_MISS_EVADE;

         if (m_caster->_IsValidAttackTarget(unit, m_spellInfo))
+        {
             unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);
+
+            if (unit->IsTotem() && unit->IsMagnet())
+            {
+                if (m_spellInfo->HasAttribute(SPELL_ATTR1_UNK18) && m_damage <= 0)
+                {
+                    unit->KillSelf();
+                    return SPELL_MISS_IMMUNE;
+                }
+            }
+        }
         else if (m_caster->IsFriendlyTo(unit))
         {
             // for delayed spells ignore negative spells (after duel end) for friendly targets

yeah that works @kvipka :) hope ariel can use it to fix it properly, but thanks for sharing!! <3 <3

Current magnet implementation is a hack

Does anyone have a prediction to fix this problem?

That is odd. I thought this was solved already, but I must have confused this issue with a different totem issue.

I used the temporary change of @kvipka , actually he did right with Polymorph, but with Fear no. The totem receives the fear, but remains active.

Heh, the only funny bug now would be if the Fear spell made the totem run around... 馃弮 馃槣

That happens. He runs on Fear and does not disappear. You can cast Fear and the totem running. haha More only with the @kvipka !

heh, okay guys, will implement attr and for fear too, when will home. But this issue was about only confuse )

use this code :

            if (unit->IsTotem() && unit->IsMagnet())
            {
                bool AttributeForMagnet = m_spellInfo->HasAttribute(SPELL_ATTR1_UNK18) || m_spellInfo->HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT);
                if (AttributeForMagnet || m_damage > 0)
                {
                    unit->KillSelf();
                    return SPELL_MISS_IMMUNE;                    
                }                    
            }

Perfect! It's working as expected.

Nice hackfix.
But SPELL_AURA_MAGNET should work through proc system.
If magnet aura proc -> remove aura and then -> kill totem.

Still valid in aba07047a05f

Was this page helpful?
0 / 5 - 0 ratings

Related issues

click picture click  路  51Comments

minkokomaung picture minkokomaung  路  69Comments

D-CellX picture D-CellX  路  108Comments

Keader picture Keader  路  119Comments

jackpoz picture jackpoz  路  56Comments