Misc: replace Unit::GetPlayer with ObjectAccessor::GetPlayer and some cosmetic changes
This commit is contained in:
1 parent
c32dbd1432
commit
2b19ba1879
37 files changed
+263
-300
No files matched your search
@@ -743,15 +743,10 @@ 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() ? caster : target;
|
||||
triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff);
|
||||
}
|
||||
if (!target->HasAura(spellId))
|
||||
target->CastSpell(target, spellId, true, 0, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user