@@ -31,8 +31,7 @@ EndScriptData */
31314 - Murmur event
3232*/
3333
34- instance_shadow_labyrinth::instance_shadow_labyrinth (Map* pMap) : ScriptedInstance(pMap),
35- m_uiFelOverseerCount(0 )
34+ instance_shadow_labyrinth::instance_shadow_labyrinth (Map* pMap) : ScriptedInstance(pMap)
3635{
3736 Initialize ();
3837}
@@ -70,10 +69,6 @@ void instance_shadow_labyrinth::OnCreatureCreate(Creature* pCreature)
7069 case NPC_HELLMAW:
7170 m_mNpcEntryGuidStore[pCreature->GetEntry ()] = pCreature->GetObjectGuid ();
7271 break ;
73- case NPC_FEL_OVERSEER:
74- ++m_uiFelOverseerCount; // TODO should actually only count alive ones
75- debug_log (" SD2: Shadow Labyrinth: counting %u Fel Overseers." , m_uiFelOverseerCount);
76- break ;
7772 }
7873}
7974
@@ -85,54 +80,20 @@ void instance_shadow_labyrinth::SetData(uint32 uiType, uint32 uiData)
8580 m_auiEncounter[0 ] = uiData;
8681 break ;
8782
88- case TYPE_OVERSEER:
89- if (uiData != DONE)
90- {
91- script_error_log (" Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE" );
92- return ;
93- }
94- if (m_uiFelOverseerCount)
95- {
96- --m_uiFelOverseerCount;
97-
98- if (m_uiFelOverseerCount)
99- {
100- debug_log (" SD2: Shadow Labyrinth: %u Fel Overseers left to kill." , m_uiFelOverseerCount);
101-
102- // Skip save call
103- return ;
104- }
105- else
106- {
107- if (Creature* pHellmaw = GetSingleCreatureFromStorage (NPC_HELLMAW))
108- {
109- // yell intro and remove banish aura
110- DoScriptText (SAY_HELLMAW_INTRO, pHellmaw);
111- pHellmaw->GetMotionMaster ()->MoveWaypoint ();
112- if (pHellmaw->HasAura (SPELL_BANISH))
113- pHellmaw->RemoveAurasDueToSpell (SPELL_BANISH);
114- }
115-
116- m_auiEncounter[1 ] = DONE;
117- debug_log (" SD2: Shadow Labyrinth: TYPE_OVERSEER == DONE" );
118- }
119- }
120- break ;
121-
12283 case TYPE_INCITER:
12384 if (uiData == DONE)
12485 DoUseDoorOrButton (GO_REFECTORY_DOOR);
125- m_auiEncounter[2 ] = uiData;
86+ m_auiEncounter[1 ] = uiData;
12687 break ;
12788
12889 case TYPE_VORPIL:
12990 if (uiData == DONE)
13091 DoUseDoorOrButton (GO_SCREAMING_HALL_DOOR);
131- m_auiEncounter[3 ] = uiData;
92+ m_auiEncounter[2 ] = uiData;
13293 break ;
13394
13495 case TYPE_MURMUR:
135- m_auiEncounter[4 ] = uiData;
96+ m_auiEncounter[3 ] = uiData;
13697 break ;
13798 }
13899
@@ -142,7 +103,7 @@ void instance_shadow_labyrinth::SetData(uint32 uiType, uint32 uiData)
142103
143104 std::ostringstream saveStream;
144105 saveStream << m_auiEncounter[0 ] << " " << m_auiEncounter[1 ] << " "
145- << m_auiEncounter[2 ] << " " << m_auiEncounter[3 ] << " " << m_auiEncounter[ 4 ] ;
106+ << m_auiEncounter[2 ] << " " << m_auiEncounter[3 ];
146107
147108 m_strInstData = saveStream.str ();
148109
@@ -156,13 +117,47 @@ uint32 instance_shadow_labyrinth::GetData(uint32 uiType) const
156117 switch (uiType)
157118 {
158119 case TYPE_HELLMAW: return m_auiEncounter[0 ];
159- case TYPE_OVERSEER: return m_auiEncounter[1 ];
120+ case TYPE_INCITER: return m_auiEncounter[1 ];
121+ case TYPE_VORPIL: return m_auiEncounter[2 ];
122+ case TYPE_MURMUR: return m_auiEncounter[3 ];
160123
161124 default :
162125 return 0 ;
163126 }
164127}
165128
129+ void instance_shadow_labyrinth::SetData64 (uint32 uiData, uint64 uiGuid)
130+ {
131+ // If Hellmaw already completed, just ignore
132+ if (GetData (TYPE_HELLMAW) == DONE)
133+ return ;
134+
135+ // Note: this is handled in Acid. The purpose is check which Cabal Ritualists is alive, in case of server reset
136+ // The function is triggered by eventAI on generic timer
137+ if (uiData == DATA_CABAL_RITUALIST)
138+ m_sRitualistsAliveGUIDSet.insert (ObjectGuid (uiGuid));
139+ }
140+
141+ void instance_shadow_labyrinth::OnCreatureDeath (Creature* pCreature)
142+ {
143+ // unbanish Hellmaw when all Cabal Ritualists are dead
144+ if (pCreature->GetEntry () == NPC_CABAL_RITUALIST)
145+ {
146+ m_sRitualistsAliveGUIDSet.erase (pCreature->GetObjectGuid ());
147+
148+ if (m_sRitualistsAliveGUIDSet.empty ())
149+ {
150+ if (Creature* pHellmaw = GetSingleCreatureFromStorage (NPC_HELLMAW))
151+ {
152+ // yell intro and remove banish aura
153+ DoScriptText (SAY_HELLMAW_INTRO, pHellmaw);
154+ pHellmaw->GetMotionMaster ()->MoveWaypoint ();
155+ pHellmaw->RemoveAurasDueToSpell (SPELL_BANISH);
156+ }
157+ }
158+ }
159+ }
160+
166161void instance_shadow_labyrinth::Load (const char * chrIn)
167162{
168163 if (!chrIn)
@@ -174,7 +169,7 @@ void instance_shadow_labyrinth::Load(const char* chrIn)
174169 OUT_LOAD_INST_DATA (chrIn);
175170
176171 std::istringstream loadStream (chrIn);
177- loadStream >> m_auiEncounter[0 ] >> m_auiEncounter[1 ] >> m_auiEncounter[2 ] >> m_auiEncounter[3 ] >> m_auiEncounter[ 4 ] ;
172+ loadStream >> m_auiEncounter[0 ] >> m_auiEncounter[1 ] >> m_auiEncounter[2 ] >> m_auiEncounter[3 ];
178173
179174 for (uint8 i = 0 ; i < MAX_ENCOUNTER; ++i)
180175 {
0 commit comments