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->SetSpeed(MOVE_RUN, 1.0f);
|
||||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||||
DoZoneInCombat();
|
DoZoneInCombat();
|
||||||
|
// Start attacking random target
|
||||||
|
ChangeToNewPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellHit(Unit* caster, SpellInfo const* spell) override
|
void SpellHit(Unit* caster, SpellInfo const* spell) override
|
||||||
@@ -389,13 +391,22 @@ struct npc_zuljin_vortex : public ScriptedAI
|
|||||||
DoCast(caster, SPELL_ZAP_DAMAGE, true);
|
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
|
void UpdateAI(uint32 /*diff*/) override
|
||||||
{
|
{
|
||||||
UpdateVictim();
|
UpdateVictim();
|
||||||
|
|
||||||
//if the vortex reach the target, it change his target to another player
|
//if the vortex reach the target, it change his target to another player
|
||||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||||
AttackStart(SelectTarget(SelectTargetMethod::Random, 0));
|
ChangeToNewPlayer();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user