fix(Scripts/RuinsOfAhnQiraj): Andorov does not respawn after being killed (#17788)

This commit is contained in:
KJack
2023-11-20 19:18:13 -05:00
committed by GitHub
parent 59e9451c3c
commit 42ec86680c
2 changed files with 17 additions and 4 deletions
@@ -82,10 +82,14 @@ struct boss_kurinnaxx : public BossAI
if (killer) if (killer)
{ {
killer->GetMap()->LoadGrid(-9502.80f, 2042.65f); // Ossirian grid killer->GetMap()->LoadGrid(-9502.80f, 2042.65f); // Ossirian grid
killer->GetMap()->LoadGrid(-8538.17f, 1486.09f); // Andorov run path grid
if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
{ {
player->SummonCreature(NPC_ANDOROV, -8538.177f, 1486.0956f, 32.39054f, 3.7638654f, TEMPSUMMON_CORPSE_DESPAWN, 600000000); if (Creature* creature = player->SummonCreature(NPC_ANDOROV, -8538.177f, 1486.0956f, 32.39054f, 3.7638654f, TEMPSUMMON_CORPSE_DESPAWN, 0))
{
creature->setActive(true);
}
} }
} }
@@ -82,11 +82,15 @@ public:
void OnPlayerEnter(Player* player) override void OnPlayerEnter(Player* player) override
{ {
if (GetBossState(DATA_KURINNAXX) == DONE && GetBossState(DATA_RAJAXX) != DONE) if (GetBossState(DATA_KURINNAXX) == DONE &&
GetBossState(DATA_RAJAXX) != DONE &&
_rajaxWaveCounter == 0 && // if non-zero, encounter is in progress
!_andorovGUID) // cleared if he is dead
{ {
if (!_andorovGUID) instance->LoadGrid(-8538.17f, 1486.09f); // Andorov run path grid
if (Creature* creature = player->SummonCreature(NPC_ANDOROV, -8538.177f, 1486.0956f, 32.39054f, 3.7638654f, TEMPSUMMON_CORPSE_DESPAWN, 0))
{ {
player->SummonCreature(NPC_ANDOROV, -8538.177f, 1486.0956f, 32.39054f, 3.7638654f, TEMPSUMMON_CORPSE_DESPAWN, 600000000); creature->setActive(true);
} }
} }
} }
@@ -209,6 +213,11 @@ public:
} }
} }
} }
if (creature->GetEntry() == NPC_ANDOROV)
{
_andorovGUID.Clear();
}
} }
} }