TrinityCore
boss_dalliah_the_doomsayer.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#include "ScriptMgr.h"
19#include "arcatraz.h"
20#include "InstanceScript.h"
21#include "ObjectAccessor.h"
22#include "ScriptedCreature.h"
23
24enum Say
25{
26 // Dalliah the Doomsayer
33
34 // Wrath-Scryer Soccothrates
37};
38
40{
43 SPELL_HEAL = 36144,
44 SPELL_SHADOW_WAVE = 39016 // Heroic only
45};
46
48{
52 EVENT_SHADOW_WAVE = 4, // Heroic only
55};
56
58{
60 {
61 soccothratesTaunt = false;
62 soccothratesDeath = false;
63 }
64
65 void Reset() override
66 {
67 _Reset();
68 soccothratesTaunt = false;
69 soccothratesDeath = false;
70 }
71
72 void JustDied(Unit* /*killer*/) override
73 {
74 _JustDied();
76
78 if (soccothrates->IsAlive() && !soccothrates->IsInCombat())
79 soccothrates->AI()->SetData(1, 1);
80 }
81
82 void JustEngagedWith(Unit* who) override
83 {
87 if (IsHeroic())
91 }
92
93 void KilledUnit(Unit* /*victim*/) override
94 {
96 }
97
98 void SetData(uint32 /*type*/, uint32 data) override
99 {
100 switch (data)
101 {
102 case 1:
104 soccothratesDeath = true;
105 break;
106 default:
107 break;
108 }
109 }
110
111 void UpdateAI(uint32 diff) override
112 {
113 if (!UpdateVictim())
114 {
116 {
117 events.Update(diff);
118
119 while (uint32 eventId = events.ExecuteEvent())
120 {
121 switch (eventId)
122 {
125 break;
126 default:
127 break;
128 }
129 }
130 }
131
132 return;
133 }
134
135 events.Update(diff);
136
138 return;
139
140 while (uint32 eventId = events.ExecuteEvent())
141 {
142 switch (eventId)
143 {
147 break;
148 case EVENT_WHIRLWIND:
153 break;
154 case EVENT_HEAL:
156 Talk(SAY_HEAL);
157 break;
161 break;
162 case EVENT_ME_FIRST:
164 if (soccothrates->IsAlive() && !soccothrates->IsInCombat())
165 soccothrates->AI()->Talk(SAY_AGGRO_DALLIAH_FIRST);
166 break;
167 default:
168 break;
169 }
170
172 return;
173 }
174
176 {
178 soccothrates->AI()->Talk(SAY_DALLIAH_25_PERCENT);
179 soccothratesTaunt = true;
180 }
181 }
182
183private:
186};
187
189{
191}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
#define RegisterArcatrazCreatureAI(ai_name)
Definition: arcatraz.h:79
@ DATA_SOCCOTHRATES
Definition: arcatraz.h:33
@ DATA_DALLIAH
Definition: arcatraz.h:32
@ SPELL_GIFT_OF_THE_DOOMSAYER
void AddSC_boss_dalliah_the_doomsayer()
@ EVENT_GIFT_OF_THE_DOOMSAYER
@ EVENT_SOCCOTHRATES_DEATH
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
virtual ObjectGuid GetGuidData(uint32 type) const override
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
bool IsHeroic() const
bool HealthBelowPct(uint32 pct) const
void JustEngagedWith(Unit *who) override
boss_dalliah_the_doomsayer(Creature *creature)
void UpdateAI(uint32 diff) override
void SetData(uint32, uint32 data) override