fix(Core/Dungeon): Halls of stone doors (#2646)

* Improved logic and DX

Simplified the Developer Experience reading such a messy code and removed some duplicated useless conditions

* fix(core/dungeon): Halls of stone door

The door is closed before Maiden of Grief and Krystalus die.

* Revert "Merge commit 'refs/pull/2634/head' of https://github.com/azerothcore/azerothcore-wotlk into pr-2634"

This reverts commit 04e8ac45e4d868eda4a89229f3721ee699ba4be5, reversing
changes made to 2fa9f5c249.

* Review changes

* improvement to check

Co-authored-by: Yehonal <yehonal.azeroth@gmail.com>
This commit is contained in:
gengarshadowball
2020-03-03 13:00:40 +00:00
committed by GitHub
parent 831dfb4d71
commit 95251dfd2d
2 changed files with 23 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ enum Encounter
enum gobjects
{
GO_TRIBUNAL_CONSOLE = 193907,
GO_TRIBUNAL_ACCESS_DOOR = 191295,
GO_KADDRAK = 191671,
GO_MARNAK = 191670,
GO_ABEDNEUM = 191669,

View File

@@ -31,12 +31,15 @@ public:
uint64 goSjonnirDoorGUID;
uint64 goLeftPipeGUID;
uint64 goRightPipeGUID;
uint64 goTribunalDoorGUID;
uint64 SjonnirGUID;
uint64 BrannGUID;
bool brannAchievement;
bool sjonnirAchievement;
bool isMaidenOfGriefDead;
bool isKrystalusDead;
void Initialize()
{
@@ -51,12 +54,15 @@ public:
goSjonnirDoorGUID = 0;
goLeftPipeGUID = 0;
goRightPipeGUID = 0;
goTribunalDoorGUID = 0;
SjonnirGUID = 0;
BrannGUID = 0;
brannAchievement = false;
sjonnirAchievement = false;
isMaidenOfGriefDead = false;
isKrystalusDead = false;
}
bool IsEncounterInProgress() const
@@ -87,6 +93,10 @@ public:
case GO_TRIBUNAL_CONSOLE:
goTribunalConsoleGUID = go->GetGUID();
break;
case GO_TRIBUNAL_ACCESS_DOOR:
goTribunalDoorGUID = go->GetGUID();
go->SetGoState(GO_STATE_READY);
break;
case GO_SKY_FLOOR:
goSkyRoomFloorGUID = go->GetGUID();
if (Encounter[BOSS_TRIBUNAL_OF_AGES] == DONE)
@@ -128,6 +138,7 @@ public:
switch(id)
{
case GO_TRIBUNAL_CONSOLE: return goTribunalConsoleGUID;
case GO_TRIBUNAL_ACCESS_DOOR: return goTribunalDoorGUID;
case GO_SJONNIR_CONSOLE: return goSjonnirConsoleGUID;
case GO_SJONNIR_DOOR: return goSjonnirDoorGUID;
case GO_LEFT_PIPE: return goLeftPipeGUID;
@@ -173,6 +184,16 @@ public:
if (type < MAX_ENCOUNTER)
Encounter[type] = data;
if (data == DONE)
{
isMaidenOfGriefDead = (type == BOSS_MAIDEN_OF_GRIEF ? true : isMaidenOfGriefDead);
isKrystalusDead = (type == BOSS_KRYSTALLUS ? true : isKrystalusDead);
}
if (isMaidenOfGriefDead && isKrystalusDead)
if (GameObject* tribunalDoor = instance->GetGameObject(goTribunalDoorGUID))
tribunalDoor->SetGoState(GO_STATE_ACTIVE);
if (type == BOSS_TRIBUNAL_OF_AGES && data == DONE)
{
if (GameObject* pA = instance->GetGameObject(goAbedneumGUID))
@@ -250,4 +271,4 @@ public:
void AddSC_instance_halls_of_stone()
{
new instance_halls_of_stone();
}
}