Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_meathook.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
/* Script Data Start
7
SDName: Boss meathook
8
SDAuthor: Tartalo
9
SD%Complete: 100
10
SDComment: It may need timer adjustment
11
SDCategory:
12
Script Data End */
13
14
#include "
ScriptMgr.h
"
15
#include "
ScriptedCreature.h
"
16
#include "
culling_of_stratholme.h
"
17
18
enum
Spells
19
{
20
SPELL_CONSTRICTING_CHAINS
= 52696,
//Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec.
21
H_SPELL_CONSTRICTING_CHAINS
= 58823,
22
SPELL_DISEASE_EXPULSION
= 52666,
//Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec.
23
H_SPELL_DISEASE_EXPULSION
= 58824,
24
SPELL_FRENZY
= 58841
//Increases the caster's Physical damage by 10% for 30 sec.
25
};
26
27
enum
Yells
28
{
29
SAY_AGGRO
= 0,
30
SAY_SLAY
= 1,
31
SAY_SPAWN
= 2,
32
SAY_DEATH
= 3
33
};
34
35
class
boss_meathook
:
public
CreatureScript
36
{
37
public
:
38
boss_meathook
() :
CreatureScript
(
"boss_meathook"
) { }
39
40
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
41
{
42
return
new
boss_meathookAI
(creature);
43
}
44
45
struct
boss_meathookAI
:
public
ScriptedAI
46
{
47
boss_meathookAI
(
Creature
* creature) :
ScriptedAI
(creature)
48
{
49
instance
= creature->
GetInstanceScript
();
50
if
(
instance
)
51
Talk
(
SAY_SPAWN
);
52
}
53
54
uint32
uiChainTimer
;
55
uint32
uiDiseaseTimer
;
56
uint32
uiFrenzyTimer
;
57
58
InstanceScript
*
instance
;
59
60
void
Reset
()
OVERRIDE
61
{
62
uiChainTimer
= std::rand() % 17000 + 12000;
//seen on video 13, 17, 15, 12, 16
63
uiDiseaseTimer
= std::rand() % 4000 + 2000;
//approx 3s
64
uiFrenzyTimer
= std::rand() % 26000 + 21000;
//made it up
65
66
if
(
instance
)
67
instance
->SetData(
DATA_MEATHOOK_EVENT
,
NOT_STARTED
);
68
}
69
70
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
71
{
72
Talk
(
SAY_AGGRO
);
73
74
if
(
instance
)
75
instance
->SetData(
DATA_MEATHOOK_EVENT
,
IN_PROGRESS
);
76
}
77
78
void
UpdateAI
(
uint32
diff)
OVERRIDE
79
{
80
//Return since we have no target
81
if
(!
UpdateVictim
())
82
return
;
83
84
if
(
uiDiseaseTimer
<= diff)
85
{
86
DoCastAOE
(
SPELL_DISEASE_EXPULSION
);
87
uiDiseaseTimer
= std::rand() % 4000 + 1500;
88
}
else
uiDiseaseTimer
-= diff;
89
90
if
(
uiFrenzyTimer
<= diff)
91
{
92
DoCast
(
me
,
SPELL_FRENZY
);
93
uiFrenzyTimer
= std::rand() % 26000 + 21000;
94
}
else
uiFrenzyTimer
-= diff;
95
96
if
(
uiChainTimer
<= diff)
97
{
98
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
99
DoCast
(target,
SPELL_CONSTRICTING_CHAINS
);
//anyone but the tank
100
uiChainTimer
= std::rand() % 4000 + 2000;
101
}
else
uiChainTimer
-= diff;
102
103
DoMeleeAttackIfReady
();
104
}
105
106
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
107
{
108
Talk
(
SAY_DEATH
);
109
110
if
(
instance
)
111
instance
->SetData(
DATA_MEATHOOK_EVENT
,
DONE
);
112
}
113
114
void
KilledUnit
(
Unit
* victim)
OVERRIDE
115
{
116
if
(victim->GetTypeId() !=
TypeID::TYPEID_PLAYER
)
117
return
;
118
119
Talk
(
SAY_SLAY
);
120
}
121
};
122
};
123
124
void
AddSC_boss_meathook
()
125
{
126
new
boss_meathook
();
127
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
IN_PROGRESS
@ IN_PROGRESS
Definition
InstanceScript.h:47
DONE
@ DONE
Definition
InstanceScript.h:49
NOT_STARTED
@ NOT_STARTED
Definition
InstanceScript.h:46
TypeID::TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
Object.h:55
ScriptMgr.h
ScriptedCreature.h
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
SAY_SLAY
@ SAY_SLAY
Definition
boss_alizabal.cpp:20
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SPELL_FRENZY
@ SPELL_FRENZY
Definition
boss_drekthar.cpp:14
SAY_SPAWN
@ SAY_SPAWN
Definition
boss_majordomo_executus.cpp:23
AddSC_boss_meathook
void AddSC_boss_meathook()
Definition
boss_meathook.cpp:124
SAY_DEATH
@ SAY_DEATH
Definition
boss_meathook.cpp:32
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_meathook.cpp:29
SAY_SLAY
@ SAY_SLAY
Definition
boss_meathook.cpp:30
SAY_SPAWN
@ SAY_SPAWN
Definition
boss_meathook.cpp:31
SPELL_CONSTRICTING_CHAINS
@ SPELL_CONSTRICTING_CHAINS
Definition
boss_meathook.cpp:20
H_SPELL_DISEASE_EXPULSION
@ H_SPELL_DISEASE_EXPULSION
Definition
boss_meathook.cpp:23
SPELL_FRENZY
@ SPELL_FRENZY
Definition
boss_meathook.cpp:24
SPELL_DISEASE_EXPULSION
@ SPELL_DISEASE_EXPULSION
Definition
boss_meathook.cpp:22
H_SPELL_CONSTRICTING_CHAINS
@ H_SPELL_CONSTRICTING_CHAINS
Definition
boss_meathook.cpp:21
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
InstanceScript
Definition
InstanceScript.h:123
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::DoCastAOE
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:176
Unit
Definition
Unit.h:1367
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
boss_meathook
Definition
boss_meathook.cpp:36
boss_meathook::boss_meathook
boss_meathook()
Definition
boss_meathook.cpp:38
boss_meathook::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_meathook.cpp:40
culling_of_stratholme.h
DATA_MEATHOOK_EVENT
@ DATA_MEATHOOK_EVENT
Definition
culling_of_stratholme.h:11
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
Yells
Definition
boss_illidan.cpp:256
boss_meathook::boss_meathookAI
Definition
boss_meathook.cpp:46
boss_meathook::boss_meathookAI::instance
InstanceScript * instance
Definition
boss_meathook.cpp:58
boss_meathook::boss_meathookAI::KilledUnit
void KilledUnit(Unit *victim) OVERRIDE
Definition
boss_meathook.cpp:114
boss_meathook::boss_meathookAI::Reset
void Reset() OVERRIDE
Definition
boss_meathook.cpp:60
boss_meathook::boss_meathookAI::uiFrenzyTimer
uint32 uiFrenzyTimer
Definition
boss_meathook.cpp:56
boss_meathook::boss_meathookAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_meathook.cpp:70
boss_meathook::boss_meathookAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_meathook.cpp:78
boss_meathook::boss_meathookAI::uiChainTimer
uint32 uiChainTimer
Definition
boss_meathook.cpp:54
boss_meathook::boss_meathookAI::uiDiseaseTimer
uint32 uiDiseaseTimer
Definition
boss_meathook.cpp:55
boss_meathook::boss_meathookAI::boss_meathookAI
boss_meathookAI(Creature *creature)
Definition
boss_meathook.cpp:47
boss_meathook::boss_meathookAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_meathook.cpp:106
src
server
scripts
Kalimdor
CavernsOfTime
CullingOfStratholme
boss_meathook.cpp
Generated on
for Project SkyFire Core by
1.17.0