Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_ambassador_hellmaw.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
/* ScriptData
7
SDName: Boss_Ambassador_Hellmaw
8
SD%Complete: 80
9
SDComment: Enrage spell missing/not known
10
SDCategory: Auchindoun, Shadow Labyrinth
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
ScriptedEscortAI.h
"
16
#include "
shadow_labyrinth.h
"
17
18
enum
Yells
19
{
20
SAY_INTRO
= 0,
21
SAY_AGGRO
= 1,
22
SAY_HELP
= 2,
23
SAY_SLAY
= 3,
24
SAY_DEATH
= 4
25
};
26
27
enum
Spells
28
{
29
SPELL_BANISH
= 30231,
30
SPELL_CORROSIVE_ACID
= 33551,
31
SPELL_FEAR
= 33547,
32
SPELL_ENRAGE
= 34970
33
};
34
35
enum
Events
36
{
37
EVENT_CORROSIVE_ACID
= 1,
38
EVENT_FEAR
,
39
EVENT_BERSERK
40
};
41
42
class
boss_ambassador_hellmaw
:
public
CreatureScript
43
{
44
public
:
45
boss_ambassador_hellmaw
() :
CreatureScript
(
"boss_ambassador_hellmaw"
) { }
46
47
struct
boss_ambassador_hellmawAI
:
public
npc_escortAI
48
{
49
boss_ambassador_hellmawAI
(
Creature
* creature) :
npc_escortAI
(creature)
50
{
51
_instance
= creature->
GetInstanceScript
();
52
_intro
=
false
;
53
}
54
55
void
Reset
()
OVERRIDE
56
{
57
if
(!
me
->IsAlive())
58
return
;
59
60
_events
.Reset();
61
_instance
->SetBossState(
DATA_AMBASSADOR_HELLMAW
,
NOT_STARTED
);
62
63
_events
.ScheduleEvent(
EVENT_CORROSIVE_ACID
, std::rand() % 10000 + 5000);
64
_events
.ScheduleEvent(
EVENT_FEAR
, std::rand() % 30000 + 25000);
65
if
(
IsHeroic
())
66
_events
.ScheduleEvent(
EVENT_BERSERK
, 180000);
67
68
DoAction
(
ACTION_AMBASSADOR_HELLMAW_BANISH
);
69
}
70
71
void
MoveInLineOfSight
(
Unit
* who)
OVERRIDE
72
{
73
if
(
me
->HasAura(
SPELL_BANISH
))
74
return
;
75
76
npc_escortAI::MoveInLineOfSight
(who);
77
}
78
79
void
WaypointReached
(
uint32
/*waypointId*/
)
OVERRIDE
80
{
81
}
82
83
void
DoAction
(
int32
actionId)
OVERRIDE
84
{
85
if
(actionId ==
ACTION_AMBASSADOR_HELLMAW_INTRO
)
86
DoIntro
();
87
else
if
(actionId ==
ACTION_AMBASSADOR_HELLMAW_BANISH
)
88
{
89
if
(
_instance
->GetData(
DATA_FEL_OVERSEER
) &&
me
->HasAura(
SPELL_BANISH
))
90
DoCast
(
me
,
SPELL_BANISH
,
true
);
// this will not work, because he is immune to banish
91
}
92
}
93
94
void
DoIntro
()
95
{
96
if
(
_intro
)
97
return
;
98
99
_intro
=
true
;
100
101
if
(
me
->HasAura(
SPELL_BANISH
))
102
me
->RemoveAurasDueToSpell(
SPELL_BANISH
);
103
104
Talk
(
SAY_INTRO
);
105
Start
(
true
,
false
, 0, NULL,
false
,
true
);
106
}
107
108
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
109
{
110
_instance
->SetBossState(
DATA_AMBASSADOR_HELLMAW
,
IN_PROGRESS
);
111
Talk
(
SAY_AGGRO
);
112
}
113
114
void
KilledUnit
(
Unit
* who)
OVERRIDE
115
{
116
if
(who->GetTypeId() ==
TypeID::TYPEID_PLAYER
)
117
Talk
(
SAY_SLAY
);
118
}
119
120
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
121
{
122
_instance
->SetBossState(
DATA_AMBASSADOR_HELLMAW
,
DONE
);
123
Talk
(
SAY_DEATH
);
124
}
125
126
void
UpdateEscortAI
(
uint32
const
diff)
OVERRIDE
127
{
128
if
(!
UpdateVictim
())
129
return
;
130
131
if
(
me
->HasAura(
SPELL_BANISH
))
132
{
133
EnterEvadeMode
();
134
return
;
135
}
136
137
_events
.Update(diff);
138
139
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
140
return
;
141
142
while
(
uint32
eventId =
_events
.ExecuteEvent())
143
{
144
switch
(eventId)
145
{
146
case
EVENT_CORROSIVE_ACID
:
147
DoCastVictim
(
SPELL_CORROSIVE_ACID
);
148
_events
.ScheduleEvent(
EVENT_CORROSIVE_ACID
, std::rand() % 25000 + 15000);
149
break
;
150
case
EVENT_FEAR
:
151
DoCastAOE
(
SPELL_FEAR
);
152
_events
.ScheduleEvent(
EVENT_FEAR
, std::rand() % 35000 + 20000);
153
break
;
154
case
EVENT_BERSERK
:
155
DoCast
(
me
,
SPELL_ENRAGE
,
true
);
156
break
;
157
default
:
158
break
;
159
}
160
}
161
162
DoMeleeAttackIfReady
();
163
}
164
165
private
:
166
InstanceScript
*
_instance
;
167
EventMap
_events
;
168
bool
_intro
;
169
};
170
171
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
172
{
173
return
GetShadowLabyrinthAI<boss_ambassador_hellmawAI>
(creature);
174
}
175
};
176
177
void
AddSC_boss_ambassador_hellmaw
()
178
{
179
new
boss_ambassador_hellmaw
();
180
}
Spells
Spells
Definition
BattlegroundIC.h:645
int32
std::int32_t int32
Definition
Define.h:73
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
IN_PROGRESS
@ IN_PROGRESS
Definition
InstanceScript.h:47
DONE
@ DONE
Definition
InstanceScript.h:49
NOT_STARTED
@ NOT_STARTED
Definition
InstanceScript.h:46
TypeID::TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
Object.h:55
ScriptMgr.h
ScriptedCreature.h
ScriptedEscortAI.h
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
alterac_valley.cpp:14
Events
Events
Definition
alterac_valley.cpp:40
SAY_SLAY
@ SAY_SLAY
Definition
boss_alizabal.cpp:20
SAY_INTRO
@ SAY_INTRO
Definition
boss_alizabal.cpp:14
SAY_DEATH
@ SAY_DEATH
Definition
boss_ambassador_hellmaw.cpp:24
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_ambassador_hellmaw.cpp:21
SAY_SLAY
@ SAY_SLAY
Definition
boss_ambassador_hellmaw.cpp:23
SAY_INTRO
@ SAY_INTRO
Definition
boss_ambassador_hellmaw.cpp:20
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
boss_ambassador_hellmaw.cpp:32
SPELL_FEAR
@ SPELL_FEAR
Definition
boss_ambassador_hellmaw.cpp:31
SPELL_BANISH
@ SPELL_BANISH
Definition
boss_ambassador_hellmaw.cpp:29
SPELL_CORROSIVE_ACID
@ SPELL_CORROSIVE_ACID
Definition
boss_ambassador_hellmaw.cpp:30
AddSC_boss_ambassador_hellmaw
void AddSC_boss_ambassador_hellmaw()
Definition
boss_ambassador_hellmaw.cpp:177
EVENT_BERSERK
@ EVENT_BERSERK
Definition
boss_ambassador_hellmaw.cpp:39
EVENT_FEAR
@ EVENT_FEAR
Definition
boss_ambassador_hellmaw.cpp:38
EVENT_CORROSIVE_ACID
@ EVENT_CORROSIVE_ACID
Definition
boss_ambassador_hellmaw.cpp:37
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SPELL_CORROSIVE_ACID
@ SPELL_CORROSIVE_ACID
Definition
boss_gyth.cpp:13
EVENT_CORROSIVE_ACID
@ EVENT_CORROSIVE_ACID
Definition
boss_gyth.cpp:29
SPELL_BANISH
@ SPELL_BANISH
Definition
boss_kalecgos.cpp:51
SPELL_FEAR
@ SPELL_FEAR
Definition
boss_nefarian.cpp:106
EVENT_FEAR
@ EVENT_FEAR
Definition
boss_nefarian.cpp:17
EVENT_BERSERK
@ EVENT_BERSERK
Definition
boss_occuthar.cpp:31
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
EventMap
Definition
CreatureAIImpl.h:304
InstanceScript
Definition
InstanceScript.h:123
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
UnitAI::DoCastAOE
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:176
Unit
Definition
Unit.h:1367
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
boss_ambassador_hellmaw
Definition
boss_ambassador_hellmaw.cpp:43
boss_ambassador_hellmaw::boss_ambassador_hellmaw
boss_ambassador_hellmaw()
Definition
boss_ambassador_hellmaw.cpp:45
boss_ambassador_hellmaw::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:171
shadow_labyrinth.h
GetShadowLabyrinthAI
AI * GetShadowLabyrinthAI(Creature *creature)
Definition
shadow_labyrinth.h:45
ACTION_AMBASSADOR_HELLMAW_BANISH
@ ACTION_AMBASSADOR_HELLMAW_BANISH
Definition
shadow_labyrinth.h:41
ACTION_AMBASSADOR_HELLMAW_INTRO
@ ACTION_AMBASSADOR_HELLMAW_INTRO
Definition
shadow_labyrinth.h:40
DATA_AMBASSADOR_HELLMAW
@ DATA_AMBASSADOR_HELLMAW
Definition
shadow_labyrinth.h:16
DATA_FEL_OVERSEER
@ DATA_FEL_OVERSEER
Definition
shadow_labyrinth.h:22
ScriptedAI::IsHeroic
bool IsHeroic() const
Definition
ScriptedCreature.h:279
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
Yells
Definition
boss_illidan.cpp:256
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:108
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::WaypointReached
void WaypointReached(uint32) OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:79
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::UpdateEscortAI
void UpdateEscortAI(uint32 const diff) OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:126
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::_instance
InstanceScript * _instance
Definition
boss_ambassador_hellmaw.cpp:166
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:120
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::boss_ambassador_hellmawAI
boss_ambassador_hellmawAI(Creature *creature)
Definition
boss_ambassador_hellmaw.cpp:49
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *who) OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:71
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::DoIntro
void DoIntro()
Definition
boss_ambassador_hellmaw.cpp:94
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::Reset
void Reset() OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:55
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::DoAction
void DoAction(int32 actionId) OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:83
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::_intro
bool _intro
Definition
boss_ambassador_hellmaw.cpp:168
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::KilledUnit
void KilledUnit(Unit *who) OVERRIDE
Definition
boss_ambassador_hellmaw.cpp:114
boss_ambassador_hellmaw::boss_ambassador_hellmawAI::_events
EventMap _events
Definition
boss_ambassador_hellmaw.cpp:167
npc_escortAI::EnterEvadeMode
void EnterEvadeMode() OVERRIDE
Definition
ScriptedEscortAI.cpp:169
npc_escortAI::npc_escortAI
npc_escortAI(Creature *creature)
Definition
ScriptedEscortAI.cpp:24
npc_escortAI::Start
void Start(bool isActiveAttacker=true, bool run=false, uint64 playerGUID=0, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition
ScriptedEscortAI.cpp:420
npc_escortAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *who) OVERRIDE
Definition
ScriptedEscortAI.cpp:94
SAY_HELP
@ SAY_HELP
Definition
zone_azuremyst_isle.cpp:39
src
server
scripts
Outland
Auchindoun
ShadowLabyrinth
boss_ambassador_hellmaw.cpp
Generated on
for Project SkyFire Core by
1.17.0