Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_loatheb.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 "
SpellAuraEffects.h
"
10
#include "
naxxramas.h
"
11
12
enum
Spells
13
{
14
SPELL_NECROTIC_AURA
= 55593,
15
SPELL_WARN_NECROTIC_AURA
= 59481,
16
SPELL_SUMMON_SPORE
= 29234,
17
SPELL_DEATHBLOOM
= 29865,
18
H_SPELL_DEATHBLOOM
= 55053,
19
SPELL_INEVITABLE_DOOM
= 29204,
20
H_SPELL_INEVITABLE_DOOM
= 55052
21
};
22
23
enum
Texts
24
{
25
SAY_NECROTIC_AURA_APPLIED
= 0,
26
SAY_NECROTIC_AURA_REMOVED
= 1,
27
SAY_NECROTIC_AURA_FADING
= 2,
28
};
29
30
enum
Events
31
{
32
EVENT_NECROTIC_AURA
= 1,
33
EVENT_DEATHBLOOM
= 2,
34
EVENT_INEVITABLE_DOOM
= 3,
35
EVENT_SPORE
= 4,
36
EVENT_NECROTIC_AURA_FADING
= 5,
37
};
38
39
enum
Achievement
40
{
41
DATA_ACHIEVEMENT_SPORE_LOSER
= 21822183,
42
};
43
44
class
boss_loatheb
:
public
CreatureScript
45
{
46
public
:
47
boss_loatheb
() :
CreatureScript
(
"boss_loatheb"
) {}
48
49
struct
boss_loathebAI
:
public
BossAI
50
{
51
boss_loathebAI
(
Creature
* creature) :
BossAI
(creature,
BOSS_LOATHEB
)
52
{
53
_sporeLoserData
=
false
;
54
_doomCounter
= 0;
55
}
56
57
void
Reset
()
OVERRIDE
58
{
59
_Reset
();
60
_doomCounter
= 0;
61
_sporeLoserData
=
true
;
62
}
63
64
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
65
{
66
_EnterCombat
();
67
events
.ScheduleEvent(
EVENT_NECROTIC_AURA
, 17000);
68
events
.ScheduleEvent(
EVENT_DEATHBLOOM
, 5000);
69
events
.ScheduleEvent(
EVENT_SPORE
,
IsHeroic
() ? 18000 : 36000);
70
events
.ScheduleEvent(
EVENT_INEVITABLE_DOOM
, 120000);
71
}
72
73
void
SummonedCreatureDies
(
Creature
*
/*summon*/
,
Unit
*
/*killer*/
)
OVERRIDE
74
{
75
_sporeLoserData
=
false
;
76
}
77
78
uint32
GetData
(
uint32
id
)
const
OVERRIDE
79
{
80
if
(
id
!=
DATA_ACHIEVEMENT_SPORE_LOSER
)
81
return
0;
82
83
return
uint32
(
_sporeLoserData
);
84
}
85
86
void
UpdateAI
(
uint32
diff)
OVERRIDE
87
{
88
if
(!
UpdateVictim
())
89
return
;
90
91
events
.Update(diff);
92
93
while
(
uint32
eventId =
events
.ExecuteEvent())
94
{
95
switch
(eventId)
96
{
97
case
EVENT_NECROTIC_AURA
:
98
DoCastAOE
(
SPELL_NECROTIC_AURA
);
99
DoCast
(
me
,
SPELL_WARN_NECROTIC_AURA
);
100
events
.ScheduleEvent(
EVENT_NECROTIC_AURA
, 20000);
101
events
.ScheduleEvent(
EVENT_NECROTIC_AURA_FADING
, 14000);
102
break
;
103
case
EVENT_DEATHBLOOM
:
104
DoCastAOE
(
RAID_MODE
(
SPELL_DEATHBLOOM
,
H_SPELL_DEATHBLOOM
));
105
events
.ScheduleEvent(
EVENT_DEATHBLOOM
, 30000);
106
break
;
107
case
EVENT_INEVITABLE_DOOM
:
108
_doomCounter
++;
109
DoCastAOE
(
RAID_MODE
(
SPELL_INEVITABLE_DOOM
,
H_SPELL_INEVITABLE_DOOM
));
110
events
.ScheduleEvent(
EVENT_INEVITABLE_DOOM
, std::max(120000 -
_doomCounter
* 15000, 15000));
// needs to be confirmed
111
break
;
112
case
EVENT_SPORE
:
113
DoCast
(
me
,
SPELL_SUMMON_SPORE
,
false
);
114
events
.ScheduleEvent(
EVENT_SPORE
,
IsHeroic
() ? 18000 : 36000);
115
break
;
116
case
EVENT_NECROTIC_AURA_FADING
:
117
Talk
(
SAY_NECROTIC_AURA_FADING
);
118
break
;
119
default
:
120
break
;
121
}
122
}
123
124
DoMeleeAttackIfReady
();
125
}
126
127
private
:
128
bool
_sporeLoserData
;
129
uint8
_doomCounter
;
130
};
131
132
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
133
{
134
return
new
boss_loathebAI
(creature);
135
}
136
};
137
138
class
achievement_spore_loser
:
public
AchievementCriteriaScript
139
{
140
public
:
141
achievement_spore_loser
() :
AchievementCriteriaScript
(
"achievement_spore_loser"
) {}
142
143
bool
OnCheck
(
Player
*
/*source*/
,
Unit
* target)
OVERRIDE
144
{
145
return
target && target->GetAI()->GetData(
DATA_ACHIEVEMENT_SPORE_LOSER
);
146
}
147
};
148
149
typedef
boss_loatheb::boss_loathebAI
LoathebAI
;
150
151
class
spell_loatheb_necrotic_aura_warning
:
public
SpellScriptLoader
152
{
153
public
:
154
spell_loatheb_necrotic_aura_warning
() :
SpellScriptLoader
(
"spell_loatheb_necrotic_aura_warning"
) {}
155
156
class
spell_loatheb_necrotic_aura_warning_AuraScript
:
public
AuraScript
157
{
158
PrepareAuraScript
(
spell_loatheb_necrotic_aura_warning_AuraScript
);
159
160
bool
Validate
(
SpellInfo
const
*
/*spell*/
)
OVERRIDE
161
{
162
if
(!
sSpellStore
.LookupEntry(
SPELL_WARN_NECROTIC_AURA
))
163
return
false
;
164
return
true
;
165
}
166
167
void
HandleEffectApply
(
AuraEffect
const
*
/*aurEff*/
,
AuraEffectHandleModes
/*mode*/
)
168
{
169
if
(
GetTarget
()->IsAIEnabled)
170
CAST_AI
(
LoathebAI
,
GetTarget
()->GetAI())->Talk(
SAY_NECROTIC_AURA_APPLIED
);
171
}
172
173
void
HandleEffectRemove
(
AuraEffect
const
*
/*aurEff*/
,
AuraEffectHandleModes
/*mode*/
)
174
{
175
if
(
GetTarget
()->IsAIEnabled)
176
CAST_AI
(
LoathebAI
,
GetTarget
()->GetAI())->Talk(
SAY_NECROTIC_AURA_REMOVED
);
177
}
178
179
void
Register
()
OVERRIDE
180
{
181
AfterEffectApply
+=
AuraEffectApplyFn
(
spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectApply
,
EFFECT_0
,
SPELL_AURA_DUMMY
,
AURA_EFFECT_HANDLE_REAL
);
182
AfterEffectRemove
+=
AuraEffectRemoveFn
(
spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectRemove
,
EFFECT_0
,
SPELL_AURA_DUMMY
,
AURA_EFFECT_HANDLE_REAL
);
183
}
184
};
185
186
AuraScript
*
GetAuraScript
() const
OVERRIDE
187
{
188
return
new
spell_loatheb_necrotic_aura_warning_AuraScript
();
189
}
190
};
191
192
void
AddSC_boss_loatheb
()
193
{
194
new
boss_loatheb
();
195
new
achievement_spore_loser
();
196
new
spell_loatheb_necrotic_aura_warning
();
197
}
Spells
Spells
Definition
BattlegroundIC.h:645
sSpellStore
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
uint8
std::uint8_t uint8
Definition
Define.h:79
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ScriptMgr.h
ScriptedCreature.h
CAST_AI
#define CAST_AI(a, b)
Definition
ScriptedCreature.h:14
EFFECT_0
@ EFFECT_0
Definition
SharedDefines.h:18
SPELL_AURA_DUMMY
@ SPELL_AURA_DUMMY
Definition
SpellAuraDefines.h:51
AuraEffectHandleModes
AuraEffectHandleModes
Definition
SpellAuraDefines.h:24
AURA_EFFECT_HANDLE_REAL
@ AURA_EFFECT_HANDLE_REAL
Definition
SpellAuraDefines.h:26
SpellAuraEffects.h
SpellScript.h
AuraEffectApplyFn
#define AuraEffectApplyFn(F, I, N, M)
Definition
SpellScript.h:652
AuraEffectRemoveFn
#define AuraEffectRemoveFn(F, I, N, M)
Definition
SpellScript.h:663
Events
Events
Definition
alterac_valley.cpp:40
Texts
Texts
Definition
boss_alizabal.cpp:13
AddSC_boss_loatheb
void AddSC_boss_loatheb()
Definition
boss_loatheb.cpp:192
Achievement
Achievement
Definition
boss_loatheb.cpp:40
DATA_ACHIEVEMENT_SPORE_LOSER
@ DATA_ACHIEVEMENT_SPORE_LOSER
Definition
boss_loatheb.cpp:41
LoathebAI
boss_loatheb::boss_loathebAI LoathebAI
Definition
boss_loatheb.cpp:149
SPELL_INEVITABLE_DOOM
@ SPELL_INEVITABLE_DOOM
Definition
boss_loatheb.cpp:19
H_SPELL_DEATHBLOOM
@ H_SPELL_DEATHBLOOM
Definition
boss_loatheb.cpp:18
SPELL_SUMMON_SPORE
@ SPELL_SUMMON_SPORE
Definition
boss_loatheb.cpp:16
SPELL_DEATHBLOOM
@ SPELL_DEATHBLOOM
Definition
boss_loatheb.cpp:17
SPELL_NECROTIC_AURA
@ SPELL_NECROTIC_AURA
Definition
boss_loatheb.cpp:14
H_SPELL_INEVITABLE_DOOM
@ H_SPELL_INEVITABLE_DOOM
Definition
boss_loatheb.cpp:20
SPELL_WARN_NECROTIC_AURA
@ SPELL_WARN_NECROTIC_AURA
Definition
boss_loatheb.cpp:15
SAY_NECROTIC_AURA_REMOVED
@ SAY_NECROTIC_AURA_REMOVED
Definition
boss_loatheb.cpp:26
SAY_NECROTIC_AURA_APPLIED
@ SAY_NECROTIC_AURA_APPLIED
Definition
boss_loatheb.cpp:25
SAY_NECROTIC_AURA_FADING
@ SAY_NECROTIC_AURA_FADING
Definition
boss_loatheb.cpp:27
EVENT_NECROTIC_AURA_FADING
@ EVENT_NECROTIC_AURA_FADING
Definition
boss_loatheb.cpp:36
EVENT_SPORE
@ EVENT_SPORE
Definition
boss_loatheb.cpp:35
EVENT_NECROTIC_AURA
@ EVENT_NECROTIC_AURA
Definition
boss_loatheb.cpp:32
EVENT_DEATHBLOOM
@ EVENT_DEATHBLOOM
Definition
boss_loatheb.cpp:33
EVENT_INEVITABLE_DOOM
@ EVENT_INEVITABLE_DOOM
Definition
boss_loatheb.cpp:34
AchievementCriteriaScript::AchievementCriteriaScript
AchievementCriteriaScript(const char *name)
Definition
ScriptMgr.cpp:1508
AuraEffect
Definition
SpellAuraEffects.h:18
AuraScript
Definition
SpellScript.h:436
AuraScript::AfterEffectRemove
HookList< EffectApplyHandler > AfterEffectRemove
Definition
SpellScript.h:662
AuraScript::AfterEffectApply
HookList< EffectApplyHandler > AfterEffectApply
Definition
SpellScript.h:651
AuraScript::AuraScript
AuraScript()
Definition
SpellScript.h:597
AuraScript::GetTarget
Unit * GetTarget() const
Definition
SpellScript.cpp:1085
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
BossAI::_Reset
void _Reset()
Definition
ScriptedCreature.cpp:462
BossAI::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
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
Player
Definition
Player.h:1289
SpellInfo
Definition
SpellInfo.h:158
SpellScriptLoader::SpellScriptLoader
SpellScriptLoader(const char *name)
Definition
ScriptMgr.cpp:1372
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::DoCastAOE
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:176
Unit
Definition
Unit.h:1367
achievement_spore_loser
Definition
boss_loatheb.cpp:139
achievement_spore_loser::OnCheck
bool OnCheck(Player *, Unit *target) OVERRIDE
Definition
boss_loatheb.cpp:143
achievement_spore_loser::achievement_spore_loser
achievement_spore_loser()
Definition
boss_loatheb.cpp:141
boss_loatheb
Definition
boss_loatheb.cpp:45
boss_loatheb::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_loatheb.cpp:132
boss_loatheb::boss_loatheb
boss_loatheb()
Definition
boss_loatheb.cpp:47
spell_loatheb_necrotic_aura_warning::spell_loatheb_necrotic_aura_warning_AuraScript
Definition
boss_loatheb.cpp:157
spell_loatheb_necrotic_aura_warning::spell_loatheb_necrotic_aura_warning_AuraScript::Validate
bool Validate(SpellInfo const *) OVERRIDE
Definition
boss_loatheb.cpp:160
spell_loatheb_necrotic_aura_warning::spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectApply
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
Definition
boss_loatheb.cpp:167
spell_loatheb_necrotic_aura_warning::spell_loatheb_necrotic_aura_warning_AuraScript::Register
void Register() OVERRIDE
Definition
boss_loatheb.cpp:179
spell_loatheb_necrotic_aura_warning::spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectRemove
void HandleEffectRemove(AuraEffect const *, AuraEffectHandleModes)
Definition
boss_loatheb.cpp:173
spell_loatheb_necrotic_aura_warning::spell_loatheb_necrotic_aura_warning_AuraScript::PrepareAuraScript
PrepareAuraScript(spell_loatheb_necrotic_aura_warning_AuraScript)
spell_loatheb_necrotic_aura_warning
Definition
boss_loatheb.cpp:152
spell_loatheb_necrotic_aura_warning::GetAuraScript
AuraScript * GetAuraScript() const OVERRIDE
Definition
boss_loatheb.cpp:186
spell_loatheb_necrotic_aura_warning::spell_loatheb_necrotic_aura_warning
spell_loatheb_necrotic_aura_warning()
Definition
boss_loatheb.cpp:154
naxxramas.h
BOSS_LOATHEB
@ BOSS_LOATHEB
Definition
naxxramas.h:18
ScriptedAI::IsHeroic
bool IsHeroic() const
Definition
ScriptedCreature.h:279
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_loatheb::boss_loathebAI
Definition
boss_loatheb.cpp:50
boss_loatheb::boss_loathebAI::_doomCounter
uint8 _doomCounter
Definition
boss_loatheb.cpp:129
boss_loatheb::boss_loathebAI::boss_loathebAI
boss_loathebAI(Creature *creature)
Definition
boss_loatheb.cpp:51
boss_loatheb::boss_loathebAI::Reset
void Reset() OVERRIDE
Definition
boss_loatheb.cpp:57
boss_loatheb::boss_loathebAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_loatheb.cpp:64
boss_loatheb::boss_loathebAI::SummonedCreatureDies
void SummonedCreatureDies(Creature *, Unit *) OVERRIDE
Definition
boss_loatheb.cpp:73
boss_loatheb::boss_loathebAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_loatheb.cpp:86
boss_loatheb::boss_loathebAI::_sporeLoserData
bool _sporeLoserData
Definition
boss_loatheb.cpp:128
boss_loatheb::boss_loathebAI::GetData
uint32 GetData(uint32 id) const OVERRIDE
Definition
boss_loatheb.cpp:78
src
server
scripts
Northrend
Naxxramas
boss_loatheb.cpp
Generated on
for Project SkyFire Core by
1.17.0