Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_huhuran.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
/* ScriptData
7
SDName: Boss_Huhuran
8
SD%Complete: 100
9
SDComment:
10
SDCategory: Temple of Ahn'Qiraj
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
16
enum
Huhuran
17
{
18
EMOTE_FRENZY_KILL
= 0,
19
EMOTE_BERSERK
= 1,
20
21
SPELL_FRENZY
= 26051,
22
SPELL_BERSERK
= 26068,
23
SPELL_POISONBOLT
= 26052,
24
SPELL_NOXIOUSPOISON
= 26053,
25
SPELL_WYVERNSTING
= 26180,
26
SPELL_ACIDSPIT
= 26050
27
};
28
29
class
boss_huhuran
:
public
CreatureScript
30
{
31
public
:
32
boss_huhuran
() :
CreatureScript
(
"boss_huhuran"
) { }
33
34
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
35
{
36
return
new
boss_huhuranAI
(creature);
37
}
38
39
struct
boss_huhuranAI
:
public
ScriptedAI
40
{
41
boss_huhuranAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
42
43
uint32
Frenzy_Timer
;
44
uint32
Wyvern_Timer
;
45
uint32
Spit_Timer
;
46
uint32
PoisonBolt_Timer
;
47
uint32
NoxiousPoison_Timer
;
48
uint32
FrenzyBack_Timer
;
49
50
bool
Frenzy
;
51
bool
Berserk
;
52
53
void
Reset
()
OVERRIDE
54
{
55
Frenzy_Timer
= std::rand() % 35000 + 25000;
56
Wyvern_Timer
= std::rand() % 28000 + 18000;
57
Spit_Timer
= 8000;
58
PoisonBolt_Timer
= 4000;
59
NoxiousPoison_Timer
= std::rand() % 20000 + 10000;
60
FrenzyBack_Timer
= 15000;
61
62
Frenzy
=
false
;
63
Berserk
=
false
;
64
}
65
66
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
67
{
68
}
69
70
void
UpdateAI
(
uint32
diff)
OVERRIDE
71
{
72
//Return since we have no target
73
if
(!
UpdateVictim
())
74
return
;
75
76
//Frenzy_Timer
77
if
(!
Frenzy
&&
Frenzy_Timer
<= diff)
78
{
79
DoCast
(
me
,
SPELL_FRENZY
);
80
Talk
(
EMOTE_FRENZY_KILL
);
81
Frenzy
=
true
;
82
PoisonBolt_Timer
= 3000;
83
Frenzy_Timer
= std::rand() % 35000 + 25000;
84
}
else
Frenzy_Timer
-= diff;
85
86
// Wyvern Timer
87
if
(
Wyvern_Timer
<= diff)
88
{
89
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
90
DoCast
(target,
SPELL_WYVERNSTING
);
91
Wyvern_Timer
= std::rand() % 32000 + 15000;
92
}
else
Wyvern_Timer
-= diff;
93
94
//Spit Timer
95
if
(
Spit_Timer
<= diff)
96
{
97
DoCastVictim
(
SPELL_ACIDSPIT
);
98
Spit_Timer
= std::rand() % 10000 + 5000;
99
}
else
Spit_Timer
-= diff;
100
101
//NoxiousPoison_Timer
102
if
(
NoxiousPoison_Timer
<= diff)
103
{
104
DoCastVictim
(
SPELL_NOXIOUSPOISON
);
105
NoxiousPoison_Timer
= std::rand() % 24000 + 12000;
106
}
else
NoxiousPoison_Timer
-= diff;
107
108
//PoisonBolt only if frenzy or berserk
109
if
(
Frenzy
||
Berserk
)
110
{
111
if
(
PoisonBolt_Timer
<= diff)
112
{
113
DoCastVictim
(
SPELL_POISONBOLT
);
114
PoisonBolt_Timer
= 3000;
115
}
else
PoisonBolt_Timer
-= diff;
116
}
117
118
//FrenzyBack_Timer
119
if
(
Frenzy
&&
FrenzyBack_Timer
<= diff)
120
{
121
me
->InterruptNonMeleeSpells(
false
);
122
Frenzy
=
false
;
123
FrenzyBack_Timer
= 15000;
124
}
else
FrenzyBack_Timer
-= diff;
125
126
if
(!
Berserk
&&
HealthBelowPct
(31))
127
{
128
me
->InterruptNonMeleeSpells(
false
);
129
Talk
(
EMOTE_BERSERK
);
130
DoCast
(
me
,
SPELL_BERSERK
);
131
Berserk
=
true
;
132
}
133
134
DoMeleeAttackIfReady
();
135
}
136
};
137
};
138
139
void
AddSC_boss_huhuran
()
140
{
141
new
boss_huhuran
();
142
}
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ScriptMgr.h
ScriptedCreature.h
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
SPELL_FRENZY
@ SPELL_FRENZY
Definition
boss_drekthar.cpp:14
SPELL_BERSERK
#define SPELL_BERSERK
Definition
boss_four_horsemen.cpp:62
EMOTE_FRENZY_KILL
@ EMOTE_FRENZY_KILL
Definition
boss_grizzle.cpp:13
AddSC_boss_huhuran
void AddSC_boss_huhuran()
Definition
boss_huhuran.cpp:139
Huhuran
Huhuran
Definition
boss_huhuran.cpp:17
SPELL_ACIDSPIT
@ SPELL_ACIDSPIT
Definition
boss_huhuran.cpp:26
SPELL_WYVERNSTING
@ SPELL_WYVERNSTING
Definition
boss_huhuran.cpp:25
SPELL_NOXIOUSPOISON
@ SPELL_NOXIOUSPOISON
Definition
boss_huhuran.cpp:24
SPELL_FRENZY
@ SPELL_FRENZY
Definition
boss_huhuran.cpp:21
EMOTE_BERSERK
@ EMOTE_BERSERK
Definition
boss_huhuran.cpp:19
SPELL_BERSERK
@ SPELL_BERSERK
Definition
boss_huhuran.cpp:22
SPELL_POISONBOLT
@ SPELL_POISONBOLT
Definition
boss_huhuran.cpp:23
EMOTE_FRENZY_KILL
@ EMOTE_FRENZY_KILL
Definition
boss_huhuran.cpp:18
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
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::SelectTarget
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition
UnitAI.cpp:66
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
boss_huhuran
Definition
boss_huhuran.cpp:30
boss_huhuran::boss_huhuran
boss_huhuran()
Definition
boss_huhuran.cpp:32
boss_huhuran::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_huhuran.cpp:34
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_huhuran::boss_huhuranAI
Definition
boss_huhuran.cpp:40
boss_huhuran::boss_huhuranAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_huhuran.cpp:70
boss_huhuran::boss_huhuranAI::Reset
void Reset() OVERRIDE
Definition
boss_huhuran.cpp:53
boss_huhuran::boss_huhuranAI::NoxiousPoison_Timer
uint32 NoxiousPoison_Timer
Definition
boss_huhuran.cpp:47
boss_huhuran::boss_huhuranAI::FrenzyBack_Timer
uint32 FrenzyBack_Timer
Definition
boss_huhuran.cpp:48
boss_huhuran::boss_huhuranAI::Frenzy_Timer
uint32 Frenzy_Timer
Definition
boss_huhuran.cpp:43
boss_huhuran::boss_huhuranAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_huhuran.cpp:66
boss_huhuran::boss_huhuranAI::Spit_Timer
uint32 Spit_Timer
Definition
boss_huhuran.cpp:45
boss_huhuran::boss_huhuranAI::PoisonBolt_Timer
uint32 PoisonBolt_Timer
Definition
boss_huhuran.cpp:46
boss_huhuran::boss_huhuranAI::boss_huhuranAI
boss_huhuranAI(Creature *creature)
Definition
boss_huhuran.cpp:41
boss_huhuran::boss_huhuranAI::Berserk
bool Berserk
Definition
boss_huhuran.cpp:51
boss_huhuran::boss_huhuranAI::Frenzy
bool Frenzy
Definition
boss_huhuran.cpp:50
boss_huhuran::boss_huhuranAI::Wyvern_Timer
uint32 Wyvern_Timer
Definition
boss_huhuran.cpp:44
src
server
scripts
Kalimdor
TempleOfAhnQiraj
boss_huhuran.cpp
Generated on
for Project SkyFire Core by
1.17.0