Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_general_angerforge.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_MIGHTYBLOW
= 14099,
12
SPELL_HAMSTRING
= 9080,
13
SPELL_CLEAVE
= 20691
14
};
15
16
class
boss_general_angerforge
:
public
CreatureScript
17
{
18
public
:
19
boss_general_angerforge
() :
CreatureScript
(
"boss_general_angerforge"
) { }
20
21
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
22
{
23
return
new
boss_general_angerforgeAI
(creature);
24
}
25
26
struct
boss_general_angerforgeAI
:
public
ScriptedAI
27
{
28
boss_general_angerforgeAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
29
30
uint32
MightyBlow_Timer
;
31
uint32
HamString_Timer
;
32
uint32
Cleave_Timer
;
33
uint32
Adds_Timer
;
34
bool
Medics
;
35
36
void
Reset
()
OVERRIDE
37
{
38
MightyBlow_Timer
= 8000;
39
HamString_Timer
= 12000;
40
Cleave_Timer
= 16000;
41
Adds_Timer
= 0;
42
Medics
=
false
;
43
}
44
45
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
46
47
void
SummonAdds
(
Unit
* victim)
48
{
49
if
(
Creature
* SummonedAdd =
DoSpawnCreature
(8901,
float
(std::rand() % 14 + -14),
float
(std::rand() % 14 + -14), 0, 0,
TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
, 120000))
50
SummonedAdd->AI()->AttackStart(victim);
51
}
52
53
void
SummonMedics
(
Unit
* victim)
54
{
55
if
(
Creature
* SummonedMedic =
DoSpawnCreature
(8894,
float
(std::rand() % 9 + -9),
float
(std::rand() % 9 + -9), 0, 0,
TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
, 120000))
56
SummonedMedic->AI()->AttackStart(victim);
57
}
58
59
void
UpdateAI
(
uint32
diff)
OVERRIDE
60
{
61
//Return since we have no target
62
if
(!
UpdateVictim
())
63
return
;
64
65
//MightyBlow_Timer
66
if
(
MightyBlow_Timer
<= diff)
67
{
68
DoCastVictim
(
SPELL_MIGHTYBLOW
);
69
MightyBlow_Timer
= 18000;
70
}
else
MightyBlow_Timer
-= diff;
71
72
//HamString_Timer
73
if
(
HamString_Timer
<= diff)
74
{
75
DoCastVictim
(
SPELL_HAMSTRING
);
76
HamString_Timer
= 15000;
77
}
else
HamString_Timer
-= diff;
78
79
//Cleave_Timer
80
if
(
Cleave_Timer
<= diff)
81
{
82
DoCastVictim
(
SPELL_CLEAVE
);
83
Cleave_Timer
= 9000;
84
}
else
Cleave_Timer
-= diff;
85
86
//Adds_Timer
87
if
(
HealthBelowPct
(21))
88
{
89
if
(
Adds_Timer
<= diff)
90
{
91
// summon 3 Adds every 25s
92
SummonAdds
(
me
->GetVictim());
93
SummonAdds
(
me
->GetVictim());
94
SummonAdds
(
me
->GetVictim());
95
96
Adds_Timer
= 25000;
97
}
else
Adds_Timer
-= diff;
98
}
99
100
//Summon Medics
101
if
(!
Medics
&&
HealthBelowPct
(21))
102
{
103
SummonMedics
(
me
->GetVictim());
104
SummonMedics
(
me
->GetVictim());
105
Medics
=
true
;
106
}
107
108
DoMeleeAttackIfReady
();
109
}
110
};
111
};
112
113
void
AddSC_boss_general_angerforge
()
114
{
115
new
boss_general_angerforge
();
116
}
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_OR_CORPSE_DESPAWN
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition
Object.h:69
ScriptMgr.h
ScriptedCreature.h
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
alterac_valley.cpp:12
SPELL_MIGHTYBLOW
@ SPELL_MIGHTYBLOW
Definition
blackrock_depths.cpp:335
SPELL_HAMSTRING
@ SPELL_HAMSTRING
Definition
boss_general_angerforge.cpp:12
SPELL_CLEAVE
@ SPELL_CLEAVE
Definition
boss_general_angerforge.cpp:13
SPELL_MIGHTYBLOW
@ SPELL_MIGHTYBLOW
Definition
boss_general_angerforge.cpp:11
AddSC_boss_general_angerforge
void AddSC_boss_general_angerforge()
Definition
boss_general_angerforge.cpp:113
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::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
boss_general_angerforge
Definition
boss_general_angerforge.cpp:17
boss_general_angerforge::boss_general_angerforge
boss_general_angerforge()
Definition
boss_general_angerforge.cpp:19
boss_general_angerforge::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_general_angerforge.cpp:21
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
ScriptedAI::DoSpawnCreature
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, TempSummonType type, uint32 despawntime)
Definition
ScriptedCreature.cpp:178
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_general_angerforge::boss_general_angerforgeAI
Definition
boss_general_angerforge.cpp:27
boss_general_angerforge::boss_general_angerforgeAI::HamString_Timer
uint32 HamString_Timer
Definition
boss_general_angerforge.cpp:31
boss_general_angerforge::boss_general_angerforgeAI::Adds_Timer
uint32 Adds_Timer
Definition
boss_general_angerforge.cpp:33
boss_general_angerforge::boss_general_angerforgeAI::Medics
bool Medics
Definition
boss_general_angerforge.cpp:34
boss_general_angerforge::boss_general_angerforgeAI::SummonAdds
void SummonAdds(Unit *victim)
Definition
boss_general_angerforge.cpp:47
boss_general_angerforge::boss_general_angerforgeAI::Reset
void Reset() OVERRIDE
Definition
boss_general_angerforge.cpp:36
boss_general_angerforge::boss_general_angerforgeAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_general_angerforge.cpp:59
boss_general_angerforge::boss_general_angerforgeAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_general_angerforge.cpp:45
boss_general_angerforge::boss_general_angerforgeAI::SummonMedics
void SummonMedics(Unit *victim)
Definition
boss_general_angerforge.cpp:53
boss_general_angerforge::boss_general_angerforgeAI::MightyBlow_Timer
uint32 MightyBlow_Timer
Definition
boss_general_angerforge.cpp:30
boss_general_angerforge::boss_general_angerforgeAI::boss_general_angerforgeAI
boss_general_angerforgeAI(Creature *creature)
Definition
boss_general_angerforge.cpp:28
boss_general_angerforge::boss_general_angerforgeAI::Cleave_Timer
uint32 Cleave_Timer
Definition
boss_general_angerforge.cpp:32
src
server
scripts
EasternKingdoms
BlackrockMountain
BlackrockDepths
boss_general_angerforge.cpp
Generated on
for Project SkyFire Core by
1.17.0