From 623418385a02f56954ae808391b422fdb6cdbad7 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Wed, 5 Oct 2011 11:48:59 +0200 Subject: [PATCH] [2303] Reorder TYPE_ enums in sunken temple. Requires Acid 3.0.9 --- .../sunken_temple/instance_sunken_temple.cpp | 30 +++++++------------ .../sunken_temple/sunken_temple.h | 15 ++++------ sd2_revision_nr.h | 2 +- 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp b/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp index 6b425b507..7c0903a3a 100644 --- a/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp +++ b/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp @@ -46,7 +46,7 @@ void instance_sunken_temple::OnObjectCreate(GameObject* pGo) switch(pGo->GetEntry()) { case GO_JAMMALAN_BARRIER: - if (m_auiEncounter[1] == DONE) + if (m_auiEncounter[TYPE_PROTECTORS] == DONE) pGo->SetGoState(GO_STATE_ACTIVE); break; case GO_IDOL_OF_HAKKAR: @@ -137,7 +137,7 @@ void instance_sunken_temple::SetData(uint32 uiType, uint32 uiData) case TYPE_ATALARION: if (uiData == SPECIAL) DoSpawnAtalarionIfCan(); - m_auiEncounter[0] = uiData; + m_auiEncounter[uiType] = uiData; break; case TYPE_PROTECTORS: if (uiData == DONE) @@ -145,7 +145,7 @@ void instance_sunken_temple::SetData(uint32 uiType, uint32 uiData) --m_uiProtectorsRemaining; if (!m_uiProtectorsRemaining) { - m_auiEncounter[1] = uiData; + m_auiEncounter[uiType] = uiData; DoUseDoorOrButton(GO_JAMMALAN_BARRIER); // Intro yell DoOrSimulateScriptTextForThisInstance(SAY_JAMMALAN_INTRO, NPC_JAMMALAN); @@ -153,10 +153,7 @@ void instance_sunken_temple::SetData(uint32 uiType, uint32 uiData) } break; case TYPE_JAMMALAN: - m_auiEncounter[2] = uiData; - break; - case TYPE_MALFURION: - m_auiEncounter[3] = uiData; + m_auiEncounter[uiType] = uiData; break; case TYPE_AVATAR: if (uiData == SPECIAL) @@ -192,7 +189,7 @@ void instance_sunken_temple::SetData(uint32 uiType, uint32 uiData) } // Prevent double processing - if (m_auiEncounter[4] == uiData) + if (m_auiEncounter[uiType] == uiData) return; if (uiData == IN_PROGRESS) @@ -236,7 +233,7 @@ void instance_sunken_temple::SetData(uint32 uiType, uint32 uiData) DoUseDoorOrButton(GO_HAKKAR_DOOR_1); DoUseDoorOrButton(GO_HAKKAR_DOOR_2); - m_auiEncounter[4] = uiData; + m_auiEncounter[uiType] = uiData; break; } @@ -344,22 +341,15 @@ void instance_sunken_temple::Load(const char* chrIn) uint32 instance_sunken_temple::GetData(uint32 uiType) { - switch(uiType) - { - case TYPE_ATALARION: return m_auiEncounter[0]; - case TYPE_PROTECTORS: return m_auiEncounter[1]; - case TYPE_JAMMALAN: return m_auiEncounter[2]; - case TYPE_MALFURION: return m_auiEncounter[3]; - case TYPE_AVATAR: return m_auiEncounter[4]; + if (uiType < MAX_ENCOUNTER) + return m_auiEncounter[uiType]; - default: - return 0; - } + return 0; } void instance_sunken_temple::Update(uint32 uiDiff) { - if (m_auiEncounter[4] != IN_PROGRESS) + if (m_auiEncounter[TYPE_AVATAR] != IN_PROGRESS) return; // Summon random mobs around the circles diff --git a/scripts/eastern_kingdoms/sunken_temple/sunken_temple.h b/scripts/eastern_kingdoms/sunken_temple/sunken_temple.h index c55e7d32e..9dc96ba69 100644 --- a/scripts/eastern_kingdoms/sunken_temple/sunken_temple.h +++ b/scripts/eastern_kingdoms/sunken_temple/sunken_temple.h @@ -11,16 +11,11 @@ enum MAX_STATUES = 6, MAX_FLAMES = 4, - // Don't change types 1,2 and 3 (handled in ACID) - TYPE_ATALARION_OBSOLET= 1, - TYPE_PROTECTORS_OBS = 2, - TYPE_JAMMALAN_OBS = 3, - - TYPE_ATALARION = 4, - TYPE_PROTECTORS = 5, - TYPE_JAMMALAN = 6, - TYPE_MALFURION = 7, - TYPE_AVATAR = 8, + TYPE_ATALARION = 0, + TYPE_PROTECTORS = 1, + TYPE_JAMMALAN = 2, + TYPE_MALFURION = 3, + TYPE_AVATAR = 4, NPC_ATALARION = 8580, NPC_DREAMSCYTH = 5721, diff --git a/sd2_revision_nr.h b/sd2_revision_nr.h index 0177a5d43..1e0a25ec5 100644 --- a/sd2_revision_nr.h +++ b/sd2_revision_nr.h @@ -1,4 +1,4 @@ #ifndef __SD2_REVISION_NR_H__ #define __SD2_REVISION_NR_H__ - #define SD2_REVISION_NR "2302" + #define SD2_REVISION_NR "2303" #endif // __SD2_REVISION_NR_H__