TrinityCore
Loading...
Searching...
No Matches
boss_lavanthor.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#include "
ScriptMgr.h
"
19
#include "
InstanceScript.h
"
20
#include "
ScriptedCreature.h
"
21
#include "
violet_hold.h
"
22
23
enum
LavanthorSpells
24
{
25
SPELL_CAUTERIZING_FLAMES
= 59466,
// Only in heroic
26
SPELL_FIREBOLT
= 54235,
27
SPELL_FLAME_BREATH
= 54282,
28
SPELL_LAVA_BURN
= 54249
29
};
30
31
// 29312 - Lavanthor
32
// 32237 - Lava Hound
33
struct
boss_lavanthor
:
public
BossAI
34
{
35
boss_lavanthor
(
Creature
* creature) :
BossAI
(creature,
DATA_LAVANTHOR
) { }
36
37
void
Reset
()
override
38
{
39
BossAI::Reset
();
40
}
41
42
void
JustEngagedWith
(
Unit
* who)
override
43
{
44
BossAI::JustEngagedWith
(who);
45
}
46
47
void
JustReachedHome
()
override
48
{
49
BossAI::JustReachedHome
();
50
instance
->
SetData
(
DATA_HANDLE_CELLS
,
DATA_LAVANTHOR
);
51
}
52
53
void
UpdateAI
(
uint32
diff)
override
54
{
55
if
(!
UpdateVictim
())
56
return
;
57
58
scheduler
.
Update
(diff,
59
std::bind(&
BossAI::DoMeleeAttackIfReady
,
this
));
60
}
61
62
void
ScheduleTasks
()
override
63
{
64
scheduler
.
Schedule
(1s, [
this
](
TaskContext
task)
65
{
66
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 40.0f,
true
))
67
DoCast
(target,
SPELL_FIREBOLT
);
68
task.
Repeat
(5s, 13s);
69
});
70
71
scheduler
.
Schedule
(5s, [
this
](
TaskContext
task)
72
{
73
DoCastVictim
(
SPELL_FLAME_BREATH
);
74
task.
Repeat
(10s, 15s);
75
});
76
77
scheduler
.
Schedule
(10s, [
this
](
TaskContext
task)
78
{
79
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 50.0f))
80
DoCast
(target,
SPELL_LAVA_BURN
);
81
task.
Repeat
(15s, 23s);
82
});
83
84
if
(
IsHeroic
())
85
{
86
scheduler
.
Schedule
(
Seconds
(3), [
this
](
TaskContext
task)
87
{
88
DoCastAOE
(
SPELL_CAUTERIZING_FLAMES
);
89
task.
Repeat
(10s, 16s);
90
});
91
}
92
}
93
};
94
95
void
AddSC_boss_lavanthor
()
96
{
97
RegisterVioletHoldCreatureAI
(
boss_lavanthor
);
98
}
uint32
uint32_t uint32
Definition
Define.h:133
Seconds
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition
Duration.h:27
InstanceScript.h
ScriptMgr.h
ScriptedCreature.h
SelectTargetMethod::Random
@ Random
LavanthorSpells
LavanthorSpells
Definition
boss_lavanthor.cpp:24
SPELL_FLAME_BREATH
@ SPELL_FLAME_BREATH
Definition
boss_lavanthor.cpp:27
SPELL_FIREBOLT
@ SPELL_FIREBOLT
Definition
boss_lavanthor.cpp:26
SPELL_LAVA_BURN
@ SPELL_LAVA_BURN
Definition
boss_lavanthor.cpp:28
SPELL_CAUTERIZING_FLAMES
@ SPELL_CAUTERIZING_FLAMES
Definition
boss_lavanthor.cpp:25
AddSC_boss_lavanthor
void AddSC_boss_lavanthor()
Definition
boss_lavanthor.cpp:95
BossAI
Definition
ScriptedCreature.h:313
BossAI::instance
InstanceScript *const instance
Definition
ScriptedCreature.h:318
BossAI::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
ScriptedCreature.h:334
BossAI::scheduler
TaskScheduler scheduler
Definition
ScriptedCreature.h:351
BossAI::JustReachedHome
void JustReachedHome() override
Definition
ScriptedCreature.h:336
BossAI::Reset
void Reset() override
Definition
ScriptedCreature.h:333
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:240
Creature
Definition
Creature.h:62
TaskContext
Definition
TaskScheduler.h:392
TaskContext::Repeat
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition
TaskScheduler.h:462
TaskScheduler::Schedule
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition
TaskScheduler.h:225
TaskScheduler::Update
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition
TaskScheduler.cpp:27
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:54
UnitAI::DoCastVictim
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.cpp:166
UnitAI::SelectTarget
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition
UnitAI.cpp:96
UnitAI::DoCastAOE
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.h:243
UnitAI::DoCast
SpellCastResult DoCast(uint32 spellId)
Definition
UnitAI.cpp:106
Unit
Definition
Unit.h:769
ZoneScript::SetData
virtual void SetData(uint32, uint32)
Definition
ZoneScript.h:56
ScriptedAI::IsHeroic
bool IsHeroic() const
Definition
ScriptedCreature.h:242
boss_lavanthor
Definition
boss_lavanthor.cpp:34
boss_lavanthor::UpdateAI
void UpdateAI(uint32 diff) override
Definition
boss_lavanthor.cpp:53
boss_lavanthor::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
boss_lavanthor.cpp:42
boss_lavanthor::Reset
void Reset() override
Definition
boss_lavanthor.cpp:37
boss_lavanthor::ScheduleTasks
void ScheduleTasks() override
Definition
boss_lavanthor.cpp:62
boss_lavanthor::JustReachedHome
void JustReachedHome() override
Definition
boss_lavanthor.cpp:47
boss_lavanthor::boss_lavanthor
boss_lavanthor(Creature *creature)
Definition
boss_lavanthor.cpp:35
violet_hold.h
DATA_HANDLE_CELLS
@ DATA_HANDLE_CELLS
Definition
violet_hold.h:86
DATA_LAVANTHOR
@ DATA_LAVANTHOR
Definition
violet_hold.h:56
RegisterVioletHoldCreatureAI
#define RegisterVioletHoldCreatureAI(ai_name)
Definition
violet_hold.h:163
server
scripts
Northrend
VioletHold
boss_lavanthor.cpp
Generated on Sun May 10 2026 02:30:23 for TrinityCore by
1.9.8