fix(Scripts/ZulAman): make Zul'Jin p3 cyclones go to random targets (#21087)

This commit is contained in:
Dan
2025-01-03 23:01:54 +01:00
committed by GitHub
parent fd4019c074
commit 3193a5ba5a

View File

@@ -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();
}
};