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
24{
25 SPELL_CAUTERIZING_FLAMES = 59466, // Only in heroic
28 SPELL_LAVA_BURN = 54249
29};
30
31// 29312 - Lavanthor
32// 32237 - Lava Hound
33struct boss_lavanthor : public BossAI
34{
35 boss_lavanthor(Creature* creature) : BossAI(creature, DATA_LAVANTHOR) { }
36
37 void Reset() override
38 {
40 }
41
42 void JustEngagedWith(Unit* who) override
43 {
45 }
46
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 {
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 {
88 task.Repeat(10s, 16s);
89 });
90 }
91 }
92};
93
uint32_t uint32
Definition Define.h:154
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:28
LavanthorSpells
@ SPELL_FLAME_BREATH
@ SPELL_FIREBOLT
@ SPELL_LAVA_BURN
@ SPELL_CAUTERIZING_FLAMES
void AddSC_boss_lavanthor()
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
TaskScheduler scheduler
void JustReachedHome() override
void Reset() override
bool UpdateVictim()
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
bool IsHeroic() const
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
void Reset() override
void ScheduleTasks() override
void JustReachedHome() override
boss_lavanthor(Creature *creature)
@ DATA_HANDLE_CELLS
Definition violet_hold.h:87
@ DATA_LAVANTHOR
Definition violet_hold.h:57
#define RegisterVioletHoldCreatureAI(ai_name)