Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_gluth.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 "
naxxramas.h
"
9
10
enum
Spells
11
{
12
SPELL_MORTAL_WOUND
= 25646,
13
SPELL_ENRAGE
= 28371,
14
SPELL_DECIMATE
= 28374,
15
SPELL_BERSERK
= 26662,
16
SPELL_INFECTED_WOUND
= 29306
17
};
18
19
enum
Creatures
20
{
21
NPC_ZOMBIE
= 16360
22
};
23
24
Position
const
PosSummon
[3] =
25
{
26
{3267.9f, -3172.1f, 297.42f, 0.94f},
27
{3253.2f, -3132.3f, 297.42f, 0},
28
{3308.3f, -3185.8f, 297.42f, 1.58f},
29
};
30
31
enum
Events
32
{
33
EVENT_WOUND
= 1,
34
EVENT_ENRAGE
,
35
EVENT_DECIMATE
,
36
EVENT_BERSERK
,
37
EVENT_SUMMON
,
38
};
39
40
#define EMOTE_NEARBY " spots a nearby zombie to devour!"
41
42
class
boss_gluth
:
public
CreatureScript
43
{
44
public
:
45
boss_gluth
() :
CreatureScript
(
"boss_gluth"
) { }
46
47
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
48
{
49
return
new
boss_gluthAI
(creature);
50
}
51
52
struct
boss_gluthAI
:
public
BossAI
53
{
54
boss_gluthAI
(
Creature
* creature) :
BossAI
(creature,
BOSS_GLUTH
)
55
{
56
// Do not let Gluth be affected by zombies' debuff
57
me
->ApplySpellImmune(0,
IMMUNITY_ID
,
SPELL_INFECTED_WOUND
,
true
);
58
}
59
60
void
MoveInLineOfSight
(
Unit
* who)
OVERRIDE
61
62
{
63
if
(who->GetEntry() ==
NPC_ZOMBIE
&&
me
->IsWithinDistInMap(who, 7))
64
{
65
SetGazeOn
(who);
67
me
->MonsterTextEmote(
EMOTE_NEARBY
, 0,
true
);
68
}
69
else
70
BossAI::MoveInLineOfSight
(who);
71
}
72
73
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
74
{
75
_EnterCombat
();
76
events
.ScheduleEvent(
EVENT_WOUND
, 10000);
77
events
.ScheduleEvent(
EVENT_ENRAGE
, 15000);
78
events
.ScheduleEvent(
EVENT_DECIMATE
, 105000);
79
events
.ScheduleEvent(
EVENT_BERSERK
, 8*60000);
80
events
.ScheduleEvent(
EVENT_SUMMON
, 15000);
81
}
82
83
void
JustSummoned
(
Creature
* summon)
OVERRIDE
84
{
85
if
(summon->GetEntry() ==
NPC_ZOMBIE
)
86
summon->AI()->AttackStart(
me
);
87
summons
.Summon(summon);
88
}
89
90
void
UpdateAI
(
uint32
diff)
OVERRIDE
91
{
92
if
(!
UpdateVictimWithGaze
() || !
CheckInRoom
())
93
return
;
94
95
events
.Update(diff);
96
97
while
(
uint32
eventId =
events
.ExecuteEvent())
98
{
99
switch
(eventId)
100
{
101
case
EVENT_WOUND
:
102
DoCastVictim
(
SPELL_MORTAL_WOUND
);
103
events
.ScheduleEvent(
EVENT_WOUND
, 10000);
104
break
;
105
case
EVENT_ENRAGE
:
107
DoCast
(
me
,
SPELL_ENRAGE
);
108
events
.ScheduleEvent(
EVENT_ENRAGE
, 15000);
109
break
;
110
case
EVENT_DECIMATE
:
112
DoCastAOE
(
SPELL_DECIMATE
);
113
events
.ScheduleEvent(
EVENT_DECIMATE
, 105000);
114
break
;
115
case
EVENT_BERSERK
:
116
DoCast
(
me
,
SPELL_BERSERK
);
117
events
.ScheduleEvent(
EVENT_BERSERK
, 5*60000);
118
break
;
119
case
EVENT_SUMMON
:
120
for
(
int32
i = 0; i <
RAID_MODE
(1, 2); ++i)
121
DoSummon
(
NPC_ZOMBIE
,
PosSummon
[rand() %
RAID_MODE
(1, 3)]);
122
events
.ScheduleEvent(
EVENT_SUMMON
, 10000);
123
break
;
124
}
125
}
126
127
if
(
me
->GetVictim() &&
me
->GetVictim()->GetEntry() ==
NPC_ZOMBIE
)
128
{
129
if
(
me
->IsWithinMeleeRange(
me
->GetVictim()))
130
{
131
me
->Kill(
me
->GetVictim());
132
me
->ModifyHealth(
int32
(
me
->CountPctFromMaxHealth(5)));
133
}
134
}
135
else
136
DoMeleeAttackIfReady
();
137
}
138
};
139
};
140
141
void
AddSC_boss_gluth
()
142
{
143
new
boss_gluth
();
144
}
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
ScriptMgr.h
ScriptedCreature.h
IMMUNITY_ID
@ IMMUNITY_ID
Definition
SharedDefines.h:1602
Creatures
Creatures
Definition
alterac_valley.cpp:28
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
alterac_valley.cpp:14
Events
Events
Definition
alterac_valley.cpp:40
EVENT_ENRAGE
@ EVENT_ENRAGE
Definition
alterac_valley.cpp:45
NPC_ZOMBIE
@ NPC_ZOMBIE
Definition
boss_dathrohan_balnazzar.cpp:38
SPELL_DECIMATE
@ SPELL_DECIMATE
Definition
boss_festergut.cpp:39
EVENT_DECIMATE
@ EVENT_DECIMATE
Definition
boss_festergut.cpp:58
SPELL_BERSERK
#define SPELL_BERSERK
Definition
boss_four_horsemen.cpp:62
PosSummon
Position const PosSummon[3]
Definition
boss_gluth.cpp:24
NPC_ZOMBIE
@ NPC_ZOMBIE
Definition
boss_gluth.cpp:21
EMOTE_NEARBY
#define EMOTE_NEARBY
Definition
boss_gluth.cpp:40
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
boss_gluth.cpp:13
SPELL_DECIMATE
@ SPELL_DECIMATE
Definition
boss_gluth.cpp:14
SPELL_BERSERK
@ SPELL_BERSERK
Definition
boss_gluth.cpp:15
SPELL_MORTAL_WOUND
@ SPELL_MORTAL_WOUND
Definition
boss_gluth.cpp:12
SPELL_INFECTED_WOUND
@ SPELL_INFECTED_WOUND
Definition
boss_gluth.cpp:16
AddSC_boss_gluth
void AddSC_boss_gluth()
Definition
boss_gluth.cpp:141
EVENT_ENRAGE
@ EVENT_ENRAGE
Definition
boss_gluth.cpp:34
EVENT_WOUND
@ EVENT_WOUND
Definition
boss_gluth.cpp:33
EVENT_BERSERK
@ EVENT_BERSERK
Definition
boss_gluth.cpp:36
EVENT_SUMMON
@ EVENT_SUMMON
Definition
boss_gluth.cpp:37
EVENT_DECIMATE
@ EVENT_DECIMATE
Definition
boss_gluth.cpp:35
EVENT_BERSERK
@ EVENT_BERSERK
Definition
boss_occuthar.cpp:31
SPELL_MORTAL_WOUND
@ SPELL_MORTAL_WOUND
Definition
boss_temporus.cpp:26
SPELL_INFECTED_WOUND
@ SPELL_INFECTED_WOUND
Definition
boss_trollgore.cpp:14
BossAI::CheckInRoom
bool CheckInRoom()
Definition
ScriptedCreature.h:427
BossAI::summons
SummonList summons
Definition
ScriptedCreature.h:440
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::MoveInLineOfSight
virtual void MoveInLineOfSight(Unit *)
Definition
CreatureAI.cpp:114
CreatureAI::DoSummon
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition
CreatureAI.cpp:235
CreatureAI::UpdateVictimWithGaze
bool UpdateVictimWithGaze()
Definition
CreatureAI.cpp:174
CreatureAI::SetGazeOn
void SetGazeOn(Unit *target)
Definition
CreatureAI.cpp:165
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
UnitAI::DoCastAOE
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:176
Unit
Definition
Unit.h:1367
boss_gluth
Definition
boss_gluth.cpp:43
boss_gluth::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_gluth.cpp:47
boss_gluth::boss_gluth
boss_gluth()
Definition
boss_gluth.cpp:45
naxxramas.h
BOSS_GLUTH
@ BOSS_GLUTH
Definition
naxxramas.h:21
Position
Definition
Object.h:274
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::RAID_MODE
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition
ScriptedCreature.h:310
boss_gluth::boss_gluthAI
Definition
boss_gluth.cpp:53
boss_gluth::boss_gluthAI::boss_gluthAI
boss_gluthAI(Creature *creature)
Definition
boss_gluth.cpp:54
boss_gluth::boss_gluthAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *who) OVERRIDE
Definition
boss_gluth.cpp:60
boss_gluth::boss_gluthAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_gluth.cpp:90
boss_gluth::boss_gluthAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_gluth.cpp:73
boss_gluth::boss_gluthAI::JustSummoned
void JustSummoned(Creature *summon) OVERRIDE
Definition
boss_gluth.cpp:83
src
server
scripts
Northrend
Naxxramas
boss_gluth.cpp
Generated on
for Project SkyFire Core by
1.17.0