Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_gatewatcher_ironhand.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_Ironhand
8SD%Complete: 75
9SDComment:
10SDCategory: Tempest Keep, The Mechanar
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "mechanar.h"
16
25
35
42
44{
45 public:
46 boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") { }
47
49 {
51
52 void EnterCombat(Unit* /*who*/) OVERRIDE
53 {
55 events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 55000);
56 events.ScheduleEvent(EVENT_JACKHAMMER, 45000);
57 events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
59 }
60
61 void KilledUnit(Unit* /*victim*/) OVERRIDE
62 {
63 if (roll_chance_i(50))
65 }
66
67 void JustDied(Unit* /*killer*/) OVERRIDE
68 {
69 _JustDied();
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 {
89 events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, std::rand() % 50000 + 35000);
90 break;
95 if (roll_chance_i(50))
97 events.ScheduleEvent(EVENT_JACKHAMMER, 30000);
98 break;
101 events.ScheduleEvent(EVENT_SHADOW_POWER, std::rand() % 28000 + 20000);
102 break;
103 default:
104 break;
105 }
106 }
107
109 }
110 };
111
113 {
114 return new boss_gatewatcher_iron_handAI(creature);
115 }
116};
117
122
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ UNIT_STATE_CASTING
Definition Unit.h:527
bool roll_chance_i(int chance)
Definition Util.h:89
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_STREAM_OF_MACHINE_FLUID
@ EVENT_STREAM_OF_MACHINE_FLUID
void AddSC_boss_gatewatcher_iron_hand()
@ 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_IRON_HAND
Definition mechanar.h:14
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================