Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_hungarfen.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_Hungarfen
8
SD%Complete: 95
9
SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic
10
SDCategory: Coilfang Resevoir, Underbog
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
16
enum
Spells
17
{
18
SPELL_FOUL_SPORES
= 31673,
19
SPELL_ACID_GEYSER
= 38739,
20
21
SPELL_SPORE_CLOUD
= 34168,
22
SPELL_PUTRID_MUSHROOM
= 31690,
23
SPELL_GROW
= 31698
24
};
25
26
class
boss_hungarfen
:
public
CreatureScript
27
{
28
public
:
29
boss_hungarfen
() :
CreatureScript
(
"boss_hungarfen"
) { }
30
31
struct
boss_hungarfenAI
:
public
ScriptedAI
32
{
33
boss_hungarfenAI
(
Creature
* creature) :
ScriptedAI
(creature)
34
{
35
Root
=
false
;
36
Mushroom_Timer
= 0;
37
AcidGeyser_Timer
= 0;
38
}
39
40
void
Reset
()
OVERRIDE
41
{
42
Root
=
false
;
43
Mushroom_Timer
= 5000;
// 1 mushroom after 5s, then one per 10s. This should be different in heroic mode
44
AcidGeyser_Timer
= 10000;
45
}
46
47
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
48
49
void
UpdateAI
(
uint32
diff)
OVERRIDE
50
{
51
if
(!
UpdateVictim
())
52
return
;
53
54
if
(!
HealthAbovePct
(20))
55
{
56
if
(!
Root
)
57
{
58
DoCast
(
me
,
SPELL_FOUL_SPORES
);
59
Root
=
true
;
60
}
61
}
62
63
if
(
Mushroom_Timer
<= diff)
64
{
65
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
66
me
->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(),
float
(rand()%5),
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 22000);
67
else
68
me
->SummonCreature(17990,
me
->GetPositionX()+(rand()%8),
me
->GetPositionY()+(rand()%8),
me
->GetPositionZ(),
float
(rand()%5),
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 22000);
69
70
Mushroom_Timer
= 10000;
71
}
else
Mushroom_Timer
-= diff;
72
73
if
(
AcidGeyser_Timer
<= diff)
74
{
75
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
76
DoCast
(target,
SPELL_ACID_GEYSER
);
77
AcidGeyser_Timer
= 10000+rand()%7500;
78
}
else
AcidGeyser_Timer
-= diff;
79
80
DoMeleeAttackIfReady
();
81
}
82
private
:
83
bool
Root
;
84
uint32
Mushroom_Timer
;
85
uint32
AcidGeyser_Timer
;
86
};
87
88
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
89
{
90
return
new
boss_hungarfenAI
(creature);
91
}
92
};
93
94
class
npc_underbog_mushroom
:
public
CreatureScript
95
{
96
public
:
97
npc_underbog_mushroom
() :
CreatureScript
(
"npc_underbog_mushroom"
) { }
98
99
struct
npc_underbog_mushroomAI
:
public
ScriptedAI
100
{
101
npc_underbog_mushroomAI
(
Creature
* creature) :
ScriptedAI
(creature)
102
{
103
Stop
=
false
;
104
Grow_Timer
= 0;
105
Shrink_Timer
= 0;
106
}
107
108
void
Reset
()
OVERRIDE
109
{
110
Stop
=
false
;
111
Grow_Timer
= 0;
112
Shrink_Timer
= 20000;
113
114
DoCast
(
me
,
SPELL_PUTRID_MUSHROOM
,
true
);
115
DoCast
(
me
,
SPELL_SPORE_CLOUD
,
true
);
116
}
117
118
void
MoveInLineOfSight
(
Unit
*
/*who*/
)
OVERRIDE
{ }
119
120
121
void
AttackStart
(
Unit
*
/*who*/
)
OVERRIDE
{ }
122
123
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
124
125
void
UpdateAI
(
uint32
diff)
OVERRIDE
126
{
127
if
(
Stop
)
128
return
;
129
130
if
(
Grow_Timer
<= diff)
131
{
132
DoCast
(
me
,
SPELL_GROW
);
133
Grow_Timer
= 3000;
134
}
else
Grow_Timer
-= diff;
135
136
if
(
Shrink_Timer
<= diff)
137
{
138
me
->RemoveAurasDueToSpell(
SPELL_GROW
);
139
Stop
=
true
;
140
}
else
Shrink_Timer
-= diff;
141
}
142
private
:
143
bool
Stop
;
144
uint32
Grow_Timer
;
145
uint32
Shrink_Timer
;
146
};
147
148
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
149
{
150
return
new
npc_underbog_mushroomAI
(creature);
151
}
152
};
153
154
void
AddSC_boss_hungarfen
()
155
{
156
new
boss_hungarfen
();
157
new
npc_underbog_mushroom
();
158
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
Definition
Object.h:70
ScriptMgr.h
ScriptedCreature.h
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
SPELL_PUTRID_MUSHROOM
@ SPELL_PUTRID_MUSHROOM
Definition
boss_amanitar.cpp:20
SPELL_ACID_GEYSER
@ SPELL_ACID_GEYSER
Definition
boss_bloodboil.cpp:27
AddSC_boss_hungarfen
void AddSC_boss_hungarfen()
Definition
boss_hungarfen.cpp:154
SPELL_FOUL_SPORES
@ SPELL_FOUL_SPORES
Definition
boss_hungarfen.cpp:18
SPELL_SPORE_CLOUD
@ SPELL_SPORE_CLOUD
Definition
boss_hungarfen.cpp:21
SPELL_ACID_GEYSER
@ SPELL_ACID_GEYSER
Definition
boss_hungarfen.cpp:19
SPELL_GROW
@ SPELL_GROW
Definition
boss_hungarfen.cpp:23
SPELL_PUTRID_MUSHROOM
@ SPELL_PUTRID_MUSHROOM
Definition
boss_hungarfen.cpp:22
CreatureAI
Definition
CreatureAI.h:54
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
Unit
Definition
Unit.h:1367
boss_hungarfen
Definition
boss_hungarfen.cpp:27
boss_hungarfen::boss_hungarfen
boss_hungarfen()
Definition
boss_hungarfen.cpp:29
boss_hungarfen::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_hungarfen.cpp:88
npc_underbog_mushroom
Definition
boss_hungarfen.cpp:95
npc_underbog_mushroom::npc_underbog_mushroom
npc_underbog_mushroom()
Definition
boss_hungarfen.cpp:97
npc_underbog_mushroom::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_hungarfen.cpp:148
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthAbovePct
bool HealthAbovePct(uint32 pct) const
Definition
ScriptedCreature.h:251
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_hungarfen::boss_hungarfenAI
Definition
boss_hungarfen.cpp:32
boss_hungarfen::boss_hungarfenAI::Root
bool Root
Definition
boss_hungarfen.cpp:83
boss_hungarfen::boss_hungarfenAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_hungarfen.cpp:49
boss_hungarfen::boss_hungarfenAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_hungarfen.cpp:47
boss_hungarfen::boss_hungarfenAI::AcidGeyser_Timer
uint32 AcidGeyser_Timer
Definition
boss_hungarfen.cpp:85
boss_hungarfen::boss_hungarfenAI::Reset
void Reset() OVERRIDE
Definition
boss_hungarfen.cpp:40
boss_hungarfen::boss_hungarfenAI::Mushroom_Timer
uint32 Mushroom_Timer
Definition
boss_hungarfen.cpp:84
boss_hungarfen::boss_hungarfenAI::boss_hungarfenAI
boss_hungarfenAI(Creature *creature)
Definition
boss_hungarfen.cpp:33
npc_underbog_mushroom::npc_underbog_mushroomAI
Definition
boss_hungarfen.cpp:100
npc_underbog_mushroom::npc_underbog_mushroomAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_hungarfen.cpp:123
npc_underbog_mushroom::npc_underbog_mushroomAI::Shrink_Timer
uint32 Shrink_Timer
Definition
boss_hungarfen.cpp:145
npc_underbog_mushroom::npc_underbog_mushroomAI::npc_underbog_mushroomAI
npc_underbog_mushroomAI(Creature *creature)
Definition
boss_hungarfen.cpp:101
npc_underbog_mushroom::npc_underbog_mushroomAI::Reset
void Reset() OVERRIDE
Definition
boss_hungarfen.cpp:108
npc_underbog_mushroom::npc_underbog_mushroomAI::Grow_Timer
uint32 Grow_Timer
Definition
boss_hungarfen.cpp:144
npc_underbog_mushroom::npc_underbog_mushroomAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *) OVERRIDE
Definition
boss_hungarfen.cpp:118
npc_underbog_mushroom::npc_underbog_mushroomAI::Stop
bool Stop
Definition
boss_hungarfen.cpp:143
npc_underbog_mushroom::npc_underbog_mushroomAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_hungarfen.cpp:125
npc_underbog_mushroom::npc_underbog_mushroomAI::AttackStart
void AttackStart(Unit *) OVERRIDE
Definition
boss_hungarfen.cpp:121
SPELL_GROW
@ SPELL_GROW
Definition
zone_durotar.cpp:677
src
server
scripts
Outland
CoilfangReservoir
TheUnderbog
boss_hungarfen.cpp
Generated on
for Project SkyFire Core by
1.17.0