fix(Scripts/ShadowfangKeep): Fix Apothecary Trio events not reseting … (#14898)
This commit is contained in:
parent
6e8e70aa1a
commit
f3f2364bef
1 changed files with 4 additions and 12 deletions
|
|
@ -87,7 +87,7 @@ public:
|
|||
{
|
||||
boss_apothecary_hummelAI(Creature* creature) : BossAI(creature, DATA_APOTHECARY_HUMMEL), _deadCount(0), _isDead(false)
|
||||
{
|
||||
_scheduler.SetValidator([this]
|
||||
scheduler.SetValidator([this]
|
||||
{
|
||||
return !me->HasUnitState(UNIT_STATE_CASTING);
|
||||
});
|
||||
|
|
@ -109,23 +109,17 @@ public:
|
|||
_deadCount = 0;
|
||||
_isDead = false;
|
||||
_phase = PHASE_ALL;
|
||||
summons.DespawnAll();
|
||||
me->SetFaction(FACTION_FRIENDLY);
|
||||
me->SummonCreatureGroup(1);
|
||||
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_START_EVENT && _phase == PHASE_ALL)
|
||||
{
|
||||
_phase = PHASE_INTRO;
|
||||
_scheduler.Schedule(1ms, [this](TaskContext /*context*/)
|
||||
scheduler.Schedule(1ms, [this](TaskContext /*context*/)
|
||||
{
|
||||
Talk(SAY_INTRO_0);
|
||||
})
|
||||
|
|
@ -230,9 +224,8 @@ public:
|
|||
Talk(SAY_HUMMEL_DEATH);
|
||||
}
|
||||
|
||||
_scheduler.CancelAll();
|
||||
_JustDied();
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
instance->SetBossState(DATA_APOTHECARY_HUMMEL, DONE);
|
||||
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
if (!players.IsEmpty())
|
||||
|
|
@ -254,7 +247,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
_scheduler.Update(diff, [this]
|
||||
scheduler.Update(diff, [this]
|
||||
{
|
||||
DoMeleeAttackIfReady();
|
||||
});
|
||||
|
|
@ -263,7 +256,6 @@ public:
|
|||
private:
|
||||
uint8 _deadCount;
|
||||
bool _isDead;
|
||||
TaskScheduler _scheduler;
|
||||
uint8 _phase;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue