Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_galvangar.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
Spells
10
{
11
SPELL_CLEAVE
= 15284,
12
SPELL_FRIGHTENING_SHOUT
= 19134,
13
SPELL_WHIRLWIND1
= 15589,
14
SPELL_WHIRLWIND2
= 13736,
15
SPELL_MORTAL_STRIKE
= 16856
16
};
17
18
enum
Yells
19
{
20
YELL_AGGRO
= 0,
21
YELL_EVADE
= 1
22
};
23
24
class
boss_galvangar
:
public
CreatureScript
25
{
26
public
:
27
boss_galvangar
() :
CreatureScript
(
"boss_galvangar"
) { }
28
29
struct
boss_galvangarAI
:
public
ScriptedAI
30
{
31
boss_galvangarAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
32
33
uint32
CleaveTimer
;
34
uint32
FrighteningShoutTimer
;
35
uint32
Whirlwind1Timer
;
36
uint32
Whirlwind2Timer
;
37
uint32
MortalStrikeTimer
;
38
uint32
ResetTimer
;
39
40
void
Reset
()
OVERRIDE
41
{
42
CleaveTimer
= std::rand() % (9*
IN_MILLISECONDS
) + (1 *
IN_MILLISECONDS
);
43
FrighteningShoutTimer
= std::rand() % (19 *
IN_MILLISECONDS
) + (2 *
IN_MILLISECONDS
);
44
Whirlwind1Timer
= std::rand() % (13 *
IN_MILLISECONDS
) + (1 *
IN_MILLISECONDS
);
45
Whirlwind2Timer
= std::rand() % (20 *
IN_MILLISECONDS
) + (5 *
IN_MILLISECONDS
);
46
MortalStrikeTimer
= std::rand() % (20 *
IN_MILLISECONDS
) + (5 *
IN_MILLISECONDS
);
47
ResetTimer
= 5 *
IN_MILLISECONDS
;
48
}
49
50
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
51
{
52
Talk
(
YELL_AGGRO
);
53
}
54
55
void
JustRespawned
()
OVERRIDE
56
{
57
Reset
();
58
}
59
60
void
UpdateAI
(
uint32
diff)
OVERRIDE
61
{
62
if
(!
UpdateVictim
())
63
return
;
64
65
if
(
CleaveTimer
<= diff)
66
{
67
DoCastVictim
(
SPELL_CLEAVE
);
68
CleaveTimer
= std::rand() % (16 *
IN_MILLISECONDS
) + (10 *
IN_MILLISECONDS
);
69
}
else
CleaveTimer
-= diff;
70
71
if
(
FrighteningShoutTimer
<= diff)
72
{
73
DoCastVictim
(
SPELL_FRIGHTENING_SHOUT
);
74
FrighteningShoutTimer
= std::rand() % (15 *
IN_MILLISECONDS
) + (10 *
IN_MILLISECONDS
);
75
}
else
FrighteningShoutTimer
-= diff;
76
77
if
(
Whirlwind1Timer
<= diff)
78
{
79
DoCastVictim
(
SPELL_WHIRLWIND1
);
80
Whirlwind1Timer
= std::rand() % (10 *
IN_MILLISECONDS
) + (6 *
IN_MILLISECONDS
);
81
}
else
Whirlwind1Timer
-= diff;
82
83
if
(
Whirlwind2Timer
<= diff)
84
{
85
DoCastVictim
(
SPELL_WHIRLWIND2
);
86
Whirlwind2Timer
= std::rand() % (25 *
IN_MILLISECONDS
) + (10 *
IN_MILLISECONDS
);
87
}
else
Whirlwind2Timer
-= diff;
88
89
if
(
MortalStrikeTimer
<= diff)
90
{
91
DoCastVictim
(
SPELL_MORTAL_STRIKE
);
92
MortalStrikeTimer
= std::rand() % (30 *
IN_MILLISECONDS
) + (10 *
IN_MILLISECONDS
);
93
}
else
MortalStrikeTimer
-= diff;
94
95
// check if creature is not outside of building
96
if
(
ResetTimer
<= diff)
97
{
98
if
(
me
->GetDistance2d(
me
->GetHomePosition().GetPositionX(),
me
->GetHomePosition().GetPositionY()) > 50)
99
{
100
EnterEvadeMode
();
101
Talk
(
YELL_EVADE
);
102
}
103
ResetTimer
= 5 *
IN_MILLISECONDS
;
104
}
else
ResetTimer
-= diff;
105
106
DoMeleeAttackIfReady
();
107
}
108
};
109
110
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
111
{
112
return
new
boss_galvangarAI
(creature);
113
}
114
};
115
116
void
AddSC_boss_galvangar
()
117
{
118
new
boss_galvangar
;
119
}
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
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
alterac_valley.cpp:12
YELL_EVADE
@ YELL_EVADE
Definition
boss_balinda.cpp:20
YELL_AGGRO
@ YELL_AGGRO
Definition
boss_balinda.cpp:19
SPELL_WHIRLWIND2
@ SPELL_WHIRLWIND2
Definition
boss_drekthar.cpp:12
YELL_EVADE
@ YELL_EVADE
Definition
boss_galvangar.cpp:21
YELL_AGGRO
@ YELL_AGGRO
Definition
boss_galvangar.cpp:20
AddSC_boss_galvangar
void AddSC_boss_galvangar()
Definition
boss_galvangar.cpp:116
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
boss_galvangar.cpp:11
SPELL_MORTAL_STRIKE
@ SPELL_MORTAL_STRIKE
Definition
boss_galvangar.cpp:15
SPELL_FRIGHTENING_SHOUT
@ SPELL_FRIGHTENING_SHOUT
Definition
boss_galvangar.cpp:12
SPELL_WHIRLWIND2
@ SPELL_WHIRLWIND2
Definition
boss_galvangar.cpp:14
SPELL_WHIRLWIND1
@ SPELL_WHIRLWIND1
Definition
boss_galvangar.cpp:13
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_galvangar
Definition
boss_galvangar.cpp:25
boss_galvangar::boss_galvangar
boss_galvangar()
Definition
boss_galvangar.cpp:27
boss_galvangar::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_galvangar.cpp:110
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
Yells
Definition
boss_illidan.cpp:256
boss_galvangar::boss_galvangarAI
Definition
boss_galvangar.cpp:30
boss_galvangar::boss_galvangarAI::Whirlwind1Timer
uint32 Whirlwind1Timer
Definition
boss_galvangar.cpp:35
boss_galvangar::boss_galvangarAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_galvangar.cpp:60
boss_galvangar::boss_galvangarAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_galvangar.cpp:50
boss_galvangar::boss_galvangarAI::boss_galvangarAI
boss_galvangarAI(Creature *creature)
Definition
boss_galvangar.cpp:31
boss_galvangar::boss_galvangarAI::FrighteningShoutTimer
uint32 FrighteningShoutTimer
Definition
boss_galvangar.cpp:34
boss_galvangar::boss_galvangarAI::JustRespawned
void JustRespawned() OVERRIDE
Definition
boss_galvangar.cpp:55
boss_galvangar::boss_galvangarAI::ResetTimer
uint32 ResetTimer
Definition
boss_galvangar.cpp:38
boss_galvangar::boss_galvangarAI::Reset
void Reset() OVERRIDE
Definition
boss_galvangar.cpp:40
boss_galvangar::boss_galvangarAI::MortalStrikeTimer
uint32 MortalStrikeTimer
Definition
boss_galvangar.cpp:37
boss_galvangar::boss_galvangarAI::Whirlwind2Timer
uint32 Whirlwind2Timer
Definition
boss_galvangar.cpp:36
boss_galvangar::boss_galvangarAI::CleaveTimer
uint32 CleaveTimer
Definition
boss_galvangar.cpp:33
src
server
scripts
EasternKingdoms
AlteracValley
boss_galvangar.cpp
Generated on
for Project SkyFire Core by
1.17.0