3030 MAX_GRAIN_CRATES = 5 ,
3131 MAX_SCOURGE_SPAWN_POS = 5 ,
3232
33- SAY_CHROMIE_HURRY = -1000000 , // TODO
3433 SAY_SCOURGE_FESTIVAL_LANE = -1595003 ,
3534 SAY_SCOURGE_KINGS_SQUARE = -1595004 ,
3635 SAY_SCOURGE_MARKET_ROW = -1595005 ,
3736 SAY_SCOURGE_TOWN_HALL = -1595006 ,
3837 SAY_SCOURGE_ELDERS_SQUARE = -1595007 ,
3938
4039 SAY_MEET_TOWN_HALL = -1595008 ,
40+ SAY_CORRUPTOR_DESPAWN = -1595041 ,
4141
4242 WHISPER_CHROMIE_CRATES = -1595001 ,
4343 WHISPER_CHROMIE_GUARDIAN = -1595002 ,
44+ WHISPER_CHROMIE_HURRY = -1000000 , // TODO
4445
4546 SPELL_CORRUPTION_OF_TIME = 60422 , // triggers 60451
4647};
@@ -55,8 +56,8 @@ static sSpawnLocation m_aArthasSpawnLocs[] = // need tuning
5556 {1957 .13f , 1287 .43f , 145 .65f , 2 .96f }, // bridge
5657 {2091 .99f , 1277 .25f , 140 .47f , 0 .43f }, // city entrance
5758 {2366 .24f , 1195 .25f , 132 .04f , 3 .15f }, // town hall
58- {2534 .46f , 1125 . 99f , 130 .75f , 0 . 27f },
59- {2363 .77f , 1406 . 31f , 128 .64f , 3 . 23f }
59+ {2534 .98f , 1126 . 16f , 130 .86f , 2 . 84f }, // burning stratholme
60+ {2363 .44f , 1404 . 90f , 128 .64f , 2 . 77f }, // crusader square gate
6061};
6162
6263static sSpawnLocation m_aIntroActorsSpawnLocs[] =
@@ -201,6 +202,8 @@ void instance_culling_of_stratholme::OnCreatureCreate(Creature* pCreature)
201202 case NPC_PATRICIA_O_REILLY :
202203 case NPC_LORDAERON_CRIER :
203204 case NPC_INFINITE_CORRUPTER :
205+ case NPC_LORD_EPOCH :
206+ case NPC_MALGANIS :
204207 m_mNpcEntryGuidStore[pCreature->GetEntry ()] = pCreature->GetObjectGuid ();
205208 break ;
206209
@@ -248,6 +251,7 @@ void instance_culling_of_stratholme::OnObjectCreate(GameObject* pGo)
248251 break ;
249252 case GO_DARK_RUNED_CHEST :
250253 case GO_DARK_RUNED_CHEST_H :
254+ case GO_CITY_ENTRANCE_GATE :
251255 break ;
252256
253257 default :
@@ -291,11 +295,6 @@ void instance_culling_of_stratholme::SetData(uint32 uiType, uint32 uiData)
291295 SetData (TYPE_MEATHOOK_EVENT , IN_PROGRESS );
292296 }
293297 break ;
294- case TYPE_ARTHAS_ESCORT_EVENT :
295- m_auiEncounter[uiType] = uiData;
296- if (uiData == FAIL )
297- m_uiArthasRespawnTimer = 10000 ;
298- break ;
299298 case TYPE_MEATHOOK_EVENT :
300299 m_auiEncounter[uiType] = uiData;
301300 if (uiData == DONE )
@@ -309,13 +308,41 @@ void instance_culling_of_stratholme::SetData(uint32 uiType, uint32 uiData)
309308 if (uiData == DONE )
310309 m_uiScourgeWaveTimer = 5000 ;
311310 break ;
311+ case TYPE_ARTHAS_TOWNHALL_EVENT :
312+ m_auiEncounter[uiType] = uiData;
313+ if (uiData == DONE )
314+ {
315+ // despawn arthas and spawn him in the next point
316+ if (Creature* pArthas = GetSingleCreatureFromStorage (NPC_ARTHAS ))
317+ pArthas->ForcedDespawn ();
318+
319+ if (Player* pPlayer = GetPlayerInMap ())
320+ DoSpawnArthasIfNeeded (pPlayer);
321+ }
322+ break ;
312323 case TYPE_EPOCH_EVENT :
313324 m_auiEncounter[uiType] = uiData;
314325 break ;
326+ case TYPE_ARTHAS_ESCORT_EVENT :
327+ // use fail in order to respawn Arthas
328+ if (uiData == FAIL )
329+ {
330+ m_uiArthasRespawnTimer = 10000 ;
331+
332+ // despawn the bosses if Arthas dies in order to avoid exploits
333+ if (Creature* pEpoch = GetSingleCreatureFromStorage (NPC_LORD_EPOCH , true ))
334+ pEpoch->ForcedDespawn ();
335+ if (Creature* pMalganis = GetSingleCreatureFromStorage (NPC_MALGANIS , true ))
336+ pMalganis->ForcedDespawn ();
337+ }
338+ else
339+ m_auiEncounter[uiType] = uiData;
340+ break ;
315341 case TYPE_MALGANIS_EVENT :
316342 m_auiEncounter[uiType] = uiData;
317343 if (uiData == DONE )
318344 {
345+ DoUseDoorOrButton (GO_CITY_ENTRANCE_GATE );
319346 DoToggleGameObjectFlags (instance->IsRegularDifficulty () ? GO_DARK_RUNED_CHEST : GO_DARK_RUNED_CHEST_H , GO_FLAG_NO_INTERACT , false );
320347 DoRespawnGameObject (instance->IsRegularDifficulty () ? GO_DARK_RUNED_CHEST : GO_DARK_RUNED_CHEST_H , 30 * MINUTE );
321348
@@ -354,13 +381,15 @@ void instance_culling_of_stratholme::SetData(uint32 uiType, uint32 uiData)
354381 SetData (TYPE_INFINITE_CORRUPTER_TIME , 0 );
355382 break ;
356383 case SPECIAL :
357- DoChromieWhisper (SAY_CHROMIE_HURRY );
384+ DoChromieWhisper (WHISPER_CHROMIE_HURRY );
358385 break ;
359386 case FAIL :
360387 // event failed - despawn the corruptor
361388 SetData (TYPE_INFINITE_CORRUPTER_TIME , 0 );
362389 if (Creature* pCorrupter = GetSingleCreatureFromStorage (NPC_INFINITE_CORRUPTER ))
363390 {
391+ DoOrSimulateScriptTextForThisInstance (SAY_CORRUPTOR_DESPAWN , NPC_INFINITE_CORRUPTER );
392+
364393 if (pCorrupter->isAlive ())
365394 pCorrupter->ForcedDespawn ();
366395 }
@@ -369,14 +398,15 @@ void instance_culling_of_stratholme::SetData(uint32 uiType, uint32 uiData)
369398 break ;
370399 }
371400
372- if (uiData == DONE || uiData == FAIL || uiType == TYPE_INFINITE_CORRUPTER_TIME )
401+ if (uiData == DONE || uiType == TYPE_INFINITE_CORRUPTER_TIME )
373402 {
374403 OUT_SAVE_INST_DATA ;
375404
376405 std::ostringstream saveStream;
377406 saveStream << m_auiEncounter[0 ] << " " << m_auiEncounter[1 ] << " " << m_auiEncounter[2 ] << " "
378407 << m_auiEncounter[3 ] << " " << m_auiEncounter[4 ] << " " << m_auiEncounter[5 ] << " "
379- << m_auiEncounter[6 ] << " " << m_auiEncounter[7 ] << " " << m_auiEncounter[8 ];
408+ << m_auiEncounter[6 ] << " " << m_auiEncounter[7 ] << " " << m_auiEncounter[8 ] << " "
409+ << m_auiEncounter[9 ];
380410
381411 m_strInstData = saveStream.str ();
382412
@@ -397,6 +427,10 @@ void instance_culling_of_stratholme::OnCreatureDeath(Creature* pCreature)
397427{
398428 switch (pCreature->GetEntry ())
399429 {
430+ case NPC_MEATHOOK : SetData (TYPE_MEATHOOK_EVENT , DONE ); break ;
431+ case NPC_SALRAMM_THE_FLESHCRAFTER : SetData (TYPE_SALRAMM_EVENT , DONE ); break ;
432+ case NPC_LORD_EPOCH : SetData (TYPE_EPOCH_EVENT , DONE ); break ;
433+
400434 case NPC_ENRAGING_GHOUL :
401435 case NPC_ACOLYTE :
402436 case NPC_MASTER_NECROMANCER :
@@ -430,7 +464,8 @@ void instance_culling_of_stratholme::Load(const char* chrIn)
430464
431465 std::istringstream loadStream (chrIn);
432466 loadStream >> m_auiEncounter[0 ] >> m_auiEncounter[1 ] >> m_auiEncounter[2 ] >> m_auiEncounter[3 ]
433- >> m_auiEncounter[4 ] >> m_auiEncounter[5 ] >> m_auiEncounter[6 ] >> m_auiEncounter[7 ] >> m_auiEncounter[8 ];
467+ >> m_auiEncounter[4 ] >> m_auiEncounter[5 ] >> m_auiEncounter[6 ] >> m_auiEncounter[7 ]
468+ >> m_auiEncounter[8 ] >> m_auiEncounter[9 ];
434469
435470 for (uint8 i = 0 ; i < MAX_ENCOUNTER ; ++i)
436471 {
0 commit comments