Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_golemagg.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_Golemagg
8
SD%Complete: 90
9
SDComment: Timers need to be confirmed, Golemagg's Trust need to be checked
10
SDCategory: Molten Core
11
EndScriptData */
12
13
#include "
ObjectMgr.h
"
14
#include "
ScriptMgr.h
"
15
#include "
ScriptedCreature.h
"
16
#include "
molten_core.h
"
17
18
enum
Texts
19
{
20
EMOTE_LOWHP
= 0,
21
};
22
23
enum
Spells
24
{
25
// Golemagg
26
SPELL_MAGMASPLASH
= 13879,
27
SPELL_PYROBLAST
= 20228,
28
SPELL_EARTHQUAKE
= 19798,
29
SPELL_ENRAGE
= 19953,
30
SPELL_GOLEMAGG_TRUST
= 20553,
31
32
// Core Rager
33
SPELL_MANGLE
= 19820
34
};
35
36
enum
Events
37
{
38
EVENT_PYROBLAST
= 1,
39
EVENT_EARTHQUAKE
= 2,
40
};
41
42
class
boss_golemagg
:
public
CreatureScript
43
{
44
public
:
45
boss_golemagg
() :
CreatureScript
(
"boss_golemagg"
) {}
46
47
struct
boss_golemaggAI
:
public
BossAI
48
{
49
boss_golemaggAI
(
Creature
* creature) :
BossAI
(creature,
BOSS_GOLEMAGG_THE_INCINERATOR
) {}
50
51
void
Reset
()
OVERRIDE
52
{
53
BossAI::Reset
();
54
DoCast
(
me
,
SPELL_MAGMASPLASH
,
true
);
55
}
56
57
void
EnterCombat
(
Unit
* victim)
OVERRIDE
58
{
59
BossAI::EnterCombat
(victim);
60
events
.ScheduleEvent(
EVENT_PYROBLAST
, 7000);
61
}
62
63
void
DamageTaken
(
Unit
*
/*attacker*/
,
uint32
&
/*damage*/
)
OVERRIDE
64
{
65
if
(!
HealthBelowPct
(10) ||
me
->HasAura(
SPELL_ENRAGE
))
66
return
;
67
68
DoCast
(
me
,
SPELL_ENRAGE
,
true
);
69
events
.ScheduleEvent(
EVENT_EARTHQUAKE
, 3000);
70
}
71
72
void
UpdateAI
(
uint32
diff)
OVERRIDE
73
{
74
if
(!
UpdateVictim
())
75
return
;
76
77
events
.Update(diff);
78
79
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
80
return
;
81
82
while
(
uint32
eventId =
events
.ExecuteEvent())
83
{
84
switch
(eventId)
85
{
86
case
EVENT_PYROBLAST
:
87
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
88
DoCast
(target,
SPELL_PYROBLAST
);
89
events
.ScheduleEvent(
EVENT_PYROBLAST
, 7000);
90
break
;
91
case
EVENT_EARTHQUAKE
:
92
DoCastVictim
(
SPELL_EARTHQUAKE
);
93
events
.ScheduleEvent(
EVENT_EARTHQUAKE
, 3000);
94
break
;
95
default
:
96
break
;
97
}
98
}
99
100
DoMeleeAttackIfReady
();
101
}
102
};
103
104
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
105
{
106
return
new
boss_golemaggAI
(creature);
107
}
108
};
109
110
class
npc_core_rager
:
public
CreatureScript
111
{
112
public
:
113
npc_core_rager
() :
CreatureScript
(
"npc_core_rager"
) {}
114
115
struct
npc_core_ragerAI
:
public
ScriptedAI
116
{
117
npc_core_ragerAI
(
Creature
* creature) :
ScriptedAI
(creature)
118
{
119
instance
= creature->
GetInstanceScript
();
120
mangleTimer
= 0;
121
}
122
123
void
Reset
()
OVERRIDE
124
{
125
mangleTimer
= 7 *
IN_MILLISECONDS
;
// These times are probably wrong
126
}
127
128
void
DamageTaken
(
Unit
*
/*attacker*/
,
uint32
&
/*damage*/
)
OVERRIDE
129
{
130
if
(
HealthAbovePct
(50) || !
instance
)
131
return
;
132
133
if
(
Creature
* pGolemagg =
instance
->instance->GetCreature(
instance
->GetData64(
BOSS_GOLEMAGG_THE_INCINERATOR
)))
134
{
135
if
(pGolemagg->IsAlive())
136
{
137
me
->AddAura(
SPELL_GOLEMAGG_TRUST
,
me
);
138
Talk
(
EMOTE_LOWHP
);
139
me
->SetFullHealth();
140
}
141
}
142
}
143
144
void
UpdateAI
(
uint32
diff)
OVERRIDE
145
{
146
if
(!
UpdateVictim
())
147
return
;
148
149
// Mangle
150
if
(
mangleTimer
<= diff)
151
{
152
DoCastVictim
(
SPELL_MANGLE
);
153
mangleTimer
= 10 *
IN_MILLISECONDS
;
154
}
155
else
156
mangleTimer
-= diff;
157
158
DoMeleeAttackIfReady
();
159
}
160
161
private
:
162
InstanceScript
*
instance
;
163
uint32
mangleTimer
;
164
};
165
166
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
167
{
168
return
new
npc_core_ragerAI
(creature);
169
}
170
};
171
172
void
AddSC_boss_golemagg
()
173
{
174
new
boss_golemagg
();
175
new
npc_core_rager
();
176
}
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
ObjectMgr.h
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_ENRAGE
@ SPELL_ENRAGE
Definition
alterac_valley.cpp:14
Events
Events
Definition
alterac_valley.cpp:40
Texts
Texts
Definition
boss_alizabal.cpp:13
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
boss_golemagg.cpp:29
SPELL_MANGLE
@ SPELL_MANGLE
Definition
boss_golemagg.cpp:33
SPELL_MAGMASPLASH
@ SPELL_MAGMASPLASH
Definition
boss_golemagg.cpp:26
SPELL_EARTHQUAKE
@ SPELL_EARTHQUAKE
Definition
boss_golemagg.cpp:28
SPELL_GOLEMAGG_TRUST
@ SPELL_GOLEMAGG_TRUST
Definition
boss_golemagg.cpp:30
SPELL_PYROBLAST
@ SPELL_PYROBLAST
Definition
boss_golemagg.cpp:27
AddSC_boss_golemagg
void AddSC_boss_golemagg()
Definition
boss_golemagg.cpp:172
EMOTE_LOWHP
@ EMOTE_LOWHP
Definition
boss_golemagg.cpp:20
EVENT_EARTHQUAKE
@ EVENT_EARTHQUAKE
Definition
boss_golemagg.cpp:39
EVENT_PYROBLAST
@ EVENT_PYROBLAST
Definition
boss_golemagg.cpp:38
SPELL_PYROBLAST
@ SPELL_PYROBLAST
Definition
boss_pyroguard_emberseer.cpp:32
EVENT_PYROBLAST
@ EVENT_PYROBLAST
Definition
boss_pyroguard_emberseer.cpp:51
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::Reset
void Reset() OVERRIDE
Definition
ScriptedCreature.h:400
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
BossAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
ScriptedCreature.h:404
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
InstanceScript
Definition
InstanceScript.h:123
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
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
boss_golemagg
Definition
boss_golemagg.cpp:43
boss_golemagg::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_golemagg.cpp:104
boss_golemagg::boss_golemagg
boss_golemagg()
Definition
boss_golemagg.cpp:45
npc_core_rager
Definition
boss_golemagg.cpp:111
npc_core_rager::npc_core_rager
npc_core_rager()
Definition
boss_golemagg.cpp:113
npc_core_rager::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_golemagg.cpp:166
molten_core.h
BOSS_GOLEMAGG_THE_INCINERATOR
@ BOSS_GOLEMAGG_THE_INCINERATOR
Definition
molten_core.h:18
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthAbovePct
bool HealthAbovePct(uint32 pct) const
Definition
ScriptedCreature.h:251
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_golemagg::boss_golemaggAI
Definition
boss_golemagg.cpp:48
boss_golemagg::boss_golemaggAI::DamageTaken
void DamageTaken(Unit *, uint32 &) OVERRIDE
Definition
boss_golemagg.cpp:63
boss_golemagg::boss_golemaggAI::EnterCombat
void EnterCombat(Unit *victim) OVERRIDE
Definition
boss_golemagg.cpp:57
boss_golemagg::boss_golemaggAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_golemagg.cpp:72
boss_golemagg::boss_golemaggAI::Reset
void Reset() OVERRIDE
Definition
boss_golemagg.cpp:51
boss_golemagg::boss_golemaggAI::boss_golemaggAI
boss_golemaggAI(Creature *creature)
Definition
boss_golemagg.cpp:49
npc_core_rager::npc_core_ragerAI
Definition
boss_golemagg.cpp:116
npc_core_rager::npc_core_ragerAI::mangleTimer
uint32 mangleTimer
Definition
boss_golemagg.cpp:163
npc_core_rager::npc_core_ragerAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_golemagg.cpp:144
npc_core_rager::npc_core_ragerAI::npc_core_ragerAI
npc_core_ragerAI(Creature *creature)
Definition
boss_golemagg.cpp:117
npc_core_rager::npc_core_ragerAI::instance
InstanceScript * instance
Definition
boss_golemagg.cpp:162
npc_core_rager::npc_core_ragerAI::DamageTaken
void DamageTaken(Unit *, uint32 &) OVERRIDE
Definition
boss_golemagg.cpp:128
npc_core_rager::npc_core_ragerAI::Reset
void Reset() OVERRIDE
Definition
boss_golemagg.cpp:123
src
server
scripts
EasternKingdoms
BlackrockMountain
MoltenCore
boss_golemagg.cpp
Generated on
for Project SkyFire Core by
1.17.0