aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index e780b88c6be..eb03b47e6fe 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -842,15 +842,16 @@ class spell_hun_sniper_training : public SpellScriptLoader
PreventDefaultAction();
if (aurEff->GetAmount() <= 0)
{
- Unit* caster = GetCaster();
+ Unit* target = GetTarget();
uint32 spellId = SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_HUNTER_SNIPER_TRAINING_R1;
- if (Unit* target = GetTarget())
- if (!target->HasAura(spellId))
- {
- SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId);
- Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(GetSpellInfo()) ? caster : target;
- triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff);
- }
+
+ target->CastSpell(target, spellId, true, 0, aurEff);
+ if (Player* playerTarget = GetUnitOwner()->ToPlayer())
+ {
+ int32 baseAmount = aurEff->GetBaseAmount();
+ int32 amount = playerTarget->CalculateSpellDamage(playerTarget, GetSpellInfo(), aurEff->GetEffIndex(), &baseAmount);
+ GetEffect(EFFECT_0)->SetAmount(amount);
+ }
}
}