Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_gatewatcher_gyrokill.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_gatewatcher_gyrokill
8SD%Complete: 99%
9SDComment:
10SDCategory: Tempest Keep, The Mechanar
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "mechanar.h"
16
24
33
40
42{
43 public:
44 boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") { }
45
47 {
49
50 void JustDied(Unit* /*killer*/) OVERRIDE
51 {
52 _JustDied();
54 }
55
56 void EnterCombat(Unit* /*who*/) OVERRIDE
57 {
59 events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 10000);
60 events.ScheduleEvent(EVENT_SAW_BLADE, 20000);
61 events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
63 }
64
65 void KilledUnit(Unit* /*victim*/) OVERRIDE
66 {
68 }
69
71 {
72 if (!UpdateVictim())
73 return;
74
75 events.Update(diff);
76
77 if (me->HasUnitState(UNIT_STATE_CASTING))
78 return;
79
80 while (uint32 eventId = events.ExecuteEvent())
81 {
82 switch (eventId)
83 {
86 events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, std::rand() % 17000 + 13000);
87 break;
88 case EVENT_SAW_BLADE:
91 events.ScheduleEvent(EVENT_SAW_BLADE, std::rand() % 30000 + 20000);
92 break;
95 events.ScheduleEvent(EVENT_SAW_BLADE, std::rand() % 35000 + 25000);
96 break;
97 default:
98 break;
99 }
100 }
101
103 }
104 };
105
107 {
108 return new boss_gatewatcher_gyrokillAI(creature);
109 }
110};
111
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
void AddSC_boss_gatewatcher_gyrokill()
@ SPELL_STREAM_OF_MACHINE_FLUID
@ EVENT_STREAM_OF_MACHINE_FLUID
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
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
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_GATEWATCHER_GYROKILL
Definition mechanar.h:13
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================