Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_gyth.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_REND_MOUNTS
= 16167,
// Change model
13
SPELL_CORROSIVE_ACID
= 16359,
// Combat (self cast)
14
SPELL_FLAMEBREATH
= 16390,
// Combat (Self cast)
15
SPELL_FREEZE
= 16350,
// Combat (Self cast)
16
SPELL_KNOCK_AWAY
= 10101,
// Combat
17
SPELL_SUMMON_REND
= 16328
// Summons Rend near death
18
};
19
20
enum
Misc
21
{
22
NEFARIUS_PATH_2
= 1379671,
23
NEFARIUS_PATH_3
= 1379672,
24
GYTH_PATH_1
= 1379681,
25
};
26
27
enum
Events
28
{
29
EVENT_CORROSIVE_ACID
= 1,
30
EVENT_FREEZE
= 2,
31
EVENT_FLAME_BREATH
= 3,
32
EVENT_KNOCK_AWAY
= 4,
33
EVENT_SUMMONED_1
= 5,
34
EVENT_SUMMONED_2
= 6
35
};
36
37
class
boss_gyth
:
public
CreatureScript
38
{
39
public
:
40
boss_gyth
() :
CreatureScript
(
"boss_gyth"
) { }
41
42
struct
boss_gythAI
:
public
BossAI
43
{
44
boss_gythAI
(
Creature
* creature) :
BossAI
(creature,
DATA_GYTH
) { }
45
46
bool
SummonedRend
;
47
48
void
Reset
()
OVERRIDE
49
{
50
SummonedRend
=
false
;
51
if
(
instance
->GetBossState(
DATA_GYTH
) ==
IN_PROGRESS
)
52
{
53
instance
->SetBossState(
DATA_GYTH
,
DONE
);
54
me
->DespawnOrUnsummon();
55
}
56
}
57
58
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
59
{
60
_EnterCombat
();
61
62
events
.ScheduleEvent(
EVENT_CORROSIVE_ACID
, std::rand() % 16000 + 8000);
63
events
.ScheduleEvent(
EVENT_FREEZE
, std::rand() % 16000 + 8000);
64
events
.ScheduleEvent(
EVENT_FLAME_BREATH
, std::rand() % 16000 + 8000);
65
events
.ScheduleEvent(
EVENT_KNOCK_AWAY
, std::rand() % 18000 + 12000);
66
}
67
68
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
69
{
70
instance
->SetBossState(
DATA_GYTH
,
DONE
);
71
}
72
73
void
SetData
(
uint32
/*type*/
,
uint32
data)
OVERRIDE
74
{
75
switch
(data)
76
{
77
case
1:
78
events
.ScheduleEvent(
EVENT_SUMMONED_1
, 1000);
79
break
;
80
default
:
81
break
;
82
}
83
}
84
85
void
UpdateAI
(
uint32
diff)
OVERRIDE
86
{
87
if
(!
SummonedRend
&&
HealthBelowPct
(5))
88
{
89
DoCast
(
me
,
SPELL_SUMMON_REND
);
90
me
->RemoveAura(
SPELL_REND_MOUNTS
);
91
SummonedRend
=
true
;
92
}
93
94
if
(!
UpdateVictim
())
95
{
96
events
.Update(diff);
97
98
while
(
uint32
eventId =
events
.ExecuteEvent())
99
{
100
switch
(eventId)
101
{
102
case
EVENT_SUMMONED_1
:
103
me
->AddAura(
SPELL_REND_MOUNTS
,
me
);
104
if
(
GameObject
* portcullis =
me
->FindNearestGameObject(
GO_DR_PORTCULLIS
, 40.0f))
105
portcullis->UseDoorOrButton();
106
if
(
Creature
* victor =
me
->FindNearestCreature(
NPC_LORD_VICTOR_NEFARIUS
, 75.0f,
true
))
107
victor->AI()->SetData(1, 1);
108
events
.ScheduleEvent(
EVENT_SUMMONED_2
, 2000);
109
break
;
110
case
EVENT_SUMMONED_2
:
111
me
->GetMotionMaster()->MovePath(
GYTH_PATH_1
,
false
);
112
break
;
113
default
:
114
break
;
115
}
116
}
117
return
;
118
}
119
120
events
.Update(diff);
121
122
while
(
uint32
eventId =
events
.ExecuteEvent())
123
{
124
switch
(eventId)
125
{
126
case
EVENT_CORROSIVE_ACID
:
127
DoCast
(
me
,
SPELL_CORROSIVE_ACID
);
128
events
.ScheduleEvent(
EVENT_CORROSIVE_ACID
, std::rand() % 16000 + 10000);
129
break
;
130
case
EVENT_FREEZE
:
131
DoCast
(
me
,
SPELL_FREEZE
);
132
events
.ScheduleEvent(
EVENT_FREEZE
, std::rand() % 16000 + 10000);
133
break
;
134
case
EVENT_FLAME_BREATH
:
135
DoCast
(
me
,
SPELL_FLAMEBREATH
);
136
events
.ScheduleEvent(
EVENT_FLAME_BREATH
, std::rand() % 16000 + 10000);
137
break
;
138
case
EVENT_KNOCK_AWAY
:
139
DoCastVictim
(
SPELL_KNOCK_AWAY
);
140
events
.ScheduleEvent(
EVENT_KNOCK_AWAY
, std::rand() % 20000 + 14000);
141
break
;
142
default
:
143
break
;
144
}
145
}
146
DoMeleeAttackIfReady
();
147
}
148
};
149
150
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
151
{
152
return
new
boss_gythAI
(creature);
153
}
154
};
155
156
void
AddSC_boss_gyth
()
157
{
158
new
boss_gyth
();
159
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
IN_PROGRESS
@ IN_PROGRESS
Definition
InstanceScript.h:47
DONE
@ DONE
Definition
InstanceScript.h:49
ScriptMgr.h
ScriptedCreature.h
Events
Events
Definition
alterac_valley.cpp:40
blackrock_spire.h
NPC_LORD_VICTOR_NEFARIUS
@ NPC_LORD_VICTOR_NEFARIUS
Definition
blackrock_spire.h:61
GO_DR_PORTCULLIS
@ GO_DR_PORTCULLIS
Definition
blackrock_spire.h:103
DATA_GYTH
@ DATA_GYTH
Definition
blackrock_spire.h:26
AddSC_boss_gyth
void AddSC_boss_gyth()
Definition
boss_gyth.cpp:156
NEFARIUS_PATH_2
@ NEFARIUS_PATH_2
Definition
boss_gyth.cpp:22
GYTH_PATH_1
@ GYTH_PATH_1
Definition
boss_gyth.cpp:24
NEFARIUS_PATH_3
@ NEFARIUS_PATH_3
Definition
boss_gyth.cpp:23
SPELL_REND_MOUNTS
@ SPELL_REND_MOUNTS
Definition
boss_gyth.cpp:12
SPELL_SUMMON_REND
@ SPELL_SUMMON_REND
Definition
boss_gyth.cpp:17
SPELL_FREEZE
@ SPELL_FREEZE
Definition
boss_gyth.cpp:15
SPELL_FLAMEBREATH
@ SPELL_FLAMEBREATH
Definition
boss_gyth.cpp:14
SPELL_KNOCK_AWAY
@ SPELL_KNOCK_AWAY
Definition
boss_gyth.cpp:16
SPELL_CORROSIVE_ACID
@ SPELL_CORROSIVE_ACID
Definition
boss_gyth.cpp:13
EVENT_FLAME_BREATH
@ EVENT_FLAME_BREATH
Definition
boss_gyth.cpp:31
EVENT_SUMMONED_1
@ EVENT_SUMMONED_1
Definition
boss_gyth.cpp:33
EVENT_KNOCK_AWAY
@ EVENT_KNOCK_AWAY
Definition
boss_gyth.cpp:32
EVENT_SUMMONED_2
@ EVENT_SUMMONED_2
Definition
boss_gyth.cpp:34
EVENT_FREEZE
@ EVENT_FREEZE
Definition
boss_gyth.cpp:30
EVENT_CORROSIVE_ACID
@ EVENT_CORROSIVE_ACID
Definition
boss_gyth.cpp:29
Misc
Misc
Definition
boss_occuthar.cpp:37
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::_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
GameObject
Definition
GameObject.h:629
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_gyth
Definition
boss_gyth.cpp:38
boss_gyth::boss_gyth
boss_gyth()
Definition
boss_gyth.cpp:40
boss_gyth::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_gyth.cpp:150
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
boss_gyth::boss_gythAI
Definition
boss_gyth.cpp:43
boss_gyth::boss_gythAI::Reset
void Reset() OVERRIDE
Definition
boss_gyth.cpp:48
boss_gyth::boss_gythAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_gyth.cpp:85
boss_gyth::boss_gythAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_gyth.cpp:58
boss_gyth::boss_gythAI::SetData
void SetData(uint32, uint32 data) OVERRIDE
Definition
boss_gyth.cpp:73
boss_gyth::boss_gythAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_gyth.cpp:68
boss_gyth::boss_gythAI::boss_gythAI
boss_gythAI(Creature *creature)
Definition
boss_gyth.cpp:44
boss_gyth::boss_gythAI::SummonedRend
bool SummonedRend
Definition
boss_gyth.cpp:46
src
server
scripts
EasternKingdoms
BlackrockMountain
BlackrockSpire
boss_gyth.cpp
Generated on
for Project SkyFire Core by
1.17.0