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
}
60
61
void
ScheduleTasks
()
override
62
{
63
scheduler
.
Schedule
(1s, [
this
](
TaskContext
& task)
64
{
65
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 40.0f,
true
))
66
DoCast
(target,
SPELL_FIREBOLT
);
67
task.
Repeat
(5s, 13s);
68
});
69
70
scheduler
.
Schedule
(5s, [
this
](
TaskContext
& task)
71
{
72
DoCastVictim
(
SPELL_FLAME_BREATH
);
73
task.
Repeat
(10s, 15s);
74
});
75
76
scheduler
.
Schedule
(10s, [
this
](
TaskContext
& task)
77
{
78
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 50.0f))
79
DoCast
(target,
SPELL_LAVA_BURN
);
80
task.
Repeat
(15s, 23s);
81
});
82
83
if
(
IsHeroic
())
84
{
85
scheduler
.
Schedule
(
Seconds
(3), [
this
](
TaskContext
& task)
86
{
87
DoCastAOE
(
SPELL_CAUTERIZING_FLAMES
);
88
task.
Repeat
(10s, 16s);
89
});
90
}
91
}
92
};
93
94
void
AddSC_boss_lavanthor
()
95
{
96
RegisterVioletHoldCreatureAI
(
boss_lavanthor
);
97
}
uint32
uint32_t uint32
Definition
Define.h:154
Seconds
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition
Duration.h:28
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:94
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:353
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:244
Creature
Definition
Creature.h:82
TaskContext
Definition
TaskScheduler.h:370
TaskContext::Repeat
TaskContext & Repeat(TaskScheduler::duration_t duration)
Definition
TaskScheduler.cpp:319
TaskScheduler::Schedule
TaskScheduler & Schedule(duration_t time, task_handler_t task)
Definition
TaskScheduler.h:265
TaskScheduler::Update
TaskScheduler & Update()
Update the scheduler to the current time.
Definition
TaskScheduler.cpp:38
UnitAI::DoCastVictim
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.cpp:172
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:71
UnitAI::DoCastAOE
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.h:162
UnitAI::DoCast
SpellCastResult DoCast(uint32 spellId)
Definition
UnitAI.cpp:81
Unit
Definition
Unit.h:647
ZoneScript::SetData
virtual void SetData(uint32, uint32)
Definition
ZoneScript.h:100
ScriptedAI::IsHeroic
bool IsHeroic() const
Definition
ScriptedCreature.cpp:312
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:61
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:87
DATA_LAVANTHOR
@ DATA_LAVANTHOR
Definition
violet_hold.h:57
RegisterVioletHoldCreatureAI
#define RegisterVioletHoldCreatureAI(ai_name)
Definition
violet_hold.h:164
server
scripts
Northrend
VioletHold
boss_lavanthor.cpp
Generated by
1.9.8