Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_hogger.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
7SDName: Boss_Hogger
8SD%Complete: 90
9SDComment:
10SDCategory: The Stockades
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
16
17enum Says
18{
22};
23
36
38{
39public:
40 boss_hogger() : CreatureScript("boss_hogger") { }
41
42 struct boss_hoggerAI : public BossAI
43 {
44 boss_hoggerAI(Creature* creature) : BossAI(creature, DATA_HOGGER) { }
45
47 {
49 events.ScheduleEvent(EVENT_VICIOUS_SLICE, 4000);
50 events.ScheduleEvent(EVENT_MADDENING_CALL, 9000);
51 events.ScheduleEvent(EVENT_ENRAGE, 60000);
52 }
53
55 {
57 BossAI::EnterCombat(victim);
58 }
59
60 void JustDied(Unit* /*killer*/) OVERRIDE
61 {
63 _JustDied();
64 instance->SetBossState(DATA_HOGGER, DONE);
65 }
66
68 {
70 instance->SetBossState(DATA_HOGGER, FAIL);
71 }
72
74 {
75 if (!UpdateVictim())
76 return;
77
78 events.Update(diff);
79
80 if (me->HasUnitState(UNIT_STATE_CASTING))
81 return;
82
83 while (uint32 eventId = events.ExecuteEvent())
84 {
85 switch (eventId)
86 {
88 {
90 events.ScheduleEvent(EVENT_VICIOUS_SLICE, 8000);
91 break;
92 }
94 {
96 events.ScheduleEvent(EVENT_MADDENING_CALL, 18000);
97 break;
98 }
99 case EVENT_ENRAGE:
100 {
103 events.ScheduleEvent(EVENT_MADDENING_CALL, 60000);
104 break;
105 }
106 default:
107 break;
108 }
109 }
111 };
112 };
114 {
115 return GetTheStockadeAI<boss_hoggerAI>(creature);
116 }
117};
118
120{
121 new boss_hogger();
122};
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ FAIL
@ DONE
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SPELL_ENRAGE
@ EVENT_ENRAGE
#define SAY_DEATH
#define SAY_AGGRO
@ SAY_ENRAGE
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_ENRAGE
@ SPELL_ENRAGE
@ SPELL_VICIOUS_SLICE
@ SPELL_MADDENING_CALL
void AddSC_boss_hogger()
@ EVENT_MADDENING_CALL
@ EVENT_ENRAGE
@ EVENT_VICIOUS_SLICE
InstanceScript *const instance
void JustReachedHome() OVERRIDE
EventMap events
void Reset() OVERRIDE
BossAI(Creature *creature, uint32 bossId)
void EnterCombat(Unit *) OVERRIDE
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
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
AI * GetTheStockadeAI(Creature *creature)
Creature * me
void EnterCombat(Unit *victim) OVERRIDE
void JustDied(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
boss_hoggerAI(Creature *creature)
void JustReachedHome() OVERRIDE