From 9bede687ce3d291c8af8f4deb3f1dcebba1a315d Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Sun, 24 Nov 2019 21:00:42 +0100 Subject: Core/GameObjects: Skip LoS checks for traps (#23936) * Core/GameObjects: Skip LoS checks for traps * Core/GameObjects: Fix spells cast by traps missing always * Scripts/Spells: Fix WSG heal buff not healing The WSG green heal buff is now cast by a GameObject so the spell target should be used to calculate the healing, not the GameObject. (cherry picked from commit 909941e1b44250b0fa646d363af817f40ca48355) --- src/server/scripts/Spells/spell_generic.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 190f32b044f..f000c3294d1 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2690,19 +2690,19 @@ class spell_gen_restoration : public AuraScript { PreventDefaultAction(); - Unit* caster = GetCaster(); - if (!caster) + Unit* target = GetTarget(); + if (!target) return; - int32 heal = caster->CountPctFromMaxHealth(10); - HealInfo healInfo(caster, GetTarget(), heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask()); - caster->HealBySpell(healInfo); + int32 heal = target->CountPctFromMaxHealth(10); + HealInfo healInfo(target, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask()); + target->HealBySpell(healInfo); /// @todo: should proc other auras? - if (int32 mana = caster->GetMaxPower(POWER_MANA)) + if (int32 mana = target->GetMaxPower(POWER_MANA)) { mana /= 10; - caster->EnergizeBySpell(caster, GetSpellInfo(), mana, POWER_MANA); + target->EnergizeBySpell(target, GetSpellInfo(), mana, POWER_MANA); } } -- cgit v1.2.3