TrinityCore
Loading...
Searching...
No Matches
boss_vanndar.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 "
ScriptedCreature.h
"
20
21
enum
Yells
22
{
23
YELL_AGGRO
= 0,
24
YELL_EVADE
= 1,
25
//YELL_RESPAWN1 = -1810010, // Missing in database
26
//YELL_RESPAWN2 = -1810011, // Missing in database
27
YELL_RANDOM
= 2,
28
YELL_SPELL
= 3,
29
};
30
31
enum
Spells
32
{
33
SPELL_AVATAR
= 19135,
34
SPELL_THUNDERCLAP
= 15588,
35
SPELL_STORMBOLT
= 20685
// not sure
36
};
37
38
struct
boss_vanndar
:
public
ScriptedAI
39
{
40
boss_vanndar
(
Creature
* creature) :
ScriptedAI
(creature) { }
41
42
void
Reset
()
override
43
{
44
_scheduler
.
CancelAll
();
45
}
46
47
void
JustEngagedWith
(
Unit
*
/*who*/
)
override
48
{
49
_scheduler
50
.
Schedule
(3s, [
this
](
TaskContext
task)
51
{
52
DoCastVictim
(
SPELL_AVATAR
);
53
task.
Repeat
(15s, 20s);
54
})
55
.Schedule(4s, [
this
](
TaskContext
task)
56
{
57
DoCastVictim
(
SPELL_THUNDERCLAP
);
58
task.
Repeat
(5s, 15s);
59
})
60
.Schedule(6s, [
this
](
TaskContext
task)
61
{
62
DoCastVictim
(
SPELL_STORMBOLT
);
63
task.
Repeat
(10s, 25s);
64
})
65
.Schedule(20s, 30s, [
this
](
TaskContext
task)
66
{
67
Talk
(
YELL_RANDOM
);
68
task.
Repeat
(20s, 30s);
69
})
70
.Schedule(5s, [
this
](
TaskContext
task)
71
{
72
if
(
me
->
GetDistance2d
(
me
->
GetHomePosition
().GetPositionX(),
me
->
GetHomePosition
().GetPositionY()) > 50)
73
{
74
EnterEvadeMode
();
75
Talk
(
YELL_EVADE
);
76
}
77
task.
Repeat
();
78
});
79
80
Talk
(
YELL_AGGRO
);
81
}
82
83
void
UpdateAI
(
uint32
diff)
override
84
{
85
if
(!
UpdateVictim
())
86
return
;
87
88
_scheduler
.
Update
(diff, [
this
]
89
{
90
DoMeleeAttackIfReady
();
91
});
92
}
93
94
private
:
95
TaskScheduler
_scheduler
;
96
};
97
98
void
AddSC_boss_vanndar
()
99
{
100
RegisterCreatureAI
(
boss_vanndar
);
101
}
uint32
uint32_t uint32
Definition
Define.h:133
Spells
Spells
Definition
PlayerAI.cpp:32
ScriptMgr.h
RegisterCreatureAI
#define RegisterCreatureAI(ai_name)
Definition
ScriptMgr.h:1139
ScriptedCreature.h
Talk
Talk
Definition
boss_hadronox.cpp:129
Yells
Yells
Definition
boss_vanndar.cpp:22
YELL_RANDOM
@ YELL_RANDOM
Definition
boss_vanndar.cpp:27
YELL_EVADE
@ YELL_EVADE
Definition
boss_vanndar.cpp:24
YELL_SPELL
@ YELL_SPELL
Definition
boss_vanndar.cpp:28
YELL_AGGRO
@ YELL_AGGRO
Definition
boss_vanndar.cpp:23
AddSC_boss_vanndar
void AddSC_boss_vanndar()
Definition
boss_vanndar.cpp:98
SPELL_AVATAR
@ SPELL_AVATAR
Definition
boss_vanndar.cpp:33
SPELL_THUNDERCLAP
@ SPELL_THUNDERCLAP
Definition
boss_vanndar.cpp:34
SPELL_STORMBOLT
@ SPELL_STORMBOLT
Definition
boss_vanndar.cpp:35
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:240
CreatureAI::me
Creature *const me
Definition
CreatureAI.h:82
CreatureAI::EnterEvadeMode
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition
CreatureAI.cpp:214
Creature
Definition
Creature.h:62
Creature::GetHomePosition
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition
Creature.h:295
TaskContext
Definition
TaskScheduler.h:392
TaskContext::Repeat
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition
TaskScheduler.h:462
TaskScheduler
Definition
TaskScheduler.h:48
TaskScheduler::CancelAll
TaskScheduler & CancelAll()
Definition
TaskScheduler.cpp:45
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
Unit
Definition
Unit.h:769
WorldObject::GetDistance2d
float GetDistance2d(WorldObject const *obj) const
Definition
Object.cpp:1141
ScriptedAI
Definition
ScriptedCreature.h:132
boss_vanndar
Definition
boss_vanndar.cpp:39
boss_vanndar::_scheduler
TaskScheduler _scheduler
Definition
boss_vanndar.cpp:95
boss_vanndar::Reset
void Reset() override
Definition
boss_vanndar.cpp:42
boss_vanndar::JustEngagedWith
void JustEngagedWith(Unit *) override
Definition
boss_vanndar.cpp:47
boss_vanndar::UpdateAI
void UpdateAI(uint32 diff) override
Definition
boss_vanndar.cpp:83
boss_vanndar::boss_vanndar
boss_vanndar(Creature *creature)
Definition
boss_vanndar.cpp:40
server
scripts
EasternKingdoms
AlteracValley
boss_vanndar.cpp
Generated on Sun May 10 2026 02:30:19 for TrinityCore by
1.9.8