Skip to content

Commit 3f647bf

Browse files
XfurrySchmoozerd
authored andcommitted
[2254] Improve Ambassador Hellmaw (Shadow Labyrinth)
* Cleanup boss script * Remove his SD2 waypoints, this is expected to be done by world DB providers * Note: His banishment doesn't work due is mechanics immunity, I consider this as core bug. Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
1 parent 1c7890e commit 3f647bf

6 files changed

Lines changed: 87 additions & 136 deletions

File tree

scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp

Lines changed: 66 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -23,61 +23,51 @@ EndScriptData */
2323

2424
#include "precompiled.h"
2525
#include "shadow_labyrinth.h"
26-
#include "escort_ai.h"
2726

28-
#define SAY_INTRO -1555000
29-
30-
#define SAY_AGGRO1 -1555001
31-
#define SAY_AGGRO2 -1555002
32-
#define SAY_AGGRO3 -1555003
33-
34-
#define SAY_HELP -1555004
35-
36-
#define SAY_SLAY1 -1555005
37-
#define SAY_SLAY2 -1555006
38-
39-
#define SAY_DEATH -1555007
40-
41-
#define SPELL_BANISH 30231
42-
#define SPELL_CORROSIVE_ACID 33551
43-
#define SPELL_FEAR 33547
44-
#define SPELL_ENRAGE 34970
27+
enum
28+
{
29+
SAY_AGGRO_1 = -1555001,
30+
SAY_AGGRO_2 = -1555002,
31+
SAY_AGGRO_3 = -1555003,
32+
SAY_HELP = -1555004,
33+
SAY_SLAY_1 = -1555005,
34+
SAY_SLAY_2 = -1555006,
35+
SAY_DEATH = -1555007,
36+
37+
SPELL_CORROSIVE_ACID = 33551,
38+
SPELL_FEAR = 33547,
39+
SPELL_ENRAGE = 34970
40+
};
4541

46-
struct MANGOS_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI
42+
struct MANGOS_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
4743
{
48-
boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature)
44+
boss_ambassador_hellmawAI(Creature* pCreature) : ScriptedAI(pCreature)
4945
{
5046
m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
5147
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
5248
Reset();
49+
50+
if (m_pInstance && m_creature->isAlive())
51+
{
52+
if (m_pInstance->GetData(TYPE_OVERSEER) != DONE)
53+
DoCastSpellIfCan(m_creature, SPELL_BANISH, CAST_TRIGGERED);
54+
}
5355
}
5456

5557
ScriptedInstance* m_pInstance;
5658
bool m_bIsRegularMode;
5759

58-
uint32 EventCheck_Timer;
59-
uint32 CorrosiveAcid_Timer;
60-
uint32 Fear_Timer;
61-
uint32 Enrage_Timer;
62-
bool Intro;
63-
bool IsBanished;
64-
bool Enraged;
60+
uint32 m_uiCorrosiveAcidTimer;
61+
uint32 m_uiFearTimer;
62+
uint32 m_uiEnrageTimer;
63+
bool m_bIsEnraged;
6564

6665
void Reset()
6766
{
68-
EventCheck_Timer = 5000;
69-
CorrosiveAcid_Timer = urand(5000, 10000);
70-
Fear_Timer = urand(25000, 30000);
71-
Enrage_Timer = 180000;
72-
Intro = false;
73-
IsBanished = true;
74-
Enraged = false;
75-
76-
if (m_pInstance && m_creature->isAlive())
77-
{
78-
if (m_pInstance->GetData(TYPE_OVERSEER) != DONE)
79-
m_creature->CastSpell(m_creature, SPELL_BANISH, true);
80-
}
67+
m_uiCorrosiveAcidTimer = urand(5000, 10000);
68+
m_uiFearTimer = urand(25000, 30000);
69+
m_uiEnrageTimer = 3*MINUTE*IN_MILLISECONDS;
70+
m_bIsEnraged = false;
8171
}
8272

8373
void JustReachedHome()
@@ -86,107 +76,62 @@ struct MANGOS_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI
8676
m_pInstance->SetData(TYPE_HELLMAW, FAIL);
8777
}
8878

89-
void WaypointReached(uint32 i)
90-
{
91-
}
92-
93-
void DoIntro()
94-
{
95-
if (m_creature->HasAura(SPELL_BANISH, EFFECT_INDEX_0))
96-
m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
97-
98-
IsBanished = false;
99-
Intro = true;
100-
101-
if (m_pInstance)
102-
{
103-
if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL)
104-
{
105-
DoScriptText(SAY_INTRO, m_creature);
106-
Start(false, NULL, NULL, false, true);
107-
}
108-
109-
m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS);
110-
}
111-
}
112-
113-
void MoveInLineOfSight(Unit *who)
114-
{
115-
if (m_creature->HasAura(SPELL_BANISH, EFFECT_INDEX_0))
116-
return;
117-
118-
npc_escortAI::MoveInLineOfSight(who);
119-
}
120-
121-
void Aggro(Unit *who)
79+
void Aggro(Unit* pWho)
12280
{
12381
switch(urand(0, 2))
12482
{
125-
case 0: DoScriptText(SAY_AGGRO1, m_creature); break;
126-
case 1: DoScriptText(SAY_AGGRO2, m_creature); break;
127-
case 2: DoScriptText(SAY_AGGRO3, m_creature); break;
83+
case 0: DoScriptText(SAY_AGGRO_1, m_creature); break;
84+
case 1: DoScriptText(SAY_AGGRO_2, m_creature); break;
85+
case 2: DoScriptText(SAY_AGGRO_3, m_creature); break;
12886
}
87+
88+
if (m_pInstance)
89+
m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS);
12990
}
13091

131-
void KilledUnit(Unit *victim)
92+
void KilledUnit(Unit* pVictim)
13293
{
133-
DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature);
94+
DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature);
13495
}
13596

136-
void JustDied(Unit *victim)
97+
void JustDied(Unit* pKiller)
13798
{
13899
DoScriptText(SAY_DEATH, m_creature);
139100

140101
if (m_pInstance)
141102
m_pInstance->SetData(TYPE_HELLMAW, DONE);
142103
}
143104

144-
void UpdateEscortAI(const uint32 diff)
105+
void UpdateAI(const uint32 uiDiff)
145106
{
146-
if (!Intro && !HasEscortState(STATE_ESCORT_ESCORTING))
147-
{
148-
if (EventCheck_Timer < diff)
149-
{
150-
if (m_pInstance)
151-
{
152-
if (m_pInstance->GetData(TYPE_OVERSEER) == DONE)
153-
{
154-
DoIntro();
155-
return;
156-
}
157-
}
158-
EventCheck_Timer = 5000;
159-
return;
160-
}
161-
else
162-
{
163-
EventCheck_Timer -= diff;
164-
return;
165-
}
166-
}
167-
168107
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
169108
return;
170109

171-
if (CorrosiveAcid_Timer < diff)
110+
if (m_uiCorrosiveAcidTimer < uiDiff)
172111
{
173-
DoCastSpellIfCan(m_creature->getVictim(),SPELL_CORROSIVE_ACID);
174-
CorrosiveAcid_Timer = urand(15000, 25000);
175-
}else CorrosiveAcid_Timer -= diff;
112+
if (DoCastSpellIfCan(m_creature, SPELL_CORROSIVE_ACID) == CAST_OK)
113+
m_uiCorrosiveAcidTimer = urand(15000, 25000);
114+
}
115+
else
116+
m_uiCorrosiveAcidTimer -= uiDiff;
176117

177-
if (Fear_Timer < diff)
118+
if (m_uiFearTimer < uiDiff)
178119
{
179-
DoCastSpellIfCan(m_creature,SPELL_FEAR);
180-
Fear_Timer = urand(20000, 35000);
181-
}else Fear_Timer -= diff;
120+
if (DoCastSpellIfCan(m_creature, SPELL_FEAR) == CAST_OK)
121+
m_uiFearTimer = urand(20000, 35000);
122+
}
123+
else
124+
m_uiFearTimer -= uiDiff;
182125

183-
if (!m_bIsRegularMode)
126+
if (!m_bIsRegularMode && !m_bIsEnraged)
184127
{
185-
if (!Enraged && Enrage_Timer < diff)
128+
if (m_uiEnrageTimer < uiDiff)
186129
{
187-
DoCastSpellIfCan(m_creature,SPELL_ENRAGE);
188-
Enraged = true;
189-
}else Enrage_Timer -= diff;
130+
if (DoCastSpellIfCan(m_creature, SPELL_ENRAGE) == CAST_OK)
131+
m_bIsEnraged = true;
132+
}
133+
else
134+
m_uiEnrageTimer -= uiDiff;
190135
}
191136

192137
DoMeleeAttackIfReady();
@@ -200,9 +145,10 @@ CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature)
200145

201146
void AddSC_boss_ambassador_hellmaw()
202147
{
203-
Script *newscript;
204-
newscript = new Script;
205-
newscript->Name = "boss_ambassador_hellmaw";
206-
newscript->GetAI = &GetAI_boss_ambassador_hellmaw;
207-
newscript->RegisterSelf();
148+
Script* pNewScript;
149+
150+
pNewScript = new Script;
151+
pNewScript->Name = "boss_ambassador_hellmaw";
152+
pNewScript->GetAI = &GetAI_boss_ambassador_hellmaw;
153+
pNewScript->RegisterSelf();
208154
}

scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ void instance_shadow_labyrinth::OnCreatureCreate(Creature* pCreature)
6767
switch(pCreature->GetEntry())
6868
{
6969
case NPC_VORPIL:
70-
m_mNpcEntryGuidStore[NPC_VORPIL] = pCreature->GetObjectGuid();
70+
case NPC_HELLMAW:
71+
m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
7172
break;
7273
case NPC_FEL_OVERSEER:
7374
++m_uiFelOverseerCount; // TODO should actually only count alive ones
@@ -103,6 +104,14 @@ void instance_shadow_labyrinth::SetData(uint32 uiType, uint32 uiData)
103104
}
104105
else
105106
{
107+
if (Creature* pHellmaw = GetSingleCreatureFromStorage(NPC_HELLMAW))
108+
{
109+
// yell intro and remove banish aura
110+
DoScriptText(SAY_HELLMAW_INTRO, pHellmaw);
111+
if (pHellmaw->HasAura(SPELL_BANISH))
112+
pHellmaw->RemoveAurasDueToSpell(SPELL_BANISH);
113+
}
114+
106115
m_auiEncounter[1] = DONE;
107116
debug_log("SD2: Shadow Labyrinth: TYPE_OVERSEER == DONE");
108117
}
@@ -166,9 +175,11 @@ void instance_shadow_labyrinth::Load(const char* chrIn)
166175
std::istringstream loadStream(chrIn);
167176
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4];
168177

169-
for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
178+
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
179+
{
170180
if (m_auiEncounter[i] == IN_PROGRESS)
171181
m_auiEncounter[i] = NOT_STARTED;
182+
}
172183

173184
OUT_LOAD_INST_DATA_COMPLETE;
174185
}

scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ enum
1515
TYPE_VORPIL = 4,
1616
TYPE_MURMUR = 5,
1717

18+
NPC_HELLMAW = 18731,
1819
NPC_VORPIL = 18732,
1920
NPC_FEL_OVERSEER = 18796,
2021

2122
GO_REFECTORY_DOOR = 183296, //door opened when blackheart the inciter dies
22-
GO_SCREAMING_HALL_DOOR = 183295 //door opened when grandmaster vorpil dies
23+
GO_SCREAMING_HALL_DOOR = 183295, //door opened when grandmaster vorpil dies
24+
25+
SAY_HELLMAW_INTRO = -1555000,
26+
27+
SPELL_BANISH = 30231,
2328
};
2429

2530
class MANGOS_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance

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

sql/scriptdev2_script_full.sql

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5165,18 +5165,6 @@ INSERT INTO script_waypoint VALUES
51655165
(18210, 18, -1324.803589, 8510.688477, 13.050, 0, ''),
51665166
(18210, 19, -1312.075439, 8492.709961, 14.235, 0, '');
51675167

5168-
DELETE FROM script_waypoint WHERE entry=18731;
5169-
INSERT INTO script_waypoint VALUES
5170-
(18731, 0, -157.366, 2.177, 8.073, 0, ''),
5171-
(18731, 1, -172.266, -18.280, 8.073, 0, ''),
5172-
(18731, 2, -171.051, -38.748, 8.073, 0, ''),
5173-
(18731, 3, -170.718, -59.436, 8.073, 0, ''),
5174-
(18731, 4, -156.659, -72.118, 8.073, 0, ''),
5175-
(18731, 5, -142.292, -59.423, 8.073, 0, ''),
5176-
(18731, 6, -141.779, -38.972, 8.073, 0, ''),
5177-
(18731, 7, -142.922, -18.950, 8.073, 0, ''),
5178-
(18731, 8, -157.366, 2.177, 8.073, 0, '');
5179-
51805168
DELETE FROM script_waypoint WHERE entry=18887;
51815169
INSERT INTO script_waypoint VALUES
51825170
(18887, 0, 2650.06, 665.473, 61.9305, 0, ''),

sql/updates/r2254_scriptdev2.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DELETE FROM script_waypoint WHERE entry=18731;

0 commit comments

Comments
 (0)