Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_overlord_wyrmthalak.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 "
blackrock_spire.h
"
9
10
enum
Spells
11
{
12
SPELL_BLASTWAVE
= 11130,
13
SPELL_SHOUT
= 23511,
14
SPELL_CLEAVE
= 20691,
15
SPELL_KNOCKAWAY
= 20686
16
};
17
18
enum
Events
19
{
20
EVENT_BLAST_WAVE
= 1,
21
EVENT_SHOUT
= 2,
22
EVENT_CLEAVE
= 3,
23
EVENT_KNOCK_AWAY
= 4
24
};
25
26
enum
Adds
27
{
28
NPC_SPIRESTONE_WARLORD
= 9216,
29
NPC_SMOLDERTHORN_BERSERKER
= 9268
30
};
31
32
const
Position
SummonLocation1
= { -39.355f, -513.456f, 88.472f, 4.679f };
33
const
Position
SummonLocation2
= { -49.875f, -511.896f, 88.195f, 4.613f };
34
35
class
boss_overlord_wyrmthalak
:
public
CreatureScript
36
{
37
public
:
38
boss_overlord_wyrmthalak
() :
CreatureScript
(
"boss_overlord_wyrmthalak"
) { }
39
40
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
41
{
42
return
new
boss_overlordwyrmthalakAI
(creature);
43
}
44
45
struct
boss_overlordwyrmthalakAI
:
public
BossAI
46
{
47
boss_overlordwyrmthalakAI
(
Creature
* creature) :
BossAI
(creature,
DATA_OVERLORD_WYRMTHALAK
) { }
48
49
bool
Summoned
;
50
51
void
Reset
()
OVERRIDE
52
{
53
_Reset
();
54
Summoned
=
false
;
55
}
56
57
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
58
{
59
_EnterCombat
();
60
events
.ScheduleEvent(
EVENT_BLAST_WAVE
, 20 *
IN_MILLISECONDS
);
61
events
.ScheduleEvent(
EVENT_SHOUT
, 2 *
IN_MILLISECONDS
);
62
events
.ScheduleEvent(
EVENT_CLEAVE
, 6 *
IN_MILLISECONDS
);
63
events
.ScheduleEvent(
EVENT_KNOCK_AWAY
, 12 *
IN_MILLISECONDS
);
64
}
65
66
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
67
{
68
_JustDied
();
69
}
70
71
void
UpdateAI
(
uint32
diff)
OVERRIDE
72
{
73
if
(!
UpdateVictim
())
74
return
;
75
76
if
(!
Summoned
&&
HealthBelowPct
(51))
77
{
78
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
79
{
80
if
(
Creature
* warlord =
me
->SummonCreature(
NPC_SPIRESTONE_WARLORD
,
SummonLocation1
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 300 *
IN_MILLISECONDS
))
81
warlord->AI()->AttackStart(target);
82
if
(
Creature
* berserker =
me
->SummonCreature(
NPC_SMOLDERTHORN_BERSERKER
,
SummonLocation2
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 300 *
IN_MILLISECONDS
))
83
berserker->AI()->AttackStart(target);
84
Summoned
=
true
;
85
}
86
}
87
88
events
.Update(diff);
89
90
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
91
return
;
92
93
while
(
uint32
eventId =
events
.ExecuteEvent())
94
{
95
switch
(eventId)
96
{
97
case
EVENT_BLAST_WAVE
:
98
DoCastVictim
(
SPELL_BLASTWAVE
);
99
events
.ScheduleEvent(
EVENT_BLAST_WAVE
, 20 *
IN_MILLISECONDS
);
100
break
;
101
case
EVENT_SHOUT
:
102
DoCastVictim
(
SPELL_SHOUT
);
103
events
.ScheduleEvent(
EVENT_SHOUT
, 10 *
IN_MILLISECONDS
);
104
break
;
105
case
EVENT_CLEAVE
:
106
DoCastVictim
(
SPELL_CLEAVE
);
107
events
.ScheduleEvent(
EVENT_CLEAVE
, 7 *
IN_MILLISECONDS
);
108
break
;
109
case
EVENT_KNOCK_AWAY
:
110
DoCastVictim
(
SPELL_KNOCKAWAY
);
111
events
.ScheduleEvent(
EVENT_KNOCK_AWAY
, 14 *
IN_MILLISECONDS
);
112
break
;
113
}
114
}
115
DoMeleeAttackIfReady
();
116
}
117
};
118
};
119
120
void
AddSC_boss_overlordwyrmthalak
()
121
{
122
new
boss_overlord_wyrmthalak
();
123
}
Spells
Spells
Definition
BattlegroundIC.h:645
IN_MILLISECONDS
@ IN_MILLISECONDS
Definition
Common.h:125
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
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
alterac_valley.cpp:12
Events
Events
Definition
alterac_valley.cpp:40
EVENT_CLEAVE
@ EVENT_CLEAVE
Definition
alterac_valley.cpp:42
blackrock_spire.h
DATA_OVERLORD_WYRMTHALAK
@ DATA_OVERLORD_WYRMTHALAK
Definition
blackrock_spire.h:23
EVENT_KNOCK_AWAY
@ EVENT_KNOCK_AWAY
Definition
boss_gyth.cpp:32
Adds
Adds
Definition
boss_overlord_wyrmthalak.cpp:27
NPC_SPIRESTONE_WARLORD
@ NPC_SPIRESTONE_WARLORD
Definition
boss_overlord_wyrmthalak.cpp:28
NPC_SMOLDERTHORN_BERSERKER
@ NPC_SMOLDERTHORN_BERSERKER
Definition
boss_overlord_wyrmthalak.cpp:29
SummonLocation2
const Position SummonLocation2
Definition
boss_overlord_wyrmthalak.cpp:33
SPELL_SHOUT
@ SPELL_SHOUT
Definition
boss_overlord_wyrmthalak.cpp:13
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
boss_overlord_wyrmthalak.cpp:14
SPELL_KNOCKAWAY
@ SPELL_KNOCKAWAY
Definition
boss_overlord_wyrmthalak.cpp:15
SPELL_BLASTWAVE
@ SPELL_BLASTWAVE
Definition
boss_overlord_wyrmthalak.cpp:12
AddSC_boss_overlordwyrmthalak
void AddSC_boss_overlordwyrmthalak()
Definition
boss_overlord_wyrmthalak.cpp:120
SummonLocation1
const Position SummonLocation1
Definition
boss_overlord_wyrmthalak.cpp:32
EVENT_KNOCK_AWAY
@ EVENT_KNOCK_AWAY
Definition
boss_overlord_wyrmthalak.cpp:23
EVENT_BLAST_WAVE
@ EVENT_BLAST_WAVE
Definition
boss_overlord_wyrmthalak.cpp:20
EVENT_SHOUT
@ EVENT_SHOUT
Definition
boss_overlord_wyrmthalak.cpp:21
EVENT_CLEAVE
@ EVENT_CLEAVE
Definition
boss_overlord_wyrmthalak.cpp:22
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::_Reset
void _Reset()
Definition
ScriptedCreature.cpp:462
BossAI::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
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::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_overlord_wyrmthalak
Definition
boss_overlord_wyrmthalak.cpp:36
boss_overlord_wyrmthalak::boss_overlord_wyrmthalak
boss_overlord_wyrmthalak()
Definition
boss_overlord_wyrmthalak.cpp:38
boss_overlord_wyrmthalak::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_overlord_wyrmthalak.cpp:40
Position
Definition
Object.h:274
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
boss_overlord_wyrmthalak::boss_overlordwyrmthalakAI
Definition
boss_overlord_wyrmthalak.cpp:46
boss_overlord_wyrmthalak::boss_overlordwyrmthalakAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_overlord_wyrmthalak.cpp:57
boss_overlord_wyrmthalak::boss_overlordwyrmthalakAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_overlord_wyrmthalak.cpp:71
boss_overlord_wyrmthalak::boss_overlordwyrmthalakAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_overlord_wyrmthalak.cpp:66
boss_overlord_wyrmthalak::boss_overlordwyrmthalakAI::boss_overlordwyrmthalakAI
boss_overlordwyrmthalakAI(Creature *creature)
Definition
boss_overlord_wyrmthalak.cpp:47
boss_overlord_wyrmthalak::boss_overlordwyrmthalakAI::Summoned
bool Summoned
Definition
boss_overlord_wyrmthalak.cpp:49
boss_overlord_wyrmthalak::boss_overlordwyrmthalakAI::Reset
void Reset() OVERRIDE
Definition
boss_overlord_wyrmthalak.cpp:51
src
server
scripts
EasternKingdoms
BlackrockMountain
BlackrockSpire
boss_overlord_wyrmthalak.cpp
Generated on
for Project SkyFire Core by
1.17.0