Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_anzu.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
/*
7
Name: Boss_Anzu
8
%Complete: 80%
9
Comment:
10
Category: Auchindoun, Sethekk Halls
11
*/
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
sethekk_halls.h
"
16
17
enum
Says
18
{
19
SAY_SUMMON_BROOD
= 0,
20
SAY_SPELL_BOMB
= 1
21
};
22
23
enum
Spells
24
{
25
SPELL_PARALYZING_SCREECH
= 40184,
26
SPELL_SPELL_BOMB
= 40303,
27
SPELL_CYCLONE_OF_FEATHERS
= 40321,
28
SPELL_BANISH_SELF
= 42354,
29
SPELL_FLESH_RIP
= 40199
30
};
31
32
enum
Events
33
{
34
EVENT_PARALYZING_SCREECH
= 1,
35
EVENT_SPELL_BOMB
= 2,
36
EVENT_CYCLONE_OF_FEATHERS
= 3,
37
EVENT_SUMMON
= 4
38
};
39
40
Position
const
PosSummonBrood
[7] =
41
{
42
{ -118.1717f, 284.5299f, 121.2287f, 2.775074f },
43
{ -98.15528f, 293.4469f, 109.2385f, 0.174533f },
44
{ -99.70160f, 270.1699f, 98.27389f, 6.178465f },
45
{ -69.25543f, 303.0768f, 97.84479f, 5.532694f },
46
{ -87.59662f, 263.5181f, 92.70478f, 1.658063f },
47
{ -73.54323f, 276.6267f, 94.25807f, 2.802979f },
48
{ -81.70527f, 280.8776f, 44.58830f, 0.526849f }
49
};
50
51
class
boss_anzu
:
public
CreatureScript
52
{
53
public
:
54
boss_anzu
() :
CreatureScript
(
"boss_anzu"
) { }
55
56
struct
boss_anzuAI
:
public
BossAI
57
{
58
boss_anzuAI
(
Creature
* creature) :
BossAI
(creature,
DATA_ANZU
)
59
{
60
_under33Percent
=
false
;
61
_under66Percent
=
false
;
62
}
63
64
void
Reset
()
OVERRIDE
65
{
66
//_Reset();
67
events
.Reset();
68
_under33Percent
=
false
;
69
_under66Percent
=
false
;
70
}
71
72
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
73
{
74
_EnterCombat
();
75
events
.ScheduleEvent(
EVENT_PARALYZING_SCREECH
, 14000);
76
events
.ScheduleEvent(
EVENT_CYCLONE_OF_FEATHERS
, 5000);
77
}
78
79
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
80
{
81
_JustDied
();
82
}
83
84
void
DamageTaken
(
Unit
*
/*killer*/
,
uint32
& damage)
OVERRIDE
85
{
86
if
(
me
->HealthBelowPctDamaged(33, damage) && !
_under33Percent
)
87
{
88
_under33Percent
=
true
;
89
Talk
(
SAY_SUMMON_BROOD
);
90
events
.ScheduleEvent(
EVENT_SUMMON
, 3000);
91
}
92
93
if
(
me
->HealthBelowPctDamaged(66, damage) && !
_under66Percent
)
94
{
95
_under66Percent
=
true
;
96
Talk
(
SAY_SUMMON_BROOD
);
97
events
.ScheduleEvent(
EVENT_SUMMON
, 3000);
98
}
99
}
100
101
void
UpdateAI
(
uint32
diff)
OVERRIDE
102
{
103
if
(!
UpdateVictim
())
104
return
;
105
106
events
.Update(diff);
107
108
while
(
uint32
eventId =
events
.ExecuteEvent())
109
{
110
switch
(eventId)
111
{
112
case
EVENT_PARALYZING_SCREECH
:
113
{
114
DoCastVictim
(
SPELL_PARALYZING_SCREECH
);
115
events
.ScheduleEvent(
EVENT_PARALYZING_SCREECH
, 26000);
116
break
;
117
}
118
case
EVENT_CYCLONE_OF_FEATHERS
:
119
{
120
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
121
DoCast
(target,
SPELL_CYCLONE_OF_FEATHERS
);
122
events
.ScheduleEvent(
EVENT_CYCLONE_OF_FEATHERS
, 21000);
123
break
;
124
}
125
case
EVENT_SUMMON
:
126
{
127
// TODO: Add pathing for Brood of Anzu
128
for
(
uint8
i = 0; i < 7; i++)
129
me
->SummonCreature(
NPC_BROOD_OF_ANZU
,
PosSummonBrood
[i],
TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
, 46000);
130
131
DoCast
(
me
,
SPELL_BANISH_SELF
);
132
events
.ScheduleEvent(
EVENT_SPELL_BOMB
, 12000);
133
break
;
134
}
135
case
EVENT_SPELL_BOMB
:
136
{
137
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
138
{
139
if
(target->getPowerType() ==
POWER_MANA
)
140
{
141
DoCast
(target,
SPELL_SPELL_BOMB
);
142
Talk
(
SAY_SPELL_BOMB
, target);
143
}
144
}
145
break
;
146
}
147
default
:
148
break
;
149
150
}
151
}
152
153
DoMeleeAttackIfReady
();
154
}
155
156
private
:
157
bool
_under33Percent
;
158
bool
_under66Percent
;
159
};
160
161
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
162
{
163
return
GetSethekkHallsAI<boss_anzuAI>
(creature);
164
}
165
};
166
167
void
AddSC_boss_anzu
()
168
{
169
new
boss_anzu
();
170
}
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
POWER_MANA
@ POWER_MANA
Definition
SharedDefines.h:215
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Events
Events
Definition
alterac_valley.cpp:40
SAY_SUMMON_BROOD
@ SAY_SUMMON_BROOD
Definition
boss_anzu.cpp:19
SAY_SPELL_BOMB
@ SAY_SPELL_BOMB
Definition
boss_anzu.cpp:20
PosSummonBrood
Position const PosSummonBrood[7]
Definition
boss_anzu.cpp:40
SPELL_SPELL_BOMB
@ SPELL_SPELL_BOMB
Definition
boss_anzu.cpp:26
SPELL_BANISH_SELF
@ SPELL_BANISH_SELF
Definition
boss_anzu.cpp:28
SPELL_FLESH_RIP
@ SPELL_FLESH_RIP
Definition
boss_anzu.cpp:29
SPELL_CYCLONE_OF_FEATHERS
@ SPELL_CYCLONE_OF_FEATHERS
Definition
boss_anzu.cpp:27
SPELL_PARALYZING_SCREECH
@ SPELL_PARALYZING_SCREECH
Definition
boss_anzu.cpp:25
AddSC_boss_anzu
void AddSC_boss_anzu()
Definition
boss_anzu.cpp:167
EVENT_CYCLONE_OF_FEATHERS
@ EVENT_CYCLONE_OF_FEATHERS
Definition
boss_anzu.cpp:36
EVENT_PARALYZING_SCREECH
@ EVENT_PARALYZING_SCREECH
Definition
boss_anzu.cpp:34
EVENT_SPELL_BOMB
@ EVENT_SPELL_BOMB
Definition
boss_anzu.cpp:35
EVENT_SUMMON
@ EVENT_SUMMON
Definition
boss_anzu.cpp:37
EVENT_SUMMON
@ EVENT_SUMMON
Definition
boss_gluth.cpp:37
Says
Says
Definition
boss_halycon.cpp:17
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_anzu
Definition
boss_anzu.cpp:52
boss_anzu::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_anzu.cpp:161
boss_anzu::boss_anzu
boss_anzu()
Definition
boss_anzu.cpp:54
sethekk_halls.h
GetSethekkHallsAI
AI * GetSethekkHallsAI(Creature *creature)
Definition
sethekk_halls.h:33
NPC_BROOD_OF_ANZU
@ NPC_BROOD_OF_ANZU
Definition
sethekk_halls.h:24
DATA_ANZU
@ DATA_ANZU
Definition
sethekk_halls.h:18
Position
Definition
Object.h:274
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
boss_anzu::boss_anzuAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_anzu.cpp:72
boss_anzu::boss_anzuAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_anzu.cpp:79
boss_anzu::boss_anzuAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_anzu.cpp:101
boss_anzu::boss_anzuAI::boss_anzuAI
boss_anzuAI(Creature *creature)
Definition
boss_anzu.cpp:58
boss_anzu::boss_anzuAI::_under66Percent
bool _under66Percent
Definition
boss_anzu.cpp:158
boss_anzu::boss_anzuAI::Reset
void Reset() OVERRIDE
Definition
boss_anzu.cpp:64
boss_anzu::boss_anzuAI::_under33Percent
bool _under33Percent
Definition
boss_anzu.cpp:157
boss_anzu::boss_anzuAI::DamageTaken
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
Definition
boss_anzu.cpp:84
src
server
scripts
Outland
Auchindoun
SethekkHalls
boss_anzu.cpp
Generated on
for Project SkyFire Core by
1.17.0