Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_zuramat.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
#include "
ScriptMgr.h
"
7
#include "
ScriptedCreature.h
"
8
#include "
violet_hold.h
"
9
10
enum
Spells
11
{
12
SPELL_SHROUD_OF_DARKNESS
= 54524,
13
H_SPELL_SHROUD_OF_DARKNESS
= 59745,
14
SPELL_SUMMON_VOID_SENTRY
= 54369,
15
SPELL_VOID_SHIFT
= 54361,
16
H_SPELL_VOID_SHIFT
= 59743,
17
18
SPELL_ZURAMAT_ADD_2
= 54342,
19
H_SPELL_ZURAMAT_ADD_2
= 59747
20
};
21
22
enum
Creatures
23
{
24
NPC_VOID_SENTRY
= 29364
25
};
26
27
enum
Yells
28
{
29
SAY_AGGRO
= 0,
30
SAY_SLAY
= 1,
31
SAY_DEATH
= 2,
32
SAY_SPAWN
= 3,
33
SAY_SHIELD
= 4,
34
SAY_WHISPER
= 5
35
};
36
37
enum
Misc
38
{
39
DATA_VOID_DANCE
= 2153
40
};
41
42
class
boss_zuramat
:
public
CreatureScript
43
{
44
public
:
45
boss_zuramat
() :
CreatureScript
(
"boss_zuramat"
) { }
46
47
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
48
{
49
return
new
boss_zuramatAI
(creature);
50
}
51
52
struct
boss_zuramatAI
:
public
ScriptedAI
53
{
54
boss_zuramatAI
(
Creature
* creature) :
ScriptedAI
(creature)
55
{
56
instance
= creature->
GetInstanceScript
();
57
}
58
59
InstanceScript
*
instance
;
60
61
uint32
SpellVoidShiftTimer
;
62
uint32
SpellSummonVoidTimer
;
63
uint32
SpellShroudOfDarknessTimer
;
64
bool
voidDance
;
65
66
void
Reset
()
OVERRIDE
67
{
68
if
(
instance
)
69
{
70
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
71
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
NOT_STARTED
);
72
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
73
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
NOT_STARTED
);
74
}
75
76
SpellShroudOfDarknessTimer
= 22000;
77
SpellVoidShiftTimer
= 15000;
78
SpellSummonVoidTimer
= 12000;
79
voidDance
=
true
;
80
}
81
82
void
AttackStart
(
Unit
* who)
OVERRIDE
83
{
84
if
(
me
->HasFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_IMMUNE_TO_PC
) ||
me
->HasFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NON_ATTACKABLE
))
85
return
;
86
87
if
(
me
->Attack(who,
true
))
88
{
89
me
->AddThreat(who, 0.0f);
90
me
->SetInCombatWith(who);
91
who->SetInCombatWith(
me
);
92
DoStartMovement
(who);
93
}
94
}
95
96
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
97
{
98
Talk
(
SAY_AGGRO
);
99
if
(
instance
)
100
{
101
if
(
GameObject
* pDoor =
instance
->instance->GetGameObject(
instance
->GetData64(
DATA_ZURAMAT_CELL
)))
102
if
(pDoor->GetGoState() ==
GOState::GO_STATE_READY
)
103
{
104
EnterEvadeMode
();
105
return
;
106
}
107
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
108
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
IN_PROGRESS
);
109
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
110
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
IN_PROGRESS
);
111
}
112
}
113
114
void
MoveInLineOfSight
(
Unit
*
/*who*/
)
OVERRIDE
{ }
115
116
117
void
UpdateAI
(
uint32
diff)
OVERRIDE
118
{
119
//Return since we have no target
120
if
(!
UpdateVictim
())
121
return
;
122
123
if
(
SpellSummonVoidTimer
<= diff)
124
{
125
DoCastVictim
(
SPELL_SUMMON_VOID_SENTRY
,
false
);
126
SpellSummonVoidTimer
= 20000;
127
}
else
SpellSummonVoidTimer
-=diff;
128
129
if
(
SpellVoidShiftTimer
<= diff)
130
{
131
if
(
Unit
* unit =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
132
DoCast
(unit,
SPELL_VOID_SHIFT
);
133
SpellVoidShiftTimer
= 20000;
134
}
else
SpellVoidShiftTimer
-=diff;
135
136
if
(
SpellShroudOfDarknessTimer
<= diff)
137
{
138
DoCastVictim
(
SPELL_SHROUD_OF_DARKNESS
);
139
SpellShroudOfDarknessTimer
= 20000;
140
}
else
SpellShroudOfDarknessTimer
-=diff;
141
142
DoMeleeAttackIfReady
();
143
}
144
145
void
SummonedCreatureDies
(
Creature
* summoned,
Unit
*
/*who*/
)
OVERRIDE
146
{
147
if
(summoned->GetEntry() ==
NPC_VOID_SENTRY
)
148
voidDance
=
false
;
149
}
150
151
uint32
GetData
(
uint32
type)
const
OVERRIDE
152
{
153
if
(type ==
DATA_VOID_DANCE
)
154
return
voidDance
? 1 : 0;
155
156
return
0;
157
}
158
159
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
160
{
161
Talk
(
SAY_DEATH
);
162
163
if
(
instance
)
164
{
165
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
166
{
167
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
DONE
);
168
instance
->SetData(
DATA_WAVE_COUNT
, 7);
169
}
170
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
171
{
172
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
DONE
);
173
instance
->SetData(
DATA_WAVE_COUNT
, 13);
174
}
175
}
176
}
177
178
void
KilledUnit
(
Unit
* victim)
OVERRIDE
179
{
180
if
(victim->GetTypeId() !=
TypeID::TYPEID_PLAYER
)
181
return
;
182
183
Talk
(
SAY_SLAY
);
184
}
185
186
void
JustSummoned
(
Creature
* summon)
OVERRIDE
187
{
188
summon->AI()->AttackStart(
me
->GetVictim());
189
summon->AI()->DoCastAOE(
SPELL_ZURAMAT_ADD_2
);
190
summon->SetPhaseMask(17,
true
);
191
}
192
};
193
};
194
195
class
achievement_void_dance
:
public
AchievementCriteriaScript
196
{
197
public
:
198
achievement_void_dance
() :
AchievementCriteriaScript
(
"achievement_void_dance"
) { }
199
200
bool
OnCheck
(
Player
*
/*player*/
,
Unit
* target)
OVERRIDE
201
{
202
if
(!target)
203
return
false
;
204
205
if
(
Creature
* Zuramat = target->
ToCreature
())
206
if
(Zuramat->AI()->GetData(
DATA_VOID_DANCE
))
207
return
true
;
208
209
return
false
;
210
}
211
};
212
213
void
AddSC_boss_zuramat
()
214
{
215
new
boss_zuramat
();
216
new
achievement_void_dance
();
217
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
GOState::GO_STATE_READY
@ GO_STATE_READY
Definition
GameObject.h:577
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
UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_NON_ATTACKABLE
Definition
Unit.h:626
UNIT_FLAG_IMMUNE_TO_PC
@ UNIT_FLAG_IMMUNE_TO_PC
Definition
Unit.h:633
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
UNIT_FIELD_FLAGS
@ UNIT_FIELD_FLAGS
Definition
UpdateFields.h:82
Creatures
Creatures
Definition
alterac_valley.cpp:28
SAY_SLAY
@ SAY_SLAY
Definition
boss_alizabal.cpp:20
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SAY_SPAWN
@ SAY_SPAWN
Definition
boss_majordomo_executus.cpp:23
Misc
Misc
Definition
boss_occuthar.cpp:37
SAY_SHIELD
@ SAY_SHIELD
Definition
boss_temple_guardian_anhuur.cpp:18
NPC_VOID_SENTRY
@ NPC_VOID_SENTRY
Definition
boss_zuramat.cpp:24
DATA_VOID_DANCE
@ DATA_VOID_DANCE
Definition
boss_zuramat.cpp:39
SAY_DEATH
@ SAY_DEATH
Definition
boss_zuramat.cpp:31
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_zuramat.cpp:29
SAY_WHISPER
@ SAY_WHISPER
Definition
boss_zuramat.cpp:34
SAY_SLAY
@ SAY_SLAY
Definition
boss_zuramat.cpp:30
H_SPELL_VOID_SHIFT
@ H_SPELL_VOID_SHIFT
Definition
boss_zuramat.cpp:16
SPELL_ZURAMAT_ADD_2
@ SPELL_ZURAMAT_ADD_2
Definition
boss_zuramat.cpp:18
SPELL_SUMMON_VOID_SENTRY
@ SPELL_SUMMON_VOID_SENTRY
Definition
boss_zuramat.cpp:14
H_SPELL_ZURAMAT_ADD_2
@ H_SPELL_ZURAMAT_ADD_2
Definition
boss_zuramat.cpp:19
SPELL_VOID_SHIFT
@ SPELL_VOID_SHIFT
Definition
boss_zuramat.cpp:15
H_SPELL_SHROUD_OF_DARKNESS
@ H_SPELL_SHROUD_OF_DARKNESS
Definition
boss_zuramat.cpp:13
SPELL_SHROUD_OF_DARKNESS
@ SPELL_SHROUD_OF_DARKNESS
Definition
boss_zuramat.cpp:12
AddSC_boss_zuramat
void AddSC_boss_zuramat()
Definition
boss_zuramat.cpp:213
AchievementCriteriaScript::AchievementCriteriaScript
AchievementCriteriaScript(const char *name)
Definition
ScriptMgr.cpp:1508
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
CreatureAI::EnterEvadeMode
virtual void EnterEvadeMode()
Definition
CreatureAI.cpp:130
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
GameObject
Definition
GameObject.h:629
InstanceScript
Definition
InstanceScript.h:123
Object::ToCreature
Creature * ToCreature()
Definition
Object.h:207
Player
Definition
Player.h:1289
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::SelectTarget
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition
UnitAI.cpp:66
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
achievement_void_dance
Definition
boss_zuramat.cpp:196
achievement_void_dance::achievement_void_dance
achievement_void_dance()
Definition
boss_zuramat.cpp:198
achievement_void_dance::OnCheck
bool OnCheck(Player *, Unit *target) OVERRIDE
Definition
boss_zuramat.cpp:200
boss_zuramat
Definition
boss_zuramat.cpp:43
boss_zuramat::boss_zuramat
boss_zuramat()
Definition
boss_zuramat.cpp:45
boss_zuramat::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_zuramat.cpp:47
DATA_WAVE_COUNT
@ DATA_WAVE_COUNT
Definition
halls_of_reflection.h:26
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
ScriptedAI::DoStartMovement
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
Definition
ScriptedCreature.cpp:135
Yells
Definition
boss_illidan.cpp:256
boss_zuramat::boss_zuramatAI
Definition
boss_zuramat.cpp:53
boss_zuramat::boss_zuramatAI::instance
InstanceScript * instance
Definition
boss_zuramat.cpp:59
boss_zuramat::boss_zuramatAI::KilledUnit
void KilledUnit(Unit *victim) OVERRIDE
Definition
boss_zuramat.cpp:178
boss_zuramat::boss_zuramatAI::voidDance
bool voidDance
Definition
boss_zuramat.cpp:64
boss_zuramat::boss_zuramatAI::SpellVoidShiftTimer
uint32 SpellVoidShiftTimer
Definition
boss_zuramat.cpp:61
boss_zuramat::boss_zuramatAI::SpellSummonVoidTimer
uint32 SpellSummonVoidTimer
Definition
boss_zuramat.cpp:62
boss_zuramat::boss_zuramatAI::SpellShroudOfDarknessTimer
uint32 SpellShroudOfDarknessTimer
Definition
boss_zuramat.cpp:63
boss_zuramat::boss_zuramatAI::boss_zuramatAI
boss_zuramatAI(Creature *creature)
Definition
boss_zuramat.cpp:54
boss_zuramat::boss_zuramatAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *) OVERRIDE
Definition
boss_zuramat.cpp:114
boss_zuramat::boss_zuramatAI::JustSummoned
void JustSummoned(Creature *summon) OVERRIDE
Definition
boss_zuramat.cpp:186
boss_zuramat::boss_zuramatAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_zuramat.cpp:117
boss_zuramat::boss_zuramatAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_zuramat.cpp:96
boss_zuramat::boss_zuramatAI::SummonedCreatureDies
void SummonedCreatureDies(Creature *summoned, Unit *) OVERRIDE
Definition
boss_zuramat.cpp:145
boss_zuramat::boss_zuramatAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_zuramat.cpp:159
boss_zuramat::boss_zuramatAI::GetData
uint32 GetData(uint32 type) const OVERRIDE
Definition
boss_zuramat.cpp:151
boss_zuramat::boss_zuramatAI::Reset
void Reset() OVERRIDE
Definition
boss_zuramat.cpp:66
boss_zuramat::boss_zuramatAI::AttackStart
void AttackStart(Unit *who) OVERRIDE
Definition
boss_zuramat.cpp:82
violet_hold.h
DATA_ZURAMAT_CELL
@ DATA_ZURAMAT_CELL
Definition
violet_hold.h:47
DATA_1ST_BOSS_EVENT
@ DATA_1ST_BOSS_EVENT
Definition
violet_hold.h:11
DATA_2ND_BOSS_EVENT
@ DATA_2ND_BOSS_EVENT
Definition
violet_hold.h:12
src
server
scripts
Northrend
VioletHold
boss_zuramat.cpp
Generated on
for Project SkyFire Core by
1.17.0