TrinityCore
Loading...
Searching...
No Matches
boss_zum_rah.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19Name: Boss_Zum_Rah
20Category: Tanaris, ZulFarrak
21*/
22
23#include "ScriptMgr.h"
24#include "InstanceScript.h"
25#include "ScriptedCreature.h"
26#include "zulfarrak.h"
27
28enum Says
29{
32 SAY_KILL = 2
33};
34
42
50
52{
53public:
54 boss_zum_rah() : CreatureScript("boss_zum_rah") { }
55
56 struct boss_zum_rahAI : public BossAI
57 {
59 {
60 Initialize();
61 }
62
64 {
65 _ward80 = false;
66 _ward40 = false;
67 _heal30 = false;
68 }
69
70 void Reset() override
71 {
72 me->SetFaction(FACTION_FRIENDLY); // areatrigger sets faction to enemy
73 Initialize();
74 }
75
82
83 void JustDied(Unit* /*killer*/) override
84 {
86 }
87
88 void KilledUnit(Unit* /*victim*/) override
89 {
91 }
92
93 void UpdateAI(uint32 diff) override
94 {
95 if (!UpdateVictim())
96 return;
97
98 events.Update(diff);
99
100 while (uint32 eventId = events.ExecuteEvent())
101 {
102 switch (eventId)
103 {
107 break;
110 break;
113 break;
118 break;
119 default:
120 break;
121 }
122 }
123
124 if (!_ward80 && HealthBelowPct(80))
125 {
126 _ward80 = true;
127 Talk(SAY_WARD);
129 }
130
131 if (!_ward40 && HealthBelowPct(40))
132 {
133 _ward40 = true;
134 Talk(SAY_WARD);
136 }
137
138 if (!_heal30 && HealthBelowPct(30))
139 {
140 _heal30 = true;
142 }
143
145 }
146
147 private:
151
152 };
153
154 CreatureAI* GetAI(Creature* creature) const override
155 {
156 return GetZulFarrakAI<boss_zum_rahAI>(creature);
157 }
158};
159
161{
162 new boss_zum_rah();
163}
uint32_t uint32
Definition Define.h:133
@ DONE
Spells
Definition PlayerAI.cpp:32
@ FACTION_FRIENDLY
@ 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()
@ EVENT_SHADOWBOLT_VOLLEY
@ EVENT_WARD_OF_ZUM_RAH
@ EVENT_HEALING_WAVE
@ EVENT_SHADOW_BOLT
InstanceScript *const instance
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
void SetFaction(uint32 faction) override
Definition Unit.h:974
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
CreatureAI * GetAI(Creature *creature) const override
bool HealthBelowPct(uint32 pct) const
void JustEngagedWith(Unit *) override
void UpdateAI(uint32 diff) override
void KilledUnit(Unit *) override
boss_zum_rahAI(Creature *creature)
void JustDied(Unit *) override
@ DATA_ZUM_RAH
Definition zulfarrak.h:43