Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
7SDName: Boss meathook
8SDAuthor: Tartalo
9SD%Complete: 100
10SDComment: It may need timer adjustment
11SDCategory:
12Script Data End */
13
14#include "ScriptMgr.h"
15#include "ScriptedCreature.h"
17
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.
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.
24 SPELL_FRENZY = 58841 //Increases the caster's Physical damage by 10% for 30 sec.
25};
26
28{
33};
34
36{
37public:
38 boss_meathook() : CreatureScript("boss_meathook") { }
39
41 {
42 return new boss_meathookAI(creature);
43 }
44
46 {
47 boss_meathookAI(Creature* creature) : ScriptedAI(creature)
48 {
49 instance = creature->GetInstanceScript();
50 if (instance)
52 }
53
57
59
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)
68 }
69
70 void EnterCombat(Unit* /*who*/) OVERRIDE
71 {
73
74 if (instance)
76 }
77
79 {
80 //Return since we have no target
81 if (!UpdateVictim())
82 return;
83
84 if (uiDiseaseTimer <= diff)
85 {
87 uiDiseaseTimer = std::rand() % 4000 + 1500;
88 } else uiDiseaseTimer -= diff;
89
90 if (uiFrenzyTimer <= diff)
91 {
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
104 }
105
106 void JustDied(Unit* /*killer*/) OVERRIDE
107 {
109
110 if (instance)
112 }
113
115 {
116 if (victim->GetTypeId() != TypeID::TYPEID_PLAYER)
117 return;
118
119 Talk(SAY_SLAY);
120 }
121 };
122};
123
125{
126 new boss_meathook();
127}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition Object.h:55
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_FRENZY
void AddSC_boss_meathook()
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_SLAY
@ SAY_SPAWN
@ SPELL_CONSTRICTING_CHAINS
@ H_SPELL_DISEASE_EXPULSION
@ SPELL_FRENZY
@ SPELL_DISEASE_EXPULSION
@ H_SPELL_CONSTRICTING_CHAINS
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_MEATHOOK_EVENT
Creature * me
ScriptedAI(Creature *creature)
void KilledUnit(Unit *victim) OVERRIDE
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
boss_meathookAI(Creature *creature)
void JustDied(Unit *) OVERRIDE