mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
@@ -729,7 +729,21 @@ void PlayerAI::DoRangedAttackIfReady()
|
||||
if (!rangedAttackSpell)
|
||||
return;
|
||||
|
||||
me->CastSpell(victim, rangedAttackSpell, TRIGGERED_CAST_DIRECTLY);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(rangedAttackSpell);
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
Spell* spell = new Spell(me, spellInfo, TRIGGERED_CAST_DIRECTLY);
|
||||
if (spell->CheckPetCast(victim) != SPELL_CAST_OK)
|
||||
{
|
||||
delete spell;
|
||||
return;
|
||||
}
|
||||
|
||||
SpellCastTargets targets;
|
||||
targets.SetUnitTarget(victim);
|
||||
spell->prepare(targets);
|
||||
|
||||
me->resetAttackTimer(RANGED_ATTACK);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user