Skip to content

Commit 07af2a7

Browse files
committed
[2248] Add Sapphiron outro dialogue
* Add possibility to simulate texts with dialogue helper * Fix taunts after killing wing-bosses to be displayed shortly after the boss got killed Note at translators/ backporting: The texts and soundIds(LK) for the sapphi dialogue have changed with wotlk
1 parent f12b206 commit 07af2a7

8 files changed

Lines changed: 95 additions & 32 deletions

File tree

include/sc_instance.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ DialogueHelper::DialogueHelper(DialogueEntry const* pDialogueArray) :
176176
m_pCurrentEntry(NULL),
177177
m_pCurrentEntryTwoSide(NULL),
178178
m_uiTimer(0),
179+
m_bCanSimulate(false),
179180
m_bIsFirstSide(true)
180181
{}
181182

@@ -191,6 +192,7 @@ DialogueHelper::DialogueHelper(DialogueEntryTwoSide const* pDialogueTwoSideArray
191192
m_pCurrentEntry(NULL),
192193
m_pCurrentEntryTwoSide(NULL),
193194
m_uiTimer(0),
195+
m_bCanSimulate(false),
194196
m_bIsFirstSide(true)
195197
{}
196198

@@ -268,13 +270,19 @@ void DialogueHelper::DoNextDialogueStep()
268270
m_uiTimer = m_pCurrentEntryTwoSide->uiTimer;
269271
}
270272

271-
// Get Speaker
272-
Creature* pSpeaker = NULL;
273-
if (m_pInstance && uiSpeakerEntry)
274-
pSpeaker = m_pInstance->GetSingleCreatureFromStorage(uiSpeakerEntry);
273+
// Simulate Case
274+
if (m_bCanSimulate && m_pInstance && uiSpeakerEntry && iTextEntry < 0)
275+
m_pInstance->DoOrSimulateScriptTextForThisInstance(iTextEntry, uiSpeakerEntry);
276+
else
277+
{
278+
// Get Speaker
279+
Creature* pSpeaker = NULL;
280+
if (m_pInstance && uiSpeakerEntry)
281+
pSpeaker = m_pInstance->GetSingleCreatureFromStorage(uiSpeakerEntry);
275282

276-
if (pSpeaker && iTextEntry < 0)
277-
DoScriptText(iTextEntry, pSpeaker);
283+
if (pSpeaker && iTextEntry < 0)
284+
DoScriptText(iTextEntry, pSpeaker);
285+
}
278286

279287
JustDidDialogueStep(m_pDialogueArray ? m_pCurrentEntry->iTextEntry : m_pCurrentEntryTwoSide->iTextEntry);
280288

include/sc_instance.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class DialogueHelper
9191
DialogueHelper(DialogueEntryTwoSide const* aDialogueTwoSide);
9292

9393
/// Function that MUST be called
94-
void InitializeDialogueHelper(ScriptedInstance* pInstance) { m_pInstance = pInstance; }
94+
void InitializeDialogueHelper(ScriptedInstance* pInstance, bool bCanSimulateText = false) { m_pInstance = pInstance; m_bCanSimulate = bCanSimulateText; }
9595
/// Set if take first entries or second entries
9696
void SetDialogueSide(bool bIsFirstSide) { m_bIsFirstSide = bIsFirstSide; }
9797

@@ -114,6 +114,7 @@ class DialogueHelper
114114

115115
uint32 m_uiTimer;
116116
bool m_bIsFirstSide;
117+
bool m_bCanSimulate;
117118
};
118119

119120
#endif

scripts/northrend/naxxramas/boss_kelthuzad.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ EndScriptData */
3030

3131
enum
3232
{
33-
//when shappiron dies. dialog between kel and lich king (in this order)
34-
SAY_SAPP_DIALOG1 = -1533084,
35-
SAY_SAPP_DIALOG2_LICH = -1533085,
36-
SAY_SAPP_DIALOG3 = -1533086,
37-
SAY_SAPP_DIALOG4_LICH = -1533087,
38-
SAY_SAPP_DIALOG5 = -1533088,
39-
40-
//when cat dies
41-
SAY_CAT_DIED = -1533089,
42-
4333
SAY_SUMMON_MINIONS = -1533105, //start of phase 1
4434

4535
EMOTE_PHASE2 = -1533135, //start of phase 2
@@ -115,6 +105,7 @@ struct MANGOS_DLL_DECL boss_kelthuzadAI : public ScriptedAI
115105
uint32 m_uiGuardiansCount;
116106
uint32 m_uiGuardiansCountMax;
117107
uint32 m_uiGuardiansTimer;
108+
uint32 m_uiLichKingAnswerTimer;
118109
uint32 m_uiFrostBoltTimer;
119110
uint32 m_uiFrostBoltNovaTimer;
120111
uint32 m_uiChainsTimer;
@@ -146,6 +137,7 @@ struct MANGOS_DLL_DECL boss_kelthuzadAI : public ScriptedAI
146137
m_uiShadowFissureTimer = 25000; //25 seconds
147138
m_uiFrostBlastTimer = urand(30000, 60000); //Random time between 30-60 seconds
148139
m_uiGuardiansTimer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3
140+
m_uiLichKingAnswerTimer = 4000;
149141
m_uiGuardiansCount = 0;
150142
m_uiSummonIntroTimer = 0;
151143
m_uiIntroPackCount = 0;
@@ -539,10 +531,6 @@ struct MANGOS_DLL_DECL boss_kelthuzadAI : public ScriptedAI
539531
{
540532
m_uiPhase = PHASE_GUARDIANS;
541533
DoScriptText(SAY_REQUEST_AID, m_creature);
542-
543-
// here Lich King should respond to Kel'Thuzad but I don't know which creature to make talk
544-
// so for now just make Kel'Thuzad says it.
545-
DoScriptText(SAY_ANSWER_REQUEST, m_creature);
546534
}
547535
}
548536
else if (m_uiPhase == PHASE_GUARDIANS && m_uiGuardiansCount < m_uiGuardiansCountMax)
@@ -555,6 +543,18 @@ struct MANGOS_DLL_DECL boss_kelthuzadAI : public ScriptedAI
555543
}
556544
else
557545
m_uiGuardiansTimer -= uiDiff;
546+
547+
if (m_uiLichKingAnswerTimer && m_pInstance)
548+
{
549+
if (m_uiLichKingAnswerTimer <= uiDiff)
550+
{
551+
if (Creature* pLichKing = m_pInstance->GetSingleCreatureFromStorage(NPC_THE_LICHKING))
552+
DoScriptText(SAY_ANSWER_REQUEST, pLichKing);
553+
m_uiLichKingAnswerTimer = 0;
554+
}
555+
else
556+
m_uiLichKingAnswerTimer -= uiDiff;
557+
}
558558
}
559559

560560
DoMeleeAttackIfReady();

scripts/northrend/naxxramas/instance_naxxramas.cpp

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@ EndScriptData */
2424
#include "precompiled.h"
2525
#include "naxxramas.h"
2626

27+
static const DialogueEntry aNaxxDialogue[] =
28+
{
29+
{SAY_SAPP_DIALOG1, NPC_KELTHUZAD, 6000},
30+
{SAY_SAPP_DIALOG2_LICH, NPC_THE_LICHKING, 6000},
31+
{SAY_SAPP_DIALOG3, NPC_KELTHUZAD, 10000},
32+
{SAY_SAPP_DIALOG4_LICH, NPC_THE_LICHKING, 12000},
33+
{SAY_SAPP_DIALOG5, NPC_KELTHUZAD, 0},
34+
{0,0,0}
35+
};
36+
2737
instance_naxxramas::instance_naxxramas(Map* pMap) : ScriptedInstance(pMap),
38+
m_uiTauntTimer(0),
39+
m_dialogueHelper(aNaxxDialogue),
2840
m_fChamberCenterX(0.0f),
2941
m_fChamberCenterY(0.0f),
3042
m_fChamberCenterZ(0.0f)
@@ -38,6 +50,8 @@ void instance_naxxramas::Initialize()
3850

3951
for (uint8 i = 0; i < MAX_SPECIAL_ACHIEV_CRITS; ++i)
4052
m_abAchievCriteria[i] = false;
53+
54+
m_dialogueHelper.InitializeDialogueHelper(this, true);
4155
}
4256

4357
void instance_naxxramas::OnCreatureCreate(Creature* pCreature)
@@ -55,6 +69,7 @@ void instance_naxxramas::OnCreatureCreate(Creature* pCreature)
5569
case NPC_RIVENDARE:
5670
case NPC_GOTHIK:
5771
case NPC_KELTHUZAD:
72+
case NPC_THE_LICHKING:
5873
m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
5974
break;
6075

@@ -252,7 +267,7 @@ void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
252267
{
253268
DoUseDoorOrButton(GO_ARAC_EYE_RAMP);
254269
DoRespawnGameObject(GO_ARAC_PORTAL, 30*MINUTE);
255-
DoTaunt();
270+
m_uiTauntTimer = 5000;
256271
}
257272
break;
258273
case TYPE_NOTH:
@@ -282,7 +297,7 @@ void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
282297
{
283298
DoUseDoorOrButton(GO_PLAG_EYE_RAMP);
284299
DoRespawnGameObject(GO_PLAG_PORTAL, 30*MINUTE);
285-
DoTaunt();
300+
m_uiTauntTimer = 5000;
286301
}
287302
break;
288303
case TYPE_RAZUVIOUS:
@@ -320,7 +335,7 @@ void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
320335
DoUseDoorOrButton(GO_MILI_EYE_RAMP);
321336
DoRespawnGameObject(GO_MILI_PORTAL, 30*MINUTE);
322337
DoRespawnGameObject(instance->IsRegularDifficulty() ? GO_CHEST_HORSEMEN_NORM : GO_CHEST_HORSEMEN_HERO, 30*MINUTE);
323-
DoTaunt();
338+
m_uiTauntTimer = 5000;
324339
}
325340
break;
326341
case TYPE_PATCHWERK:
@@ -356,7 +371,7 @@ void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
356371
{
357372
DoUseDoorOrButton(GO_CONS_EYE_RAMP);
358373
DoRespawnGameObject(GO_CONS_PORTAL, 30*MINUTE);
359-
DoTaunt();
374+
m_uiTauntTimer = 5000;
360375
}
361376
break;
362377
case TYPE_SAPPHIRON:
@@ -365,7 +380,10 @@ void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
365380
//if (uiData == IN_PROGRESS)
366381
// SetSpecialAchievementCriteria(TYPE_ACHIEV_HUNDRED_CLUB, true);
367382
if (uiData == DONE)
383+
{
368384
DoUseDoorOrButton(GO_KELTHUZAD_WATERFALL_DOOR);
385+
m_dialogueHelper.StartNextDialogueText(SAY_SAPP_DIALOG1);
386+
}
369387
break;
370388
case TYPE_KELTHUZAD:
371389
m_auiEncounter[uiType] = uiData;
@@ -482,6 +500,22 @@ bool instance_naxxramas::CheckAchievementCriteriaMeet(uint32 uiCriteriaId, Playe
482500
}
483501
}
484502

503+
void instance_naxxramas::Update(uint32 uiDiff)
504+
{
505+
if (m_uiTauntTimer)
506+
{
507+
if (m_uiTauntTimer <= uiDiff)
508+
{
509+
DoTaunt();
510+
m_uiTauntTimer = 0;
511+
}
512+
else
513+
m_uiTauntTimer -= uiDiff;
514+
}
515+
516+
m_dialogueHelper.DialogueUpdate(uiDiff);
517+
}
518+
485519
void instance_naxxramas::SetGothTriggers()
486520
{
487521
Creature* pGoth = GetSingleCreatureFromStorage(NPC_GOTHIK);

scripts/northrend/naxxramas/naxxramas.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,20 @@ enum
1111

1212
// A few instance-script related texts
1313
SAY_THADDIUS_GREET = -1533029,
14-
// Kel'Thuzad's taunts after killing Wing Bosses
14+
15+
// Kel'Thuzad
1516
SAY_KELTHUZAD_CAT_DIED = -1533089,
17+
// Kel'Thuzad's taunts after killing Wing Bosses
1618
SAY_KELTHUZAD_TAUNT1 = -1533090,
1719
SAY_KELTHUZAD_TAUNT2 = -1533091,
1820
SAY_KELTHUZAD_TAUNT3 = -1533092,
1921
SAY_KELTHUZAD_TAUNT4 = -1533093,
22+
// Dialogues with Lich King
23+
SAY_SAPP_DIALOG1 = -1533084,
24+
SAY_SAPP_DIALOG2_LICH = -1533085,
25+
SAY_SAPP_DIALOG3 = -1533086,
26+
SAY_SAPP_DIALOG4_LICH = -1533087,
27+
SAY_SAPP_DIALOG5 = -1533088,
2028

2129
TYPE_ANUB_REKHAN = 0,
2230
TYPE_FAERLINA = 1,
@@ -63,6 +71,7 @@ enum
6371
NPC_RIVENDARE = 30549,
6472

6573
NPC_KELTHUZAD = 15990,
74+
NPC_THE_LICHKING = 16980,
6675
NPC_MR_BIGGLESWORTH = 16998,
6776

6877
// Faerlina
@@ -202,6 +211,8 @@ class MANGOS_DLL_DECL instance_naxxramas : public ScriptedInstance
202211
const char* Save() { return m_strInstData.c_str(); }
203212
void Load(const char* chrIn);
204213

214+
void Update(uint32 uiDiff);
215+
205216
// goth
206217
void SetGothTriggers();
207218
Creature* GetClosestAnchorForGoth(Creature* pSource, bool bRightSide);
@@ -231,6 +242,10 @@ class MANGOS_DLL_DECL instance_naxxramas : public ScriptedInstance
231242
float m_fChamberCenterX;
232243
float m_fChamberCenterY;
233244
float m_fChamberCenterZ;
245+
246+
uint32 m_uiTauntTimer;
247+
248+
DialogueHelper m_dialogueHelper;
234249
};
235250

236251
#endif

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 "2247"
3+
#define SD2_REVISION_NR "2248"
44
#endif // __SD2_REVISION_NR_H__

sql/scriptdev2_script_full.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,11 +1430,11 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
14301430
(-1533082,'%s takes in a deep breath...',0,3,0,0,'sapphiron EMOTE_BREATH'),
14311431
(-1533083,'%s resumes his attacks!',0,3,0,0,'sapphiron EMOTE_GROUND'),
14321432

1433-
(-1533084,'Our preparations continue as planned, master.',14467,1,0,0,'kelthuzad SAY_SAPP_DIALOG1'),
1434-
(-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'),
1435-
(-1533086,'I see no complications... Wait... What is this?',14468,1,0,0,'kelthuzad SAY_SAPP_DIALOG3'),
1436-
(-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'),
1437-
(-1533088,'Yes, master!',14469,1,0,0,'kelthuzad SAY_SAPP_DIALOG5'),
1433+
(-1533084,'Your forces are nearly marshalled to strike back against your enemies, my liege.',14467,6,0,0,'kelthuzad SAY_SAPP_DIALOG1'),
1434+
(-1533085,'Soon we will eradicate the Alliance and Horde, then the rest of Azeroth will fall before the might of my army.',14768,6,0,0,'lich_king SAY_SAPP_DIALOG2_LICH'),
1435+
(-1533086,'Yes, Master. The time of their ultimate demise grows close...What is this?',14468,6,0,0,'kelthuzad SAY_SAPP_DIALOG3'),
1436+
(-1533087,'Invaders...here?! DESTROY them, Kel\'Thuzad! Naxxramas must not fall!',14769,6,0,0,'lich_king SAY_SAPP_DIALOG4_LICH'),
1437+
(-1533088,'As you command, Master!',14469,6,0,0,'kelthuzad SAY_SAPP_DIALOG5'),
14381438
(-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,6,0,0,'kelthuzad SAY_CAT_DIED'),
14391439
(-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,6,0,0,'kelthuzad SAY_TAUNT1'),
14401440
(-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,6,0,0,'kelthuzad SAY_TAUNT2'),

sql/updates/r2248_scriptdev2.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
UPDATE script_texts SET content_default='Your forces are nearly marshalled to strike back against your enemies, my liege.', type=6 WHERE entry = -1533084;
2+
UPDATE script_texts SET content_default='Soon we will eradicate the Alliance and Horde, then the rest of Azeroth will fall before the might of my army.', type=6, sound=14768, comment='lich_king SAY_SAPP_DIALOG2_LICH' WHERE entry = -1533085;
3+
UPDATE script_texts SET content_default='Yes, Master. The time of their ultimate demise grows close...What is this?', type=6 WHERE entry = -1533086;
4+
UPDATE script_texts SET content_default='Invaders...here?! DESTROY them, Kel\'Thuzad! Naxxramas must not fall!', type=6, sound=14769, comment='lich_king SAY_SAPP_DIALOG4_LICH' WHERE entry = -1533087;
5+
UPDATE script_texts SET content_default='As you command, Master!', type=6 WHERE entry = -1533088;

0 commit comments

Comments
 (0)