aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 1b3d63a7ac2..091e06e82fb 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -990,19 +990,22 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader
if (Unit* target = GetHitUnit())
{
Unit* caster = GetCaster();
- if (caster->GetTypeId() == TYPEID_UNIT && caster->IsTotem())
- if (Unit* owner = caster->GetOwner())
- caster = owner;
+ ObjectGuid originalCasterGuid = caster->GetGUID();
- // Restorative Totems
- if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_RESTORATIVE_TOTEMS, EFFECT_1))
- AddPct(damage, aurEff->GetAmount());
+ if (Player* player = caster->GetAffectingPlayer())
+ {
+ originalCasterGuid = player->GetGUID();
- // Glyph of Healing Stream Totem
- if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0))
- AddPct(damage, aurEff->GetAmount());
+ // Restorative Totems
+ if (AuraEffect const* aurEff = player->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_RESTORATIVE_TOTEMS, EFFECT_1))
+ AddPct(damage, aurEff->GetAmount());
- CastSpellExtraArgs args(GetOriginalCaster()->GetGUID());
+ // Glyph of Healing Stream Totem
+ if (AuraEffect const* aurEff = player->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0))
+ AddPct(damage, aurEff->GetAmount());
+ }
+
+ CastSpellExtraArgs args(originalCasterGuid);
args.AddSpellBP0(damage);
caster->CastSpell(target, SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, args);
}