mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
fix(Scripts/ZulAman): make Zul'Jin p3 cyclones go to random targets (#21087)
This commit is contained in:
@@ -381,6 +381,8 @@ struct npc_zuljin_vortex : public ScriptedAI
|
||||
me->SetSpeed(MOVE_RUN, 1.0f);
|
||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
DoZoneInCombat();
|
||||
// Start attacking random target
|
||||
ChangeToNewPlayer();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell) override
|
||||
@@ -389,13 +391,22 @@ struct npc_zuljin_vortex : public ScriptedAI
|
||||
DoCast(caster, SPELL_ZAP_DAMAGE, true);
|
||||
}
|
||||
|
||||
void ChangeToNewPlayer()
|
||||
{
|
||||
DoResetThreatList();
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
||||
{
|
||||
me->AddThreat(target, 10000000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) override
|
||||
{
|
||||
UpdateVictim();
|
||||
|
||||
//if the vortex reach the target, it change his target to another player
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
AttackStart(SelectTarget(SelectTargetMethod::Random, 0));
|
||||
ChangeToNewPlayer();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user