fix(DB/TempleOfAhnQiraj): Added missing spawns of Cthun Graps. (#12806)

* fix(DB/Temple of AhnQiraj): Added missing spawns of Cthun Graps.

Fixes #12800

* Update.

* Update.
This commit is contained in:
UltraNix
2022-08-27 19:29:19 +02:00
committed by GitHub
parent 8b9b7e633c
commit 674382ca6a
4 changed files with 62 additions and 17 deletions

View File

@@ -28,22 +28,6 @@ EndScriptData */
#include "TaskScheduler.h"
#include "temple_of_ahnqiraj.h"
enum Phases
{
PHASE_NOT_STARTED = 0,
// Main Phase 1 - EYE
PHASE_EYE_GREEN_BEAM = 1,
PHASE_EYE_RED_BEAM = 2,
// Main Phase 2 - CTHUN
PHASE_CTHUN_TRANSITION = 3,
PHASE_CTHUN_STOMACH = 4,
PHASE_CTHUN_WEAK = 5,
PHASE_CTHUN_DONE = 6,
};
enum Spells
{
// ***** Main Phase 1 ********

View File

@@ -56,6 +56,8 @@ public:
ObjectGuid VeklorGUID;
ObjectGuid VeknilashGUID;
ObjectGuid ViscidusGUID;
ObjectGuid CThunGUID;
GuidVector CThunGraspGUIDs;
std::array<ObjectGuid, 3> doorGUIDs;
uint32 BugTrioDeathCount;
@@ -107,6 +109,21 @@ public:
if (GetBossState(DATA_OURO) != DONE)
creature->Respawn();
break;
case NPC_CTHUN:
CThunGUID = creature->GetGUID();
if (!creature->IsAlive())
{
for (ObjectGuid const& guid : CThunGraspGUIDs)
{
if (GameObject* cthunGrasp = instance->GetGameObject(guid))
{
cthunGrasp->DespawnOrUnsummon(1s);
}
}
}
break;
default:
break;
}
InstanceScript::OnCreatureCreate(creature);
@@ -139,6 +156,16 @@ public:
}
}
break;
case GO_CTHUN_GRASP:
CThunGraspGUIDs.push_back(go->GetGUID());
if (Creature* CThun = instance->GetCreature(CThunGUID))
{
if (!CThun->IsAlive())
{
go->DespawnOrUnsummon(1s);
}
}
break;
default:
break;
}
@@ -215,6 +242,16 @@ public:
break;
case DATA_CTHUN_PHASE:
CthunPhase = data;
if (data == PHASE_CTHUN_DONE)
{
for (ObjectGuid const& guid : CThunGraspGUIDs)
{
if (GameObject* cthunGrasp = instance->GetGameObject(guid))
{
cthunGrasp->DespawnOrUnsummon(1s);
}
}
}
break;
}
}

View File

@@ -53,6 +53,7 @@ enum DataTypes
enum Creatures
{
NPC_CTHUN = 15727,
NPC_EYE_OF_CTHUN = 15589,
NPC_CTHUN_PORTAL = 15896,
NPC_CLAW_TENTACLE = 15725,
@@ -83,7 +84,24 @@ enum ObjectsAQ40
{
AQ40_DOOR_1 = 180634,
AQ40_DOOR_2 = 180635,
AQ40_DOOR_3 = 180636
AQ40_DOOR_3 = 180636,
GO_CTHUN_GRASP = 180745
};
enum CThunPhases
{
PHASE_NOT_STARTED = 0,
// Main Phase 1 - EYE
PHASE_EYE_GREEN_BEAM = 1,
PHASE_EYE_RED_BEAM = 2,
// Main Phase 2 - CTHUN
PHASE_CTHUN_TRANSITION = 3,
PHASE_CTHUN_STOMACH = 4,
PHASE_CTHUN_WEAK = 5,
PHASE_CTHUN_DONE = 6
};
template <class AI, class T>