Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_cannon_master_willey.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_cannon_master_willey
8
SD%Complete: 100
9
SDComment:
10
SDCategory: Stratholme
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
16
//front, left
17
#define ADD_1X 3553.851807f
18
#define ADD_1Y -2945.885986f
19
#define ADD_1Z 125.001015f
20
#define ADD_1O 0.592007f
21
//front, right
22
#define ADD_2X 3559.206299f
23
#define ADD_2Y -2952.929932f
24
#define ADD_2Z 125.001015f
25
#define ADD_2O 0.592007f
26
//mid, left
27
#define ADD_3X 3552.417480f
28
#define ADD_3Y -2948.667236f
29
#define ADD_3Z 125.001015f
30
#define ADD_3O 0.592007f
31
//mid, right
32
#define ADD_4X 3555.651855f
33
#define ADD_4Y -2953.519043f
34
#define ADD_4Z 125.001015f
35
#define ADD_4O 0.592007f
36
//back, left
37
#define ADD_5X 3547.927246f
38
#define ADD_5Y -2950.977295f
39
#define ADD_5Z 125.001015f
40
#define ADD_5O 0.592007f
41
//back, mid
42
#define ADD_6X 3553.094697f
43
#define ADD_6Y -2952.123291f
44
#define ADD_6Z 125.001015f
45
#define ADD_6O 0.592007f
46
//back, right
47
#define ADD_7X 3552.727539f
48
#define ADD_7Y -2957.776123f
49
#define ADD_7Z 125.001015f
50
#define ADD_7O 0.592007f
51
//behind, left
52
#define ADD_8X 3547.156250f
53
#define ADD_8Y -2953.162354f
54
#define ADD_8Z 125.001015f
55
#define ADD_8O 0.592007f
56
//behind, right
57
#define ADD_9X 3550.202148f
58
#define ADD_9Y -2957.437744f
59
#define ADD_9Z 125.001015f
60
#define ADD_9O 0.592007f
61
62
enum
Spells
63
{
64
SPELL_KNOCKAWAY
= 10101,
65
SPELL_PUMMEL
= 15615,
66
SPELL_SHOOT
= 16496
67
//SPELL_SUMMONCRIMSONRIFLEMAN = 17279
68
};
69
70
class
boss_cannon_master_willey
:
public
CreatureScript
71
{
72
public
:
73
boss_cannon_master_willey
() :
CreatureScript
(
"boss_cannon_master_willey"
) { }
74
75
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
76
{
77
return
new
boss_cannon_master_willeyAI
(creature);
78
}
79
80
struct
boss_cannon_master_willeyAI
:
public
ScriptedAI
81
{
82
boss_cannon_master_willeyAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
83
84
uint32
KnockAway_Timer
;
85
uint32
Pummel_Timer
;
86
uint32
Shoot_Timer
;
87
uint32
SummonRifleman_Timer
;
88
89
void
Reset
()
OVERRIDE
90
{
91
Shoot_Timer
= 1000;
92
Pummel_Timer
= 7000;
93
KnockAway_Timer
= 11000;
94
SummonRifleman_Timer
= 15000;
95
}
96
97
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
98
{
99
me
->SummonCreature(11054,
ADD_1X
,
ADD_1Y
,
ADD_1Z
,
ADD_1O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
100
me
->SummonCreature(11054,
ADD_2X
,
ADD_2Y
,
ADD_2Z
,
ADD_2O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
101
me
->SummonCreature(11054,
ADD_3X
,
ADD_3Y
,
ADD_3Z
,
ADD_3O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
102
me
->SummonCreature(11054,
ADD_4X
,
ADD_4Y
,
ADD_4Z
,
ADD_4O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
103
me
->SummonCreature(11054,
ADD_5X
,
ADD_5Y
,
ADD_5Z
,
ADD_5O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
104
me
->SummonCreature(11054,
ADD_7X
,
ADD_7Y
,
ADD_7Z
,
ADD_7O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
105
me
->SummonCreature(11054,
ADD_9X
,
ADD_9Y
,
ADD_9Z
,
ADD_9O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
106
}
107
108
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
109
{
110
}
111
112
void
UpdateAI
(
uint32
diff)
OVERRIDE
113
{
114
//Return since we have no target
115
if
(!
UpdateVictim
())
116
return
;
117
118
//Pummel
119
if
(
Pummel_Timer
<= diff)
120
{
121
//Cast
122
if
(rand()%100 < 90)
//90% chance to cast
123
{
124
DoCastVictim
(
SPELL_PUMMEL
);
125
}
126
//12 seconds until we should cast this again
127
Pummel_Timer
= 12000;
128
}
else
Pummel_Timer
-= diff;
129
130
//KnockAway
131
if
(
KnockAway_Timer
<= diff)
132
{
133
//Cast
134
if
(rand()%100 < 80)
//80% chance to cast
135
{
136
DoCastVictim
(
SPELL_KNOCKAWAY
);
137
}
138
//14 seconds until we should cast this again
139
KnockAway_Timer
= 14000;
140
}
else
KnockAway_Timer
-= diff;
141
142
//Shoot
143
if
(
Shoot_Timer
<= diff)
144
{
145
//Cast
146
DoCastVictim
(
SPELL_SHOOT
);
147
//1 seconds until we should cast this again
148
Shoot_Timer
= 1000;
149
}
else
Shoot_Timer
-= diff;
150
151
//SummonRifleman
152
if
(
SummonRifleman_Timer
<= diff)
153
{
154
//Cast
155
switch
(rand()%9)
156
{
157
case
0:
158
me
->SummonCreature(11054,
ADD_1X
,
ADD_1Y
,
ADD_1Z
,
ADD_1O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
159
me
->SummonCreature(11054,
ADD_2X
,
ADD_2Y
,
ADD_2Z
,
ADD_2O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
160
me
->SummonCreature(11054,
ADD_4X
,
ADD_4Y
,
ADD_4Z
,
ADD_4O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
161
break
;
162
case
1:
163
me
->SummonCreature(11054,
ADD_2X
,
ADD_2Y
,
ADD_2Z
,
ADD_2O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
164
me
->SummonCreature(11054,
ADD_3X
,
ADD_3Y
,
ADD_3Z
,
ADD_3O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
165
me
->SummonCreature(11054,
ADD_5X
,
ADD_5Y
,
ADD_5Z
,
ADD_5O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
166
break
;
167
case
2:
168
me
->SummonCreature(11054,
ADD_3X
,
ADD_3Y
,
ADD_3Z
,
ADD_3O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
169
me
->SummonCreature(11054,
ADD_4X
,
ADD_4Y
,
ADD_4Z
,
ADD_4O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
170
me
->SummonCreature(11054,
ADD_6X
,
ADD_6Y
,
ADD_6Z
,
ADD_6O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
171
break
;
172
case
3:
173
me
->SummonCreature(11054,
ADD_4X
,
ADD_4Y
,
ADD_4Z
,
ADD_4O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
174
me
->SummonCreature(11054,
ADD_5X
,
ADD_5Y
,
ADD_5Z
,
ADD_5O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
175
me
->SummonCreature(11054,
ADD_7X
,
ADD_7Y
,
ADD_7Z
,
ADD_7O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
176
break
;
177
case
4:
178
me
->SummonCreature(11054,
ADD_5X
,
ADD_5Y
,
ADD_5Z
,
ADD_5O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
179
me
->SummonCreature(11054,
ADD_6X
,
ADD_6Y
,
ADD_6Z
,
ADD_6O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
180
me
->SummonCreature(11054,
ADD_8X
,
ADD_8Y
,
ADD_8Z
,
ADD_8O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
181
break
;
182
case
5:
183
me
->SummonCreature(11054,
ADD_6X
,
ADD_6Y
,
ADD_6Z
,
ADD_6O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
184
me
->SummonCreature(11054,
ADD_7X
,
ADD_7Y
,
ADD_7Z
,
ADD_7O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
185
me
->SummonCreature(11054,
ADD_9X
,
ADD_9Y
,
ADD_9Z
,
ADD_9O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
186
break
;
187
case
6:
188
me
->SummonCreature(11054,
ADD_7X
,
ADD_7Y
,
ADD_7Z
,
ADD_7O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
189
me
->SummonCreature(11054,
ADD_8X
,
ADD_8Y
,
ADD_8Z
,
ADD_8O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
190
me
->SummonCreature(11054,
ADD_1X
,
ADD_1Y
,
ADD_1Z
,
ADD_1O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
191
break
;
192
case
7:
193
me
->SummonCreature(11054,
ADD_8X
,
ADD_8Y
,
ADD_8Z
,
ADD_8O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
194
me
->SummonCreature(11054,
ADD_9X
,
ADD_9Y
,
ADD_9Z
,
ADD_9O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
195
me
->SummonCreature(11054,
ADD_2X
,
ADD_2Y
,
ADD_2Z
,
ADD_2O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
196
break
;
197
case
8:
198
me
->SummonCreature(11054,
ADD_9X
,
ADD_9Y
,
ADD_9Z
,
ADD_9O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
199
me
->SummonCreature(11054,
ADD_1X
,
ADD_1Y
,
ADD_1Z
,
ADD_1O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
200
me
->SummonCreature(11054,
ADD_3X
,
ADD_3Y
,
ADD_3Z
,
ADD_3O
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 240000);
201
break
;
202
}
203
//30 seconds until we should cast this again
204
SummonRifleman_Timer
= 30000;
205
}
else
SummonRifleman_Timer
-= diff;
206
207
DoMeleeAttackIfReady
();
208
}
209
};
210
};
211
212
void
AddSC_boss_cannon_master_willey
()
213
{
214
new
boss_cannon_master_willey
();
215
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
Definition
Object.h:70
ScriptMgr.h
ScriptedCreature.h
ADD_6O
#define ADD_6O
Definition
boss_cannon_master_willey.cpp:45
ADD_3X
#define ADD_3X
Definition
boss_cannon_master_willey.cpp:27
ADD_7Z
#define ADD_7Z
Definition
boss_cannon_master_willey.cpp:49
ADD_7O
#define ADD_7O
Definition
boss_cannon_master_willey.cpp:50
ADD_9Y
#define ADD_9Y
Definition
boss_cannon_master_willey.cpp:58
ADD_1Z
#define ADD_1Z
Definition
boss_cannon_master_willey.cpp:19
ADD_3Z
#define ADD_3Z
Definition
boss_cannon_master_willey.cpp:29
ADD_7Y
#define ADD_7Y
Definition
boss_cannon_master_willey.cpp:48
ADD_8Y
#define ADD_8Y
Definition
boss_cannon_master_willey.cpp:53
ADD_5Z
#define ADD_5Z
Definition
boss_cannon_master_willey.cpp:39
ADD_6Z
#define ADD_6Z
Definition
boss_cannon_master_willey.cpp:44
ADD_9O
#define ADD_9O
Definition
boss_cannon_master_willey.cpp:60
ADD_8Z
#define ADD_8Z
Definition
boss_cannon_master_willey.cpp:54
ADD_8X
#define ADD_8X
Definition
boss_cannon_master_willey.cpp:52
SPELL_SHOOT
@ SPELL_SHOOT
Definition
boss_cannon_master_willey.cpp:66
SPELL_PUMMEL
@ SPELL_PUMMEL
Definition
boss_cannon_master_willey.cpp:65
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_cannon_master_willey.cpp:64
ADD_5Y
#define ADD_5Y
Definition
boss_cannon_master_willey.cpp:38
ADD_2O
#define ADD_2O
Definition
boss_cannon_master_willey.cpp:25
ADD_2Y
#define ADD_2Y
Definition
boss_cannon_master_willey.cpp:23
ADD_1Y
#define ADD_1Y
Definition
boss_cannon_master_willey.cpp:18
ADD_7X
#define ADD_7X
Definition
boss_cannon_master_willey.cpp:47
ADD_9Z
#define ADD_9Z
Definition
boss_cannon_master_willey.cpp:59
ADD_1O
#define ADD_1O
Definition
boss_cannon_master_willey.cpp:20
ADD_3Y
#define ADD_3Y
Definition
boss_cannon_master_willey.cpp:28
ADD_9X
#define ADD_9X
Definition
boss_cannon_master_willey.cpp:57
ADD_6X
#define ADD_6X
Definition
boss_cannon_master_willey.cpp:42
ADD_4Z
#define ADD_4Z
Definition
boss_cannon_master_willey.cpp:34
ADD_2Z
#define ADD_2Z
Definition
boss_cannon_master_willey.cpp:24
ADD_8O
#define ADD_8O
Definition
boss_cannon_master_willey.cpp:55
ADD_4Y
#define ADD_4Y
Definition
boss_cannon_master_willey.cpp:33
ADD_4X
#define ADD_4X
Definition
boss_cannon_master_willey.cpp:32
ADD_4O
#define ADD_4O
Definition
boss_cannon_master_willey.cpp:35
AddSC_boss_cannon_master_willey
void AddSC_boss_cannon_master_willey()
Definition
boss_cannon_master_willey.cpp:212
ADD_1X
#define ADD_1X
Definition
boss_cannon_master_willey.cpp:17
ADD_5O
#define ADD_5O
Definition
boss_cannon_master_willey.cpp:40
ADD_6Y
#define ADD_6Y
Definition
boss_cannon_master_willey.cpp:43
ADD_3O
#define ADD_3O
Definition
boss_cannon_master_willey.cpp:30
ADD_5X
#define ADD_5X
Definition
boss_cannon_master_willey.cpp:37
ADD_2X
#define ADD_2X
Definition
boss_cannon_master_willey.cpp:22
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_overlord_wyrmthalak.cpp:15
SPELL_SHOOT
@ SPELL_SHOOT
Definition
boss_quartermaster_zigris.cpp:12
SPELL_PUMMEL
@ SPELL_PUMMEL
Definition
boss_warmaster_voone.cpp:16
CreatureAI
Definition
CreatureAI.h:54
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::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
boss_cannon_master_willey
Definition
boss_cannon_master_willey.cpp:71
boss_cannon_master_willey::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_cannon_master_willey.cpp:75
boss_cannon_master_willey::boss_cannon_master_willey
boss_cannon_master_willey()
Definition
boss_cannon_master_willey.cpp:73
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_cannon_master_willey::boss_cannon_master_willeyAI
Definition
boss_cannon_master_willey.cpp:81
boss_cannon_master_willey::boss_cannon_master_willeyAI::SummonRifleman_Timer
uint32 SummonRifleman_Timer
Definition
boss_cannon_master_willey.cpp:87
boss_cannon_master_willey::boss_cannon_master_willeyAI::Shoot_Timer
uint32 Shoot_Timer
Definition
boss_cannon_master_willey.cpp:86
boss_cannon_master_willey::boss_cannon_master_willeyAI::Reset
void Reset() OVERRIDE
Definition
boss_cannon_master_willey.cpp:89
boss_cannon_master_willey::boss_cannon_master_willeyAI::Pummel_Timer
uint32 Pummel_Timer
Definition
boss_cannon_master_willey.cpp:85
boss_cannon_master_willey::boss_cannon_master_willeyAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_cannon_master_willey.cpp:108
boss_cannon_master_willey::boss_cannon_master_willeyAI::KnockAway_Timer
uint32 KnockAway_Timer
Definition
boss_cannon_master_willey.cpp:84
boss_cannon_master_willey::boss_cannon_master_willeyAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_cannon_master_willey.cpp:97
boss_cannon_master_willey::boss_cannon_master_willeyAI::boss_cannon_master_willeyAI
boss_cannon_master_willeyAI(Creature *creature)
Definition
boss_cannon_master_willey.cpp:82
boss_cannon_master_willey::boss_cannon_master_willeyAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_cannon_master_willey.cpp:112
src
server
scripts
EasternKingdoms
Stratholme
boss_cannon_master_willey.cpp
Generated on
for Project SkyFire Core by
1.17.0