Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_herod.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_Herod
8
SD%Complete: 95
9
SDComment: Should in addition spawn Myrmidons in the hallway outside
10
SDCategory: Scarlet Monastery
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
ScriptedEscortAI.h
"
16
17
enum
Says
18
{
19
SAY_AGGRO
= 0,
20
SAY_WHIRLWIND
= 1,
21
SAY_ENRAGE
= 2,
22
SAY_KILL
= 3,
23
EMOTE_ENRAGE
= 4
24
};
25
26
enum
Spells
27
{
28
SPELL_RUSHINGCHARGE
= 8260,
29
SPELL_CLEAVE
= 15496,
30
SPELL_WHIRLWIND
= 8989,
31
SPELL_FRENZY
= 8269
32
};
33
34
enum
Entry
35
{
36
ENTRY_SCARLET_TRAINEE
= 6575,
37
ENTRY_SCARLET_MYRMIDON
= 4295
38
};
39
40
class
boss_herod
:
public
CreatureScript
41
{
42
public
:
43
boss_herod
() :
CreatureScript
(
"boss_herod"
) { }
44
45
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
46
{
47
return
new
boss_herodAI
(creature);
48
}
49
50
struct
boss_herodAI
:
public
ScriptedAI
51
{
52
boss_herodAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
53
54
bool
Enrage
;
55
56
uint32
Cleave_Timer
;
57
uint32
Whirlwind_Timer
;
58
59
void
Reset
()
OVERRIDE
60
{
61
Enrage
=
false
;
62
Cleave_Timer
= 12000;
63
Whirlwind_Timer
= 60000;
64
}
65
66
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
67
{
68
Talk
(
SAY_AGGRO
);
69
DoCast
(
me
,
SPELL_RUSHINGCHARGE
);
70
}
71
72
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
73
{
74
Talk
(
SAY_KILL
);
75
}
76
77
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
78
{
79
for
(
uint8
i = 0; i < 20; ++i)
80
me
->SummonCreature(
ENTRY_SCARLET_TRAINEE
, 1939.18f, -431.58f, 17.09f, 6.22f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
, 600000);
81
}
82
83
void
UpdateAI
(
uint32
diff)
OVERRIDE
84
{
85
if
(!
UpdateVictim
())
86
return
;
87
88
//If we are <30% hp goes Enraged
89
if
(!
Enrage
&& !
HealthAbovePct
(30) && !
me
->IsNonMeleeSpellCasted(
false
))
90
{
91
Talk
(
EMOTE_ENRAGE
);
92
Talk
(
SAY_ENRAGE
);
93
DoCast
(
me
,
SPELL_FRENZY
);
94
Enrage
=
true
;
95
}
96
97
//Cleave_Timer
98
if
(
Cleave_Timer
<= diff)
99
{
100
DoCastVictim
(
SPELL_CLEAVE
);
101
Cleave_Timer
= 12000;
102
}
103
else
Cleave_Timer
-= diff;
104
105
// Whirlwind_Timer
106
if
(
Whirlwind_Timer
<= diff)
107
{
108
Talk
(
SAY_WHIRLWIND
);
109
DoCastVictim
(
SPELL_WHIRLWIND
);
110
Whirlwind_Timer
= 30000;
111
}
112
else
Whirlwind_Timer
-= diff;
113
114
DoMeleeAttackIfReady
();
115
}
116
};
117
};
118
119
class
npc_scarlet_trainee
:
public
CreatureScript
120
{
121
public
:
122
npc_scarlet_trainee
() :
CreatureScript
(
"npc_scarlet_trainee"
) { }
123
124
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
125
{
126
return
new
npc_scarlet_traineeAI
(creature);
127
}
128
129
struct
npc_scarlet_traineeAI
:
public
npc_escortAI
130
{
131
npc_scarlet_traineeAI
(
Creature
* creature) :
npc_escortAI
(creature)
132
{
133
Start_Timer
= urand(1000, 6000);
134
}
135
136
uint32
Start_Timer
;
137
138
void
Reset
()
OVERRIDE
{ }
139
void
WaypointReached
(
uint32
/*waypointId*/
)
OVERRIDE
{ }
140
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
141
142
void
UpdateAI
(
uint32
diff)
OVERRIDE
143
{
144
if
(
Start_Timer
)
145
{
146
if
(
Start_Timer
<= diff)
147
{
148
Start
(
true
,
true
);
149
Start_Timer
= 0;
150
}
else
Start_Timer
-= diff;
151
}
152
153
npc_escortAI::UpdateAI
(diff);
154
}
155
};
156
};
157
158
void
AddSC_boss_herod
()
159
{
160
new
boss_herod
();
161
new
npc_scarlet_trainee
();
162
}
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
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
static constexpr TempSummonType TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Definition
ElunaCompatibility.h:25
ScriptMgr.h
ScriptedCreature.h
ScriptedEscortAI.h
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
alterac_valley.cpp:12
SPELL_WHIRLWIND
@ SPELL_WHIRLWIND
Definition
alterac_valley.cpp:15
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SAY_KILL
#define SAY_KILL
Definition
boss_commander_kolurg.cpp:29
SAY_ENRAGE
@ SAY_ENRAGE
Definition
boss_curator.cpp:21
SPELL_FRENZY
@ SPELL_FRENZY
Definition
boss_drekthar.cpp:14
Says
Says
Definition
boss_halycon.cpp:17
Entry
Entry
Definition
boss_headless_horseman.cpp:38
SAY_WHIRLWIND
@ SAY_WHIRLWIND
Definition
boss_herod.cpp:20
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_herod.cpp:19
SAY_KILL
@ SAY_KILL
Definition
boss_herod.cpp:22
EMOTE_ENRAGE
@ EMOTE_ENRAGE
Definition
boss_herod.cpp:23
SAY_ENRAGE
@ SAY_ENRAGE
Definition
boss_herod.cpp:21
SPELL_RUSHINGCHARGE
@ SPELL_RUSHINGCHARGE
Definition
boss_herod.cpp:28
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
boss_herod.cpp:29
SPELL_FRENZY
@ SPELL_FRENZY
Definition
boss_herod.cpp:31
SPELL_WHIRLWIND
@ SPELL_WHIRLWIND
Definition
boss_herod.cpp:30
ENTRY_SCARLET_MYRMIDON
@ ENTRY_SCARLET_MYRMIDON
Definition
boss_herod.cpp:37
ENTRY_SCARLET_TRAINEE
@ ENTRY_SCARLET_TRAINEE
Definition
boss_herod.cpp:36
AddSC_boss_herod
void AddSC_boss_herod()
Definition
boss_herod.cpp:158
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::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
boss_herod
Definition
boss_herod.cpp:41
boss_herod::boss_herod
boss_herod()
Definition
boss_herod.cpp:43
boss_herod::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_herod.cpp:45
npc_scarlet_trainee
Definition
boss_herod.cpp:120
npc_scarlet_trainee::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_herod.cpp:124
npc_scarlet_trainee::npc_scarlet_trainee
npc_scarlet_trainee()
Definition
boss_herod.cpp:122
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthAbovePct
bool HealthAbovePct(uint32 pct) const
Definition
ScriptedCreature.h:251
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_herod::boss_herodAI
Definition
boss_herod.cpp:51
boss_herod::boss_herodAI::Whirlwind_Timer
uint32 Whirlwind_Timer
Definition
boss_herod.cpp:57
boss_herod::boss_herodAI::Enrage
bool Enrage
Definition
boss_herod.cpp:54
boss_herod::boss_herodAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_herod.cpp:83
boss_herod::boss_herodAI::Reset
void Reset() OVERRIDE
Definition
boss_herod.cpp:59
boss_herod::boss_herodAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_herod.cpp:66
boss_herod::boss_herodAI::boss_herodAI
boss_herodAI(Creature *creature)
Definition
boss_herod.cpp:52
boss_herod::boss_herodAI::Cleave_Timer
uint32 Cleave_Timer
Definition
boss_herod.cpp:56
boss_herod::boss_herodAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_herod.cpp:77
boss_herod::boss_herodAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_herod.cpp:72
npc_escortAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
ScriptedEscortAI.cpp:209
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_scarlet_trainee::npc_scarlet_traineeAI
Definition
boss_herod.cpp:130
npc_scarlet_trainee::npc_scarlet_traineeAI::Start_Timer
uint32 Start_Timer
Definition
boss_herod.cpp:136
npc_scarlet_trainee::npc_scarlet_traineeAI::WaypointReached
void WaypointReached(uint32) OVERRIDE
Definition
boss_herod.cpp:139
npc_scarlet_trainee::npc_scarlet_traineeAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_herod.cpp:142
npc_scarlet_trainee::npc_scarlet_traineeAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_herod.cpp:140
npc_scarlet_trainee::npc_scarlet_traineeAI::Reset
void Reset() OVERRIDE
Definition
boss_herod.cpp:138
npc_scarlet_trainee::npc_scarlet_traineeAI::npc_scarlet_traineeAI
npc_scarlet_traineeAI(Creature *creature)
Definition
boss_herod.cpp:131
src
server
scripts
EasternKingdoms
ScarletMonastery
boss_herod.cpp
Generated on
for Project SkyFire Core by
1.17.0