TrinityCore
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
Spells
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
struct
boss_lavanthor
:
public
BossAI
32
{
33
boss_lavanthor
(
Creature
* creature) :
BossAI
(creature,
DATA_LAVANTHOR
) { }
34
35
void
Reset
()
override
36
{
37
BossAI::Reset
();
38
}
39
40
void
JustEngagedWith
(
Unit
* who)
override
41
{
42
BossAI::JustEngagedWith
(who);
43
}
44
45
void
JustReachedHome
()
override
46
{
47
BossAI::JustReachedHome
();
48
instance
->
SetData
(
DATA_HANDLE_CELLS
,
DATA_LAVANTHOR
);
49
}
50
51
void
UpdateAI
(
uint32
diff)
override
52
{
53
if
(!
UpdateVictim
())
54
return
;
55
56
scheduler
.
Update
(diff);
57
}
58
59
void
ScheduleTasks
()
override
60
{
61
scheduler
.
Schedule
(
Seconds
(1), [
this
](
TaskContext
task)
62
{
63
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 40.0f,
true
))
64
DoCast
(target,
SPELL_FIREBOLT
);
65
task.
Repeat
(
Seconds
(5),
Seconds
(13));
66
});
67
68
scheduler
.
Schedule
(
Seconds
(5), [
this
](
TaskContext
task)
69
{
70
DoCastVictim
(
SPELL_FLAME_BREATH
);
71
task.
Repeat
(
Seconds
(10),
Seconds
(15));
72
});
73
74
scheduler
.
Schedule
(
Seconds
(10), [
this
](
TaskContext
task)
75
{
76
if
(
Unit
* target =
SelectTarget
(
SelectTargetMethod::Random
, 0, 50.0f))
77
DoCast
(target,
SPELL_LAVA_BURN
);
78
task.
Repeat
(
Seconds
(15),
Seconds
(23));
79
});
80
81
if
(
IsHeroic
())
82
{
83
scheduler
.
Schedule
(
Seconds
(3), [
this
](
TaskContext
task)
84
{
85
DoCastAOE
(
SPELL_CAUTERIZING_FLAMES
);
86
task.
Repeat
(
Seconds
(10),
Seconds
(16));
87
});
88
}
89
}
90
};
91
92
void
AddSC_boss_lavanthor
()
93
{
94
RegisterVioletHoldCreatureAI
(
boss_lavanthor
);
95
}
uint32
uint32_t uint32
Definition:
Define.h:142
Seconds
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition:
Duration.h:32
InstanceScript.h
Spells
Spells
Definition:
PlayerAI.cpp:32
ScriptMgr.h
ScriptedCreature.h
SelectTargetMethod::Random
@ Random
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:92
BossAI
Definition:
ScriptedCreature.h:312
BossAI::instance
InstanceScript *const instance
Definition:
ScriptedCreature.h:317
BossAI::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition:
ScriptedCreature.h:333
BossAI::scheduler
TaskScheduler scheduler
Definition:
ScriptedCreature.h:352
BossAI::JustReachedHome
void JustReachedHome() override
Definition:
ScriptedCreature.h:335
BossAI::Reset
void Reset() override
Definition:
ScriptedCreature.h:332
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition:
CreatureAI.cpp:245
Creature
Definition:
Creature.h:70
TaskContext
Definition:
TaskScheduler.h:392
TaskContext::Repeat
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
Definition:
TaskScheduler.h:470
TaskScheduler::Schedule
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
Definition:
TaskScheduler.h:225
TaskScheduler::Update
TaskScheduler & Update(success_t const &callback=nullptr)
Definition:
TaskScheduler.cpp:27
UnitAI::DoCastVictim
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition:
UnitAI.cpp:180
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:79
UnitAI::DoCastAOE
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition:
UnitAI.h:161
UnitAI::DoCast
SpellCastResult DoCast(uint32 spellId)
Definition:
UnitAI.cpp:89
Unit
Definition:
Unit.h:627
ZoneScript::SetData
virtual void SetData(uint32, uint32)
Definition:
ZoneScript.h:92
ScriptedAI::IsHeroic
bool IsHeroic() const
Definition:
ScriptedCreature.cpp:313
boss_lavanthor
Definition:
boss_lavanthor.cpp:32
boss_lavanthor::UpdateAI
void UpdateAI(uint32 diff) override
Definition:
boss_lavanthor.cpp:51
boss_lavanthor::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition:
boss_lavanthor.cpp:40
boss_lavanthor::Reset
void Reset() override
Definition:
boss_lavanthor.cpp:35
boss_lavanthor::ScheduleTasks
void ScheduleTasks() override
Definition:
boss_lavanthor.cpp:59
boss_lavanthor::JustReachedHome
void JustReachedHome() override
Definition:
boss_lavanthor.cpp:45
boss_lavanthor::boss_lavanthor
boss_lavanthor(Creature *creature)
Definition:
boss_lavanthor.cpp:33
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 on Thu Mar 14 2024 23:39:32 for TrinityCore by
1.9.4