Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_zum_rah.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/*
7Name: Boss_Zum_Rah
8Category: Tanaris, ZulFarrak
9*/
10
11#include "ScriptMgr.h"
12#include "ScriptedCreature.h"
13#include "zulfarrak.h"
14
15enum Says
16{
20};
21
29
37
42
44{
45public:
46 boss_zum_rah() : CreatureScript("boss_zum_rah") { }
47
48 struct boss_zum_rahAI : public BossAI
49 {
50 boss_zum_rahAI(Creature* creature) : BossAI(creature, DATA_ZUM_RAH) { }
51
53 {
54 me->setFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy
55 _ward80 = false;
56 _ward40 = false;
57 _heal30 = false;
58 }
59
60 void EnterCombat(Unit* /*who*/) OVERRIDE
61 {
63 events.ScheduleEvent(EVENT_SHADOW_BOLT, 1000);
64 events.ScheduleEvent(EVENT_SHADOWBOLT_VOLLEY, 10000);
65 }
66
67 void JustDied(Unit* /*killer*/) OVERRIDE
68 {
69 if (instance)
70 instance->SetData(DATA_ZUM_RAH, DONE);
71 }
72
73 void KilledUnit(Unit* /*victim*/) OVERRIDE
74 {
76 }
77
79 {
80 if (!UpdateVictim())
81 return;
82
83 events.Update(diff);
84
85 while (uint32 eventId = events.ExecuteEvent())
86 {
87 switch (eventId)
88 {
91 events.ScheduleEvent(EVENT_SHADOW_BOLT, 4000);
92 break;
95 break;
98 break;
100 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
102 events.ScheduleEvent(EVENT_SHADOWBOLT_VOLLEY, 9000);
103 break;
104 default:
105 break;
106 }
107 }
108
109 if (!_ward80 && HealthBelowPct(80))
110 {
111 _ward80 = true;
112 Talk(SAY_WARD);
113 events.ScheduleEvent(EVENT_WARD_OF_ZUM_RAH, 1000);
114 }
115
116 if (!_ward40 && HealthBelowPct(40))
117 {
118 _ward40 = true;
119 Talk(SAY_WARD);
120 events.ScheduleEvent(EVENT_WARD_OF_ZUM_RAH, 1000);
121 }
122
123 if (!_heal30 && HealthBelowPct(30))
124 {
125 _heal30 = true;
126 events.ScheduleEvent(EVENT_HEALING_WAVE, 3000);
127 }
128
130 }
131
132 private:
136
137 };
138
140 {
141 return new boss_zum_rahAI(creature);
142 }
143};
144
146{
147 new boss_zum_rah();
148}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ DONE
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
#define SAY_KILL
@ SPELL_SHADOW_BOLT
@ SPELL_SHADOWBOLT_VOLLEY
@ EVENT_SHADOW_BOLT
@ SAY_KILL
@ SAY_WARD
@ SAY_SANCT_INVADE
@ SPELL_SHADOW_BOLT
@ SPELL_SHADOWBOLT_VOLLEY
@ SPELL_WARD_OF_ZUM_RAH
@ SPELL_HEALING_WAVE
void AddSC_boss_zum_rah()
Faction
@ ZUMRAH_FRIENDLY_FACTION
@ EVENT_SHADOWBOLT_VOLLEY
@ EVENT_WARD_OF_ZUM_RAH
@ EVENT_HEALING_WAVE
@ EVENT_SHADOW_BOLT
InstanceScript *const instance
EventMap events
BossAI(Creature *creature, uint32 bossId)
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 DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthBelowPct(uint32 pct) const
void JustDied(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
boss_zum_rahAI(Creature *creature)
void KilledUnit(Unit *) OVERRIDE
void EnterCombat(Unit *) OVERRIDE
@ DATA_ZUM_RAH
Definition zulfarrak.h:26