Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_pathaleon_the_calculator.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 Pathaleon the Calculator
8
SD%Complete: 50
9
SDComment: Event missing. Script for himself 99% blizzlike.
10
SDCategory: Tempest Keep, The Mechanar
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
mechanar.h
"
16
17
enum
Says
18
{
19
SAY_AGGRO
= 0,
20
SAY_CHARM
= 1,
21
SAY_SUMMON
= 2,
22
SAY_ENRAGE
= 3,
23
SAY_SLAY
= 4,
24
SAY_DEATH
= 5
25
};
26
27
enum
Spells
28
{
29
SPELL_MANA_TAP
= 36021,
30
SPELL_ARCANE_TORRENT
= 36022,
31
SPELL_DOMINATION
= 35280,
32
H_SPELL_ARCANE_EXPLOSION
= 15453,
33
SPELL_FRENZY
= 36992,
34
SPELL_SUMMON_NETHER_WRAITH_1
= 35285,
// Not scripted
35
SPELL_SUMMON_NETHER_WRAITH_2
= 35286,
// Not scripted
36
SPELL_SUMMON_NETHER_WRAITH_3
= 35287,
// Not scripted
37
SPELL_SUMMON_NETHER_WRAITH_4
= 35288,
// Not scripted
38
SPELL_DETONATION
= 35058,
// Used by Nether Wraith
39
SPELL_ARCANE_MISSILES
= 35034
// Used by Nether Wraith
40
};
41
42
enum
Events
43
{
44
EVENT_SUMMON
= 1,
45
EVENT_MANA_TAP
= 2,
46
EVENT_ARCANE_TORRENT
= 3,
47
EVENT_DOMINATION
= 4,
48
EVENT_ARCANE_EXPLOSION
= 5
49
};
50
51
enum
Creatures
52
{
53
NPC_NETHER_WRAITH
= 21062
54
};
55
56
class
boss_pathaleon_the_calculator
:
public
CreatureScript
57
{
58
public
:
59
boss_pathaleon_the_calculator
():
CreatureScript
(
"boss_pathaleon_the_calculator"
) { }
60
61
struct
boss_pathaleon_the_calculatorAI
:
public
BossAI
62
{
63
boss_pathaleon_the_calculatorAI
(
Creature
* creature) :
BossAI
(creature,
DATA_PATHALEON_THE_CALCULATOR
) { }
64
65
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
66
{
67
_EnterCombat
();
68
events
.ScheduleEvent(
EVENT_SUMMON
, 30000);
69
events
.ScheduleEvent(
EVENT_MANA_TAP
, std::rand() % 20000 + 12000);
70
events
.ScheduleEvent(
EVENT_ARCANE_TORRENT
, std::rand() % 25000 + 16000);
71
events
.ScheduleEvent(
EVENT_DOMINATION
, std::rand() % 40000 + 25000);
72
events
.ScheduleEvent(
EVENT_ARCANE_EXPLOSION
, std::rand() % 13000 + 8000);
73
Talk
(
SAY_AGGRO
);
74
}
75
76
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
77
{
78
Talk
(
SAY_SLAY
);
79
}
80
81
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
82
{
83
_JustDied
();
84
Talk
(
SAY_DEATH
);
85
}
86
87
void
DamageTaken
(
Unit
*
/*attacker*/
,
uint32
& damage)
OVERRIDE
88
{
89
if
(
me
->HealthBelowPctDamaged(20, damage) && !
me
->HasAura(
SPELL_FRENZY
))
90
{
91
DoCast
(
me
,
SPELL_FRENZY
);
92
Talk
(
SAY_ENRAGE
);
93
}
94
}
95
96
void
UpdateAI
(
uint32
diff)
OVERRIDE
97
{
98
if
(!
UpdateVictim
())
99
return
;
100
101
events
.Update(diff);
102
103
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
104
return
;
105
106
while
(
uint32
eventId =
events
.ExecuteEvent())
107
{
108
switch
(eventId)
109
{
110
case
EVENT_SUMMON
:
111
for
(
uint8
i = 0; i < 3; ++i)
112
{
113
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
114
{
115
if
(
Creature
* Wraith =
me
->SummonCreature(
NPC_NETHER_WRAITH
,
me
->GetPositionX(),
me
->GetPositionY(),
me
->GetPositionZ(), 0,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
, 25000))
116
Wraith->AI()->AttackStart(target);
117
}
118
}
119
Talk
(
SAY_SUMMON
);
120
events
.ScheduleEvent(
EVENT_SUMMON
, std::rand() % 45000 + 30000);
121
break
;
122
case
EVENT_MANA_TAP
:
123
DoCastVictim
(
SPELL_MANA_TAP
,
true
);
124
events
.ScheduleEvent(
EVENT_MANA_TAP
, std::rand() % 22000 + 14000);
125
break
;
126
case
EVENT_ARCANE_TORRENT
:
127
DoCastVictim
(
SPELL_ARCANE_TORRENT
,
true
);
128
events
.ScheduleEvent(
EVENT_ARCANE_TORRENT
, std::rand() % 18000 + 12000);
129
break
;
130
case
EVENT_DOMINATION
:
131
Talk
(
SAY_CHARM
);
132
DoCastVictim
(
SPELL_DOMINATION
,
true
);
133
events
.ScheduleEvent(
EVENT_DOMINATION
, std::rand() % 30000 + 25000);
134
break
;
135
case
EVENT_ARCANE_EXPLOSION
:
// Heroic only
136
DoCastVictim
(
H_SPELL_ARCANE_EXPLOSION
,
true
);
137
events
.ScheduleEvent(
EVENT_ARCANE_EXPLOSION
, std::rand() % 14000 + 10000);
138
break
;
139
default
:
140
break
;
141
}
142
}
143
144
DoMeleeAttackIfReady
();
145
}
146
};
147
148
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
149
{
150
return
new
boss_pathaleon_the_calculatorAI
(creature);
151
}
152
};
153
154
class
npc_nether_wraith
:
public
CreatureScript
155
{
156
public
:
157
npc_nether_wraith
() :
CreatureScript
(
"npc_nether_wraith"
) { }
158
159
struct
npc_nether_wraithAI
:
public
ScriptedAI
160
{
161
npc_nether_wraithAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
162
163
uint32
ArcaneMissiles_Timer
;
164
uint32
Detonation_Timer
;
165
uint32
Die_Timer
;
166
bool
Detonation
;
167
168
void
Reset
()
OVERRIDE
169
{
170
ArcaneMissiles_Timer
= std::rand() % 4000 + 1000;
171
Detonation_Timer
= 20000;
172
Die_Timer
= 2200;
173
Detonation
=
false
;
174
}
175
176
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
177
178
void
UpdateAI
(
uint32
diff)
OVERRIDE
179
{
180
if
(!
UpdateVictim
())
181
return
;
182
183
if
(
ArcaneMissiles_Timer
<= diff)
184
{
185
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 1))
186
DoCast
(target,
SPELL_ARCANE_MISSILES
);
187
else
188
DoCastVictim
(
SPELL_ARCANE_MISSILES
);
189
ArcaneMissiles_Timer
= std::rand() % 10000 + 5000;
190
}
191
else
192
ArcaneMissiles_Timer
-=diff;
193
194
if
(!
Detonation
)
195
{
196
if
(
Detonation_Timer
<= diff)
197
{
198
DoCast
(
me
,
SPELL_DETONATION
);
199
Detonation
=
true
;
200
}
201
else
202
Detonation_Timer
-= diff;
203
}
204
205
if
(
Detonation
)
206
{
207
if
(
Die_Timer
<= diff)
208
{
209
me
->setDeathState(
DeathState::JUST_DIED
);
210
me
->RemoveCorpse();
211
}
212
else
213
Die_Timer
-= diff;
214
}
215
DoMeleeAttackIfReady
();
216
}
217
};
218
219
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
220
{
221
return
new
npc_nether_wraithAI
(creature);
222
}
223
};
224
225
void
AddSC_boss_pathaleon_the_calculator
()
226
{
227
new
boss_pathaleon_the_calculator
();
228
new
npc_nether_wraith
();
229
}
230
Spells
Spells
Definition
BattlegroundIC.h:645
uint8
std::uint8_t uint8
Definition
Define.h:79
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition
Object.h:71
ScriptMgr.h
ScriptedCreature.h
DeathState::JUST_DIED
@ JUST_DIED
Definition
Unit.h:504
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Creatures
Creatures
Definition
alterac_valley.cpp:28
Events
Events
Definition
alterac_valley.cpp:40
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_ENRAGE
@ SAY_ENRAGE
Definition
boss_curator.cpp:21
SPELL_FRENZY
@ SPELL_FRENZY
Definition
boss_drekthar.cpp:14
EVENT_SUMMON
@ EVENT_SUMMON
Definition
boss_gluth.cpp:37
Says
Says
Definition
boss_halycon.cpp:17
SPELL_ARCANE_MISSILES
@ SPELL_ARCANE_MISSILES
Definition
boss_kelthuzad.cpp:87
SAY_DEATH
@ SAY_DEATH
Definition
boss_pathaleon_the_calculator.cpp:24
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_pathaleon_the_calculator.cpp:19
SAY_CHARM
@ SAY_CHARM
Definition
boss_pathaleon_the_calculator.cpp:20
SAY_SLAY
@ SAY_SLAY
Definition
boss_pathaleon_the_calculator.cpp:23
SAY_ENRAGE
@ SAY_ENRAGE
Definition
boss_pathaleon_the_calculator.cpp:22
SAY_SUMMON
@ SAY_SUMMON
Definition
boss_pathaleon_the_calculator.cpp:21
NPC_NETHER_WRAITH
@ NPC_NETHER_WRAITH
Definition
boss_pathaleon_the_calculator.cpp:53
AddSC_boss_pathaleon_the_calculator
void AddSC_boss_pathaleon_the_calculator()
Definition
boss_pathaleon_the_calculator.cpp:225
SPELL_ARCANE_TORRENT
@ SPELL_ARCANE_TORRENT
Definition
boss_pathaleon_the_calculator.cpp:30
SPELL_SUMMON_NETHER_WRAITH_2
@ SPELL_SUMMON_NETHER_WRAITH_2
Definition
boss_pathaleon_the_calculator.cpp:35
SPELL_SUMMON_NETHER_WRAITH_1
@ SPELL_SUMMON_NETHER_WRAITH_1
Definition
boss_pathaleon_the_calculator.cpp:34
SPELL_SUMMON_NETHER_WRAITH_3
@ SPELL_SUMMON_NETHER_WRAITH_3
Definition
boss_pathaleon_the_calculator.cpp:36
SPELL_DETONATION
@ SPELL_DETONATION
Definition
boss_pathaleon_the_calculator.cpp:38
SPELL_MANA_TAP
@ SPELL_MANA_TAP
Definition
boss_pathaleon_the_calculator.cpp:29
H_SPELL_ARCANE_EXPLOSION
@ H_SPELL_ARCANE_EXPLOSION
Definition
boss_pathaleon_the_calculator.cpp:32
SPELL_SUMMON_NETHER_WRAITH_4
@ SPELL_SUMMON_NETHER_WRAITH_4
Definition
boss_pathaleon_the_calculator.cpp:37
SPELL_FRENZY
@ SPELL_FRENZY
Definition
boss_pathaleon_the_calculator.cpp:33
SPELL_ARCANE_MISSILES
@ SPELL_ARCANE_MISSILES
Definition
boss_pathaleon_the_calculator.cpp:39
SPELL_DOMINATION
@ SPELL_DOMINATION
Definition
boss_pathaleon_the_calculator.cpp:31
EVENT_DOMINATION
@ EVENT_DOMINATION
Definition
boss_pathaleon_the_calculator.cpp:47
EVENT_MANA_TAP
@ EVENT_MANA_TAP
Definition
boss_pathaleon_the_calculator.cpp:45
EVENT_ARCANE_TORRENT
@ EVENT_ARCANE_TORRENT
Definition
boss_pathaleon_the_calculator.cpp:46
EVENT_ARCANE_EXPLOSION
@ EVENT_ARCANE_EXPLOSION
Definition
boss_pathaleon_the_calculator.cpp:48
EVENT_SUMMON
@ EVENT_SUMMON
Definition
boss_pathaleon_the_calculator.cpp:44
EVENT_ARCANE_EXPLOSION
@ EVENT_ARCANE_EXPLOSION
Definition
boss_shazzrah.cpp:28
SPELL_DOMINATION
@ SPELL_DOMINATION
Definition
boss_the_maker.cpp:29
SAY_SUMMON
@ SAY_SUMMON
Definition
boss_urok_doomhowl.cpp:19
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
BossAI::_JustDied
void _JustDied()
Definition
ScriptedCreature.cpp:474
BossAI::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
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
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
boss_pathaleon_the_calculator
Definition
boss_pathaleon_the_calculator.cpp:57
boss_pathaleon_the_calculator::boss_pathaleon_the_calculator
boss_pathaleon_the_calculator()
Definition
boss_pathaleon_the_calculator.cpp:59
boss_pathaleon_the_calculator::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_pathaleon_the_calculator.cpp:148
npc_nether_wraith
Definition
boss_pathaleon_the_calculator.cpp:155
npc_nether_wraith::npc_nether_wraith
npc_nether_wraith()
Definition
boss_pathaleon_the_calculator.cpp:157
npc_nether_wraith::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_pathaleon_the_calculator.cpp:219
mechanar.h
DATA_PATHALEON_THE_CALCULATOR
@ DATA_PATHALEON_THE_CALCULATOR
Definition
mechanar.h:17
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_pathaleon_the_calculator::boss_pathaleon_the_calculatorAI
Definition
boss_pathaleon_the_calculator.cpp:62
boss_pathaleon_the_calculator::boss_pathaleon_the_calculatorAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_pathaleon_the_calculator.cpp:81
boss_pathaleon_the_calculator::boss_pathaleon_the_calculatorAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_pathaleon_the_calculator.cpp:76
boss_pathaleon_the_calculator::boss_pathaleon_the_calculatorAI::DamageTaken
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
Definition
boss_pathaleon_the_calculator.cpp:87
boss_pathaleon_the_calculator::boss_pathaleon_the_calculatorAI::boss_pathaleon_the_calculatorAI
boss_pathaleon_the_calculatorAI(Creature *creature)
Definition
boss_pathaleon_the_calculator.cpp:63
boss_pathaleon_the_calculator::boss_pathaleon_the_calculatorAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_pathaleon_the_calculator.cpp:65
boss_pathaleon_the_calculator::boss_pathaleon_the_calculatorAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_pathaleon_the_calculator.cpp:96
npc_nether_wraith::npc_nether_wraithAI
Definition
boss_pathaleon_the_calculator.cpp:160
npc_nether_wraith::npc_nether_wraithAI::Detonation
bool Detonation
Definition
boss_pathaleon_the_calculator.cpp:166
npc_nether_wraith::npc_nether_wraithAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_pathaleon_the_calculator.cpp:176
npc_nether_wraith::npc_nether_wraithAI::npc_nether_wraithAI
npc_nether_wraithAI(Creature *creature)
Definition
boss_pathaleon_the_calculator.cpp:161
npc_nether_wraith::npc_nether_wraithAI::ArcaneMissiles_Timer
uint32 ArcaneMissiles_Timer
Definition
boss_pathaleon_the_calculator.cpp:163
npc_nether_wraith::npc_nether_wraithAI::Reset
void Reset() OVERRIDE
Definition
boss_pathaleon_the_calculator.cpp:168
npc_nether_wraith::npc_nether_wraithAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_pathaleon_the_calculator.cpp:178
npc_nether_wraith::npc_nether_wraithAI::Die_Timer
uint32 Die_Timer
Definition
boss_pathaleon_the_calculator.cpp:165
npc_nether_wraith::npc_nether_wraithAI::Detonation_Timer
uint32 Detonation_Timer
Definition
boss_pathaleon_the_calculator.cpp:164
H_SPELL_ARCANE_EXPLOSION
@ H_SPELL_ARCANE_EXPLOSION
Definition
violet_hold.cpp:61
src
server
scripts
Outland
TempestKeep
Mechanar
boss_pathaleon_the_calculator.cpp
Generated on
for Project SkyFire Core by
1.17.0