Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_razorgore.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 "
SpellScript.h
"
9
#include "
blackwing_lair.h
"
10
#include "
Player.h
"
11
12
enum
Say
13
{
14
SAY_EGGS_BROKEN1
= 0,
15
SAY_EGGS_BROKEN2
= 1,
16
SAY_EGGS_BROKEN3
= 2,
17
SAY_DEATH
= 3,
18
};
19
20
enum
Spells
21
{
22
SPELL_MINDCONTROL
= 42013,
23
SPELL_CHANNEL
= 45537,
24
SPELL_EGG_DESTROY
= 19873,
25
26
SPELL_CLEAVE
= 22540,
27
SPELL_WARSTOMP
= 24375,
28
SPELL_FIREBALLVOLLEY
= 22425,
29
SPELL_CONFLAGRATION
= 23023
30
};
31
32
enum
Summons
33
{
34
NPC_ELITE_DRACHKIN
= 12422,
35
NPC_ELITE_WARRIOR
= 12458,
36
NPC_WARRIOR
= 12416,
37
NPC_MAGE
= 12420,
38
NPC_WARLOCK
= 12459,
39
40
GO_EGG
= 177807
41
};
42
43
enum
EVENTS
44
{
45
EVENT_CLEAVE
= 1,
46
EVENT_STOMP
= 2,
47
EVENT_FIREBALL
= 3,
48
EVENT_CONFLAGRATION
= 4
49
};
50
51
class
boss_razorgore
:
public
CreatureScript
52
{
53
public
:
54
boss_razorgore
() :
CreatureScript
(
"boss_razorgore"
) { }
55
56
struct
boss_razorgoreAI
:
public
BossAI
57
{
58
boss_razorgoreAI
(
Creature
* creature) :
BossAI
(creature,
BOSS_RAZORGORE
) { }
59
60
void
Reset
()
OVERRIDE
61
{
62
_Reset
();
63
64
secondPhase
=
false
;
65
if
(
instance
)
66
instance
->SetData(
DATA_EGG_EVENT
,
NOT_STARTED
);
67
}
68
69
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
70
{
71
_JustDied
();
72
Talk
(
SAY_DEATH
);
73
74
if
(
instance
)
75
instance
->SetData(
DATA_EGG_EVENT
,
NOT_STARTED
);
76
}
77
78
void
DoChangePhase
()
79
{
80
events
.ScheduleEvent(
EVENT_CLEAVE
, 15000);
81
events
.ScheduleEvent(
EVENT_STOMP
, 35000);
82
events
.ScheduleEvent(
EVENT_FIREBALL
, 7000);
83
events
.ScheduleEvent(
EVENT_CONFLAGRATION
, 12000);
84
85
secondPhase
=
true
;
86
me
->RemoveAllAuras();
87
me
->SetHealth(
me
->GetMaxHealth());
88
}
89
90
void
DoAction
(
int32
action)
OVERRIDE
91
{
92
if
(action ==
ACTION_PHASE_TWO
)
93
DoChangePhase
();
94
}
95
96
void
DamageTaken
(
Unit
*
/*who*/
,
uint32
& damage)
OVERRIDE
97
{
98
if
(!
secondPhase
)
99
damage = 0;
100
}
101
102
void
UpdateAI
(
uint32
diff)
OVERRIDE
103
{
104
if
(!
UpdateVictim
())
105
return
;
106
107
events
.Update(diff);
108
109
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
110
return
;
111
112
while
(
uint32
eventId =
events
.ExecuteEvent())
113
{
114
switch
(eventId)
115
{
116
case
EVENT_CLEAVE
:
117
DoCastVictim
(
SPELL_CLEAVE
);
118
events
.ScheduleEvent(
EVENT_CLEAVE
, std::rand() % 10000 + 7000);
119
break
;
120
case
EVENT_STOMP
:
121
DoCastVictim
(
SPELL_WARSTOMP
);
122
events
.ScheduleEvent(
EVENT_STOMP
, std::rand() % 25000 + 15000);
123
break
;
124
case
EVENT_FIREBALL
:
125
DoCastVictim
(
SPELL_FIREBALLVOLLEY
);
126
events
.ScheduleEvent(
EVENT_FIREBALL
, std::rand() % 15000 + 12000);
127
break
;
128
case
EVENT_CONFLAGRATION
:
129
DoCastVictim
(
SPELL_CONFLAGRATION
);
130
if
(
me
->GetVictim() &&
me
->GetVictim()->HasAura(
SPELL_CONFLAGRATION
))
131
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 1, 100,
true
))
132
me
->TauntApply(target);
133
events
.ScheduleEvent(
EVENT_CONFLAGRATION
, 30000);
134
break
;
135
}
136
}
137
DoMeleeAttackIfReady
();
138
}
139
140
private
:
141
bool
secondPhase
;
142
};
143
144
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
145
{
146
return
new
boss_razorgoreAI
(creature);
147
}
148
};
149
150
class
go_orb_of_domination
:
public
GameObjectScript
151
{
152
public
:
153
go_orb_of_domination
() :
GameObjectScript
(
"go_orb_of_domination"
) { }
154
155
bool
OnGossipHello
(
Player
* player,
GameObject
* go)
OVERRIDE
156
{
157
if
(
InstanceScript
* instance = go->GetInstanceScript())
158
if
(instance->GetData(
DATA_EGG_EVENT
) !=
DONE
)
159
if
(
Creature
* razor =
Unit::GetCreature
(*go, instance->GetData64(
DATA_RAZORGORE_THE_UNTAMED
)))
160
{
161
razor->Attack(player,
true
);
162
player->CastSpell(razor,
SPELL_MINDCONTROL
);
163
}
164
return
true
;
165
}
166
};
167
168
class
spell_egg_event
:
public
SpellScriptLoader
169
{
170
public
:
171
spell_egg_event
() :
SpellScriptLoader
(
"spell_egg_event"
) { }
172
173
class
spell_egg_eventSpellScript
:
public
SpellScript
174
{
175
PrepareSpellScript
(
spell_egg_eventSpellScript
);
176
177
void
HandleOnHit
()
178
{
179
if
(
InstanceScript
* instance =
GetCaster
()->GetInstanceScript())
180
instance->SetData(
DATA_EGG_EVENT
,
SPECIAL
);
181
}
182
183
void
Register
()
OVERRIDE
184
{
185
OnHit
+=
SpellHitFn
(
spell_egg_eventSpellScript::HandleOnHit
);
186
}
187
};
188
189
SpellScript
*
GetSpellScript
() const
OVERRIDE
190
{
191
return
new
spell_egg_eventSpellScript
();
192
}
193
};
194
195
void
AddSC_boss_razorgore
()
196
{
197
new
boss_razorgore
();
198
new
go_orb_of_domination
();
199
new
spell_egg_event
();
200
}
Spells
Spells
Definition
BattlegroundIC.h:645
int32
std::int32_t int32
Definition
Define.h:73
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
DONE
@ DONE
Definition
InstanceScript.h:49
SPECIAL
@ SPECIAL
Definition
InstanceScript.h:50
NOT_STARTED
@ NOT_STARTED
Definition
InstanceScript.h:46
Player.h
ScriptMgr.h
ScriptedCreature.h
SpellScript.h
SpellHitFn
#define SpellHitFn(F)
Definition
SpellScript.h:278
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
EVENT_CLEAVE
@ EVENT_CLEAVE
Definition
alterac_valley.cpp:42
SPELL_FIREBALLVOLLEY
@ SPELL_FIREBALLVOLLEY
Definition
blackrock_depths.cpp:334
blackwing_lair.h
DATA_EGG_EVENT
@ DATA_EGG_EVENT
Definition
blackwing_lair.h:66
ACTION_PHASE_TWO
@ ACTION_PHASE_TWO
Definition
blackwing_lair.h:65
DATA_RAZORGORE_THE_UNTAMED
@ DATA_RAZORGORE_THE_UNTAMED
Definition
blackwing_lair.h:44
BOSS_RAZORGORE
@ BOSS_RAZORGORE
Definition
blackwing_lair.h:15
Say
Say
Definition
boss_broodlord_lashlayer.cpp:11
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SPELL_WARSTOMP
@ SPELL_WARSTOMP
Definition
boss_magmus.cpp:12
EVENTS
EVENTS
Definition
boss_razorgore.cpp:44
EVENT_FIREBALL
@ EVENT_FIREBALL
Definition
boss_razorgore.cpp:47
EVENT_CONFLAGRATION
@ EVENT_CONFLAGRATION
Definition
boss_razorgore.cpp:48
EVENT_STOMP
@ EVENT_STOMP
Definition
boss_razorgore.cpp:46
EVENT_CLEAVE
@ EVENT_CLEAVE
Definition
boss_razorgore.cpp:45
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
boss_razorgore.cpp:26
SPELL_CONFLAGRATION
@ SPELL_CONFLAGRATION
Definition
boss_razorgore.cpp:29
SPELL_MINDCONTROL
@ SPELL_MINDCONTROL
Definition
boss_razorgore.cpp:22
SPELL_CHANNEL
@ SPELL_CHANNEL
Definition
boss_razorgore.cpp:23
SPELL_FIREBALLVOLLEY
@ SPELL_FIREBALLVOLLEY
Definition
boss_razorgore.cpp:28
SPELL_WARSTOMP
@ SPELL_WARSTOMP
Definition
boss_razorgore.cpp:27
SPELL_EGG_DESTROY
@ SPELL_EGG_DESTROY
Definition
boss_razorgore.cpp:24
SAY_DEATH
@ SAY_DEATH
Definition
boss_razorgore.cpp:17
SAY_EGGS_BROKEN1
@ SAY_EGGS_BROKEN1
Definition
boss_razorgore.cpp:14
SAY_EGGS_BROKEN3
@ SAY_EGGS_BROKEN3
Definition
boss_razorgore.cpp:16
SAY_EGGS_BROKEN2
@ SAY_EGGS_BROKEN2
Definition
boss_razorgore.cpp:15
GO_EGG
@ GO_EGG
Definition
boss_razorgore.cpp:40
NPC_MAGE
@ NPC_MAGE
Definition
boss_razorgore.cpp:37
NPC_WARLOCK
@ NPC_WARLOCK
Definition
boss_razorgore.cpp:38
NPC_WARRIOR
@ NPC_WARRIOR
Definition
boss_razorgore.cpp:36
NPC_ELITE_WARRIOR
@ NPC_ELITE_WARRIOR
Definition
boss_razorgore.cpp:35
NPC_ELITE_DRACHKIN
@ NPC_ELITE_DRACHKIN
Definition
boss_razorgore.cpp:34
AddSC_boss_razorgore
void AddSC_boss_razorgore()
Definition
boss_razorgore.cpp:195
BossAI::instance
InstanceScript *const instance
Definition
ScriptedCreature.h:383
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
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
GameObject
Definition
GameObject.h:629
GameObjectScript::GameObjectScript
GameObjectScript(const char *name)
Definition
ScriptMgr.cpp:1442
InstanceScript
Definition
InstanceScript.h:123
Player
Definition
Player.h:1289
SpellScript
Definition
SpellScript.h:139
SpellScript::OnHit
HookList< HitHandler > OnHit
Definition
SpellScript.h:274
SpellScript::GetCaster
Unit * GetCaster()
Definition
SpellScript.cpp:352
SpellScriptLoader::SpellScriptLoader
SpellScriptLoader(const char *name)
Definition
ScriptMgr.cpp:1372
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
Unit::GetCreature
static Creature * GetCreature(WorldObject &object, uint64 guid)
Definition
Unit.cpp:4905
boss_razorgore
Definition
boss_razorgore.cpp:52
boss_razorgore::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_razorgore.cpp:144
boss_razorgore::boss_razorgore
boss_razorgore()
Definition
boss_razorgore.cpp:54
go_orb_of_domination
Definition
boss_razorgore.cpp:151
go_orb_of_domination::go_orb_of_domination
go_orb_of_domination()
Definition
boss_razorgore.cpp:153
go_orb_of_domination::OnGossipHello
bool OnGossipHello(Player *player, GameObject *go) OVERRIDE
Definition
boss_razorgore.cpp:155
spell_egg_event::spell_egg_eventSpellScript
Definition
boss_razorgore.cpp:174
spell_egg_event::spell_egg_eventSpellScript::HandleOnHit
void HandleOnHit()
Definition
boss_razorgore.cpp:177
spell_egg_event::spell_egg_eventSpellScript::Register
void Register() OVERRIDE
Definition
boss_razorgore.cpp:183
spell_egg_event::spell_egg_eventSpellScript::PrepareSpellScript
PrepareSpellScript(spell_egg_eventSpellScript)
spell_egg_event
Definition
boss_razorgore.cpp:169
spell_egg_event::spell_egg_event
spell_egg_event()
Definition
boss_razorgore.cpp:171
spell_egg_event::GetSpellScript
SpellScript * GetSpellScript() const OVERRIDE
Definition
boss_razorgore.cpp:189
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
Summons
Definition
boss_urom.cpp:61
boss_razorgore::boss_razorgoreAI
Definition
boss_razorgore.cpp:57
boss_razorgore::boss_razorgoreAI::DoAction
void DoAction(int32 action) OVERRIDE
Definition
boss_razorgore.cpp:90
boss_razorgore::boss_razorgoreAI::DoChangePhase
void DoChangePhase()
Definition
boss_razorgore.cpp:78
boss_razorgore::boss_razorgoreAI::Reset
void Reset() OVERRIDE
Definition
boss_razorgore.cpp:60
boss_razorgore::boss_razorgoreAI::DamageTaken
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
Definition
boss_razorgore.cpp:96
boss_razorgore::boss_razorgoreAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_razorgore.cpp:102
boss_razorgore::boss_razorgoreAI::boss_razorgoreAI
boss_razorgoreAI(Creature *creature)
Definition
boss_razorgore.cpp:58
boss_razorgore::boss_razorgoreAI::secondPhase
bool secondPhase
Definition
boss_razorgore.cpp:141
boss_razorgore::boss_razorgoreAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_razorgore.cpp:69
src
server
scripts
EasternKingdoms
BlackrockMountain
BlackwingLair
boss_razorgore.cpp
Generated on
for Project SkyFire Core by
1.17.0