Skip to content

Commit e3e42bf

Browse files
committed
[3061] Complete CoS intro and allow players to skip it and jump directly into action
1 parent 28b9529 commit e3e42bf

6 files changed

Lines changed: 74 additions & 6 deletions

File tree

scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,14 @@ bool GossipSelect_npc_chromie(Player* pPlayer, Creature* pCreature, uint32 /*sen
129129
{
130130
// only skip intro if not already started;
131131
if (pInstance->GetData(TYPE_ARTHAS_INTRO_EVENT) == NOT_STARTED && pInstance->GetData(TYPE_GRAIN_EVENT) == NOT_STARTED)
132+
{
132133
pInstance->SetData(TYPE_ARTHAS_INTRO_EVENT, DONE);
134+
pInstance->SetData(TYPE_GRAIN_EVENT, DONE);
135+
136+
// spawn Arthas and Chromie
137+
pInstance->DoSpawnChromieIfNeeded(pPlayer);
138+
pInstance->DoSpawnArthasIfNeeded(pPlayer);
139+
}
133140
}
134141
pPlayer->CLOSE_GOSSIP_MENU();
135142
break;
@@ -293,6 +300,7 @@ enum
293300

294301
SPELL_HOLY_LIGHT = 52444,
295302
SPELL_EXORCISM = 52445,
303+
SPELL_EXORCISM_H = 58822,
296304
SPELL_DEVOTION_AURA = 52442,
297305
};
298306

scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ enum
5555
NPC_UTHER_LIGHTBRINGER = 26528,
5656
NPC_KNIGHT_SILVERHAND = 28612,
5757
NPC_LORDAERON_FOOTMAN = 27745,
58+
NPC_HIGH_ELF_MAGE_PRIEST = 27747,
5859
NPC_STRATHOLME_CITIZEN = 28167,
5960
NPC_STRATHOLME_RESIDENT = 28169,
6061

@@ -144,14 +145,16 @@ class instance_culling_of_stratholme : public ScriptedInstance
144145
Creature* GetStratIntroFootman();
145146
void GetResidentOrderedList(std::list<Creature*>& lList);
146147

148+
void DoSpawnChromieIfNeeded(Unit* pSummoner);
147149
void DoSpawnArthasIfNeeded(Unit* pSummoner);
148150
bool CanGrainEventProgress(Creature* pCrate);
149151

150152
void DoEventAtTriggerIfCan(uint32 uiTriggerId);
151153

152154
protected:
155+
void DoSetupEntranceSoldiers(Unit* pSummoner);
153156
void DoChromieWhisper(int32 iEntry);
154-
void DoSpawnChromieIfNeeded(Unit* pSummoner);
157+
void DoUpdateZombieResidents();
155158
uint8 GetInstancePosition();
156159
void ArthasJustDied();
157160

@@ -167,6 +170,7 @@ class instance_culling_of_stratholme : public ScriptedInstance
167170
GuidList m_luiCratesBunnyGUIDs;
168171
GuidList m_luiFootmanGUIDs;
169172
GuidList m_luiResidentGUIDs;
173+
GuidList m_luiGateSoldiersGUIDs;
170174

171175
GuidList m_lAgiatedCitizenGUIDList;
172176
GuidList m_lAgiatedResidentGUIDList;

scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ enum
3131
SAY_CHROMIE_HURRY = -1000000, // TODO
3232

3333
WHISPER_CHROMIE_CRATES = -1595001,
34+
WHISPER_CHROMIE_GUARDIAN = -1595002,
3435
};
3536

3637
struct sSpawnLocation
@@ -53,7 +54,13 @@ static sSpawnLocation m_aIntroActorsSpawnLocs[] =
5354
{1786.18f, 1268.63f, 140.02f, 0.42f}, // Uther
5455
{1780.26f, 1261.87f, 139.55f, 0.57f}, // Silverhand knights
5556
{1778.59f, 1265.03f, 139.43f, 0.40f},
56-
{1777.04f, 1268.16f, 139.35f, 0.59f}
57+
{1777.04f, 1268.16f, 139.35f, 0.59f},
58+
{2091.47f, 1294.28f, 139.82f, 6.27f}, // High elf priests
59+
{2091.26f, 1281.71f, 139.92f, 6.27f},
60+
{2096.12f, 1290.53f, 138.81f, 6.27f}, // Footman
61+
{2096.41f, 1284.22f, 138.79f, 6.27f},
62+
{2096.93f, 1297.57f, 138.96f, 6.27f},
63+
{2096.32f, 1278.98f, 139.43f, 6.27f}
5764
};
5865

5966
static sSpawnLocation m_aChromieSpawnLocs[] =
@@ -101,8 +108,16 @@ void instance_culling_of_stratholme::OnCreatureCreate(Creature* pCreature)
101108
m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
102109
break;
103110

104-
case NPC_GRAIN_CRATE_HELPER: m_luiCratesBunnyGUIDs.push_back(pCreature->GetObjectGuid()); break;
105-
case NPC_LORDAERON_FOOTMAN: m_luiFootmanGUIDs.push_back(pCreature->GetObjectGuid()); break;
111+
case NPC_GRAIN_CRATE_HELPER:
112+
m_luiCratesBunnyGUIDs.push_back(pCreature->GetObjectGuid());
113+
break;
114+
case NPC_LORDAERON_FOOTMAN:
115+
m_luiFootmanGUIDs.push_back(pCreature->GetObjectGuid());
116+
// no break;
117+
case NPC_HIGH_ELF_MAGE_PRIEST:
118+
if (pCreature->GetPositionX() > 2000.0f)
119+
m_luiGateSoldiersGUIDs.push_back(pCreature->GetObjectGuid());
120+
break;
106121

107122
case NPC_STRATHOLME_CITIZEN:
108123
case NPC_STRATHOLME_RESIDENT:
@@ -179,6 +194,7 @@ void instance_culling_of_stratholme::SetData(uint32 uiType, uint32 uiData)
179194
if (uiData == DONE)
180195
{
181196
// ToDo: start the wave event
197+
DoUpdateZombieResidents();
182198
}
183199
break;
184200
case TYPE_ARTHAS_ESCORT_EVENT:
@@ -451,6 +467,9 @@ void instance_culling_of_stratholme::DoSpawnArthasIfNeeded(Unit* pSummoner)
451467
pKnight->GetMotionMaster()->MoveFollow(pUther, pKnight->GetDistance(pUther), 2 * M_PI_F - pKnight->GetAngle(pUther));
452468
}
453469
}
470+
// setup the entrance soldiers in case of reload or intro skip
471+
else if (uiPosition == POS_ARTHAS_WAVES)
472+
DoSetupEntranceSoldiers(pSummoner);
454473
}
455474

456475
// Atm here only new Chromies are spawned - despawning depends on Mangos featuring such a thing
@@ -477,6 +496,39 @@ void instance_culling_of_stratholme::DoSpawnChromieIfNeeded(Unit* pSummoner)
477496
}
478497
}
479498

499+
// Function that sets up the city entrance soldiers in case of reload or if the intro is skipped
500+
void instance_culling_of_stratholme::DoSetupEntranceSoldiers(Unit* pSummoner)
501+
{
502+
if (!pSummoner)
503+
return;
504+
505+
// despawn the current set of soldiers
506+
for (GuidList::const_iterator itr = m_luiGateSoldiersGUIDs.begin(); itr != m_luiGateSoldiersGUIDs.end(); ++itr)
507+
{
508+
if (Creature* pSoldier = instance->GetCreature(*itr))
509+
pSoldier->ForcedDespawn();
510+
}
511+
512+
// spawn others in the right spot
513+
pSummoner->SummonCreature(NPC_HIGH_ELF_MAGE_PRIEST, m_aIntroActorsSpawnLocs[5].m_fX, m_aIntroActorsSpawnLocs[5].m_fY, m_aIntroActorsSpawnLocs[5].m_fZ, m_aIntroActorsSpawnLocs[5].m_fO, TEMPSUMMON_CORPSE_DESPAWN, 10000);
514+
pSummoner->SummonCreature(NPC_HIGH_ELF_MAGE_PRIEST, m_aIntroActorsSpawnLocs[6].m_fX, m_aIntroActorsSpawnLocs[6].m_fY, m_aIntroActorsSpawnLocs[6].m_fZ, m_aIntroActorsSpawnLocs[6].m_fO, TEMPSUMMON_CORPSE_DESPAWN, 10000);
515+
pSummoner->SummonCreature(NPC_LORDAERON_FOOTMAN, m_aIntroActorsSpawnLocs[7].m_fX, m_aIntroActorsSpawnLocs[7].m_fY, m_aIntroActorsSpawnLocs[7].m_fZ, m_aIntroActorsSpawnLocs[7].m_fO, TEMPSUMMON_CORPSE_DESPAWN, 10000);
516+
pSummoner->SummonCreature(NPC_LORDAERON_FOOTMAN, m_aIntroActorsSpawnLocs[8].m_fX, m_aIntroActorsSpawnLocs[8].m_fY, m_aIntroActorsSpawnLocs[8].m_fZ, m_aIntroActorsSpawnLocs[8].m_fO, TEMPSUMMON_CORPSE_DESPAWN, 10000);
517+
pSummoner->SummonCreature(NPC_LORDAERON_FOOTMAN, m_aIntroActorsSpawnLocs[9].m_fX, m_aIntroActorsSpawnLocs[9].m_fY, m_aIntroActorsSpawnLocs[9].m_fZ, m_aIntroActorsSpawnLocs[9].m_fO, TEMPSUMMON_CORPSE_DESPAWN, 10000);
518+
pSummoner->SummonCreature(NPC_LORDAERON_FOOTMAN, m_aIntroActorsSpawnLocs[10].m_fX, m_aIntroActorsSpawnLocs[10].m_fY, m_aIntroActorsSpawnLocs[10].m_fZ, m_aIntroActorsSpawnLocs[10].m_fO, TEMPSUMMON_CORPSE_DESPAWN, 10000);
519+
}
520+
521+
// Function that updates all the stratholme humans to zombies
522+
void instance_culling_of_stratholme::DoUpdateZombieResidents()
523+
{
524+
// update all residents
525+
for (GuidList::const_iterator itr = m_luiResidentGUIDs.begin(); itr != m_luiResidentGUIDs.end(); ++itr)
526+
{
527+
if (Creature* pResident = instance->GetCreature(*itr))
528+
pResident->UpdateEntry(NPC_ZOMBIE);
529+
}
530+
}
531+
480532
// Function to check if the grain event can progress
481533
bool instance_culling_of_stratholme::CanGrainEventProgress(Creature* pCrate)
482534
{

sd2_revision_nr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "3060"
3+
#define SD2_REVISION_NR "3061"
44
#endif // __SD2_REVISION_NR_H__

sql/scriptdev2_script_full.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3420,7 +3420,8 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
34203420
-- -1 595 000 CULLING OF STRATHOLME
34213421
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
34223422
(-1595000,'All soldiers of Lordaeron should immediately report to the entrance of Stratholme, and await further orders from Prince Arthas.',0,6,0,0,'lordaeron crier SAY_SOLDIERS_REPORT'),
3423-
(-1595001,'Good work with the crates! Come talk to me in front of Stratholme for your next assignment!',0,4,0,0,'chromie WHISPER_CHROMIE_CRATES');
3423+
(-1595001,'Good work with the crates! Come talk to me in front of Stratholme for your next assignment!',0,4,0,0,'chromie WHISPER_CHROMIE_CRATES'),
3424+
(-1595002,'Oh, no! Adventurers, something awful has happened! A colleague of mine has been captured by the Infinite Dragonflight, and they\'re doing something horrible to him! Keeping Arthas is still your highest priority, but if you act fast you could help save a Guardian of Time!',0,4,0,0,'chromie WHISPER_CHROMIE_GUARDIAN');
34243425

34253426
-- -1 599 000 HALLS OF STONE
34263427
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES

sql/updates/r3061_scriptdev2.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DELETE FROM script_texts WHERE entry=-1595002;
2+
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
3+
(-1595002,'Oh, no! Adventurers, something awful has happened! A colleague of mine has been captured by the Infinite Dragonflight, and they\'re doing something horrible to him! Keeping Arthas is still your highest priority, but if you act fast you could help save a Guardian of Time!',0,4,0,0,'chromie WHISPER_CHROMIE_GUARDIAN');

0 commit comments

Comments
 (0)