TrinityCore/TrinityCore — Issue #3814: Shaman Totems
Author: drskull
Created: 2011-11-03 18:01:24+00:00
State: open

According to http://www.wowwiki.com/Shaman_Totems

Since patch 3.0, and most shaman totems affecting the entire raid, sorting out which Shaman drops which totems in the raid can be a small task. The following applies regardless:
Totems do not stack. Two [Totems of Wrath] does not mean more Spellpower. - ok
Totems that have been enhanced by talents will overwrite Totems that aren't. - bug

Another bug is when somebody cast totem with rank 1 before somebody cast rank 2
Unit will get rank 1

I want to say that better totem (effect) should overwrite totem that units had before
probably fix
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index df6ac44..14ce0c0 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -545,6 +545,17 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
Aura const* aura = iter->second->GetBase();
if (!CanStackWith(aura))
{
+ if (aura->GetOwner()->ToUnit()->isTotem() && GetOwner()->ToUnit()->isTotem())
+ {
+ AuraEffect * auraeff1 = GetEffect(0);
+ AuraEffect * auraeff2 = aura->GetEffect(0);
+ if (auraeff1->CalculateAmount(auraeff1->GetCaster()) > (auraeff2->CalculateAmount(auraeff2->GetCaster())))
+ {
+ addUnit = true;
+ itr->first->RemoveAura(iter->second);
+ break;
+ }
+ }
addUnit = false;
break;
}