mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
fix(Scripts/ZulGurub): Gri'lek should pursuit random targets. (#12194)
Fixes #12088
This commit is contained in:
@@ -38,7 +38,8 @@ enum Events
|
||||
EVENT_AVATAR = 1,
|
||||
EVENT_GROUND_TREMOR = 2,
|
||||
EVENT_START_PURSUIT = 3,
|
||||
EVENT_ENTANGLING_ROOTS = 4
|
||||
EVENT_STOP_PURSUIT = 4,
|
||||
EVENT_ENTANGLING_ROOTS = 5
|
||||
};
|
||||
|
||||
class boss_grilek : public CreatureScript // grilek
|
||||
@@ -52,6 +53,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_pursuitTargetGUID.Clear();
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
_EnterCombat();
|
||||
@@ -75,10 +82,15 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_AVATAR:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
{
|
||||
_pursuitTargetGUID = target->GetGUID();
|
||||
}
|
||||
DoCast(me, SPELL_AVATAR);
|
||||
DoResetThreat();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
DoResetThreat();
|
||||
events.ScheduleEvent(EVENT_START_PURSUIT, 2s);
|
||||
events.ScheduleEvent(EVENT_STOP_PURSUIT, 15s);
|
||||
events.ScheduleEvent(EVENT_AVATAR, 45s, 50s);
|
||||
break;
|
||||
case EVENT_GROUND_TREMOR:
|
||||
@@ -87,6 +99,17 @@ public:
|
||||
break;
|
||||
case EVENT_START_PURSUIT:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (Unit* pursuitTarget = ObjectAccessor::GetUnit(*me, _pursuitTargetGUID))
|
||||
{
|
||||
me->GetThreatMgr().addThreat(pursuitTarget, 1000000.f);
|
||||
}
|
||||
break;
|
||||
case EVENT_STOP_PURSUIT:
|
||||
if (Unit* pursuitTarget = ObjectAccessor::GetUnit(*me, _pursuitTargetGUID))
|
||||
{
|
||||
_pursuitTargetGUID.Clear();
|
||||
me->GetThreatMgr().addThreat(pursuitTarget, -1000000.f);
|
||||
}
|
||||
break;
|
||||
case EVENT_ENTANGLING_ROOTS:
|
||||
DoCastVictim(SPELL_ENTANGLING_ROOTS);
|
||||
@@ -99,6 +122,9 @@ public:
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
ObjectGuid _pursuitTargetGUID;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
|
||||
Reference in New Issue
Block a user