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

@@ -0,0 +1,6 @@
--
DELETE FROM `gameobject` WHERE `id`=180745 and `guid` IN (6660,6663,6665);
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
(6660,180745,531,0,0,1,1,-8660.63,2022.4,108.577,3.64774,0,0,-0.968147,0.250381,7200,255,1),
(6663,180745,531,0,0,1,1,-8652.2,2020.92,108.577,0.244346,0,0,0.121869,0.992546,7200,255,1),
(6665,180745,531,0,0,1,1,-8663.34,2029.9,108.577,4.45059,0,0,-0.793353,0.608762,7200,255,1);

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>