fix(Scripts/Ulduar): Respawn Algalon on wipes (#17344)

This commit is contained in:
Skjalf
2023-09-25 08:07:30 -03:00
committed by GitHub
parent c7b7b7dc07
commit 970c579547
2 changed files with 17 additions and 0 deletions

View File

@@ -366,6 +366,9 @@ public:
return;
}
if (m_pInstance)
m_pInstance->SetData(TYPE_ALGALON, FAIL);
ScriptedAI::EnterEvadeMode(why);
}

View File

@@ -786,6 +786,18 @@ public:
go->SetGoState(data == IN_PROGRESS ? GO_STATE_ACTIVE : GO_STATE_READY);
go->EnableCollision(false);
}
if (data == FAIL)
{
scheduler.Schedule(5s, [this](TaskContext)
{
if (m_algalonTimer && (m_algalonTimer <= 60 || m_algalonTimer == TIMER_ALGALON_TO_SUMMON))
{
instance->SummonCreature(NPC_ALGALON, AlgalonLandPos);
}
});
}
break;
// Achievement
@@ -1109,6 +1121,8 @@ public:
void Update(uint32 diff) override
{
InstanceScript::Update(diff);
if (_events.Empty())
return;