Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_vanndar.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#include "
ScriptMgr.h
"
7
#include "
ScriptedCreature.h
"
8
9
enum
Yells
10
{
11
YELL_AGGRO
= 0,
12
YELL_EVADE
= 1,
13
//YELL_RESPAWN1 = -1810010, // Missing in database
14
//YELL_RESPAWN2 = -1810011, // Missing in database
15
YELL_RANDOM
= 2,
16
YELL_SPELL
= 3,
17
};
18
19
enum
Spells
20
{
21
SPELL_AVATAR
= 19135,
22
SPELL_THUNDERCLAP
= 15588,
23
SPELL_STORMBOLT
= 20685
// not sure
24
};
25
26
class
boss_vanndar
:
public
CreatureScript
27
{
28
public
:
29
boss_vanndar
() :
CreatureScript
(
"boss_vanndar"
) { }
30
31
struct
boss_vanndarAI
:
public
ScriptedAI
32
{
33
boss_vanndarAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
34
35
uint32
AvatarTimer
;
36
uint32
ThunderclapTimer
;
37
uint32
StormboltTimer
;
38
uint32
ResetTimer
;
39
uint32
YellTimer
;
40
41
void
Reset
()
OVERRIDE
42
{
43
AvatarTimer
= 3 *
IN_MILLISECONDS
;
44
ThunderclapTimer
= 4 *
IN_MILLISECONDS
;
45
StormboltTimer
= 6 *
IN_MILLISECONDS
;
46
ResetTimer
= 5 *
IN_MILLISECONDS
;
47
YellTimer
= std::rand() % (30 *
IN_MILLISECONDS
) + (20 *
IN_MILLISECONDS
);
48
}
49
50
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
51
{
52
Talk
(
YELL_AGGRO
);
53
}
54
55
void
UpdateAI
(
uint32
diff)
OVERRIDE
56
{
57
if
(!
UpdateVictim
())
58
return
;
59
60
if
(
AvatarTimer
<= diff)
61
{
62
DoCastVictim
(
SPELL_AVATAR
);
63
AvatarTimer
= std::rand() % (20 *
IN_MILLISECONDS
) + (15 *
IN_MILLISECONDS
);
64
}
else
AvatarTimer
-= diff;
65
66
if
(
ThunderclapTimer
<= diff)
67
{
68
DoCastVictim
(
SPELL_THUNDERCLAP
);
69
ThunderclapTimer
= std::rand() % (15 *
IN_MILLISECONDS
) + (5 *
IN_MILLISECONDS
);
70
}
else
ThunderclapTimer
-= diff;
71
72
if
(
StormboltTimer
<= diff)
73
{
74
DoCastVictim
(
SPELL_STORMBOLT
);
75
StormboltTimer
= std::rand() % (25 *
IN_MILLISECONDS
) + (10 *
IN_MILLISECONDS
);
76
}
else
StormboltTimer
-= diff;
77
78
if
(
YellTimer
<= diff)
79
{
80
Talk
(
YELL_RANDOM
);
81
YellTimer
= std::rand() % (30 *
IN_MILLISECONDS
) + (20 *
IN_MILLISECONDS
);
//20 to 30 seconds
82
}
else
YellTimer
-= diff;
83
84
// check if creature is not outside of building
85
if
(
ResetTimer
<= diff)
86
{
87
if
(
me
->GetDistance2d(
me
->GetHomePosition().GetPositionX(),
me
->GetHomePosition().GetPositionY()) > 50)
88
{
89
EnterEvadeMode
();
90
Talk
(
YELL_EVADE
);
91
}
92
ResetTimer
= 5 *
IN_MILLISECONDS
;
93
}
else
ResetTimer
-= diff;
94
95
DoMeleeAttackIfReady
();
96
}
97
};
98
99
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
100
{
101
return
new
boss_vanndarAI
(creature);
102
}
103
};
104
105
void
AddSC_boss_vanndar
()
106
{
107
new
boss_vanndar
;
108
}
Spells
Spells
Definition
BattlegroundIC.h:645
IN_MILLISECONDS
@ IN_MILLISECONDS
Definition
Common.h:125
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ScriptMgr.h
ScriptedCreature.h
YELL_EVADE
@ YELL_EVADE
Definition
boss_balinda.cpp:20
YELL_AGGRO
@ YELL_AGGRO
Definition
boss_balinda.cpp:19
YELL_RANDOM
@ YELL_RANDOM
Definition
boss_drekthar.cpp:26
YELL_RANDOM
@ YELL_RANDOM
Definition
boss_vanndar.cpp:15
YELL_EVADE
@ YELL_EVADE
Definition
boss_vanndar.cpp:12
YELL_SPELL
@ YELL_SPELL
Definition
boss_vanndar.cpp:16
YELL_AGGRO
@ YELL_AGGRO
Definition
boss_vanndar.cpp:11
AddSC_boss_vanndar
void AddSC_boss_vanndar()
Definition
boss_vanndar.cpp:105
SPELL_AVATAR
@ SPELL_AVATAR
Definition
boss_vanndar.cpp:21
SPELL_THUNDERCLAP
@ SPELL_THUNDERCLAP
Definition
boss_vanndar.cpp:22
SPELL_STORMBOLT
@ SPELL_STORMBOLT
Definition
boss_vanndar.cpp:23
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
CreatureAI::EnterEvadeMode
virtual void EnterEvadeMode()
Definition
CreatureAI.cpp:130
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
boss_vanndar
Definition
boss_vanndar.cpp:27
boss_vanndar::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_vanndar.cpp:99
boss_vanndar::boss_vanndar
boss_vanndar()
Definition
boss_vanndar.cpp:29
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
Yells
Definition
boss_illidan.cpp:256
boss_vanndar::boss_vanndarAI
Definition
boss_vanndar.cpp:32
boss_vanndar::boss_vanndarAI::YellTimer
uint32 YellTimer
Definition
boss_vanndar.cpp:39
boss_vanndar::boss_vanndarAI::AvatarTimer
uint32 AvatarTimer
Definition
boss_vanndar.cpp:35
boss_vanndar::boss_vanndarAI::ThunderclapTimer
uint32 ThunderclapTimer
Definition
boss_vanndar.cpp:36
boss_vanndar::boss_vanndarAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_vanndar.cpp:50
boss_vanndar::boss_vanndarAI::StormboltTimer
uint32 StormboltTimer
Definition
boss_vanndar.cpp:37
boss_vanndar::boss_vanndarAI::Reset
void Reset() OVERRIDE
Definition
boss_vanndar.cpp:41
boss_vanndar::boss_vanndarAI::boss_vanndarAI
boss_vanndarAI(Creature *creature)
Definition
boss_vanndar.cpp:33
boss_vanndar::boss_vanndarAI::ResetTimer
uint32 ResetTimer
Definition
boss_vanndar.cpp:38
boss_vanndar::boss_vanndarAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_vanndar.cpp:55
src
server
scripts
EasternKingdoms
AlteracValley
boss_vanndar.cpp
Generated on
for Project SkyFire Core by
1.17.0