TrinityCore
boss_wrath_scryer_soccothrates.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/* ScriptData
19SDName: boss_wrath_scryer_soccothrates
20SD%Complete: 95%
21SDComment: charge left to script
22SDCategory: Tempest Keep, The Arcatraz
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "arcatraz.h"
27#include "InstanceScript.h"
28#include "MotionMaster.h"
29#include "ObjectAccessor.h"
30#include "ScriptedCreature.h"
31
32enum Say
33{
34 // Wrath-Scryer Soccothrates
44
45 // Dalliah the Doomsayer
51};
52
54{
59 SPELL_CHARGE = 35754,
62};
63
64#define SPELL_FEL_IMMOLATION DUNGEON_MODE<uint32>(SPELL_FEL_IMMOLATION_NORMAL, SPELL_FEL_IMMOLATION_HEROIC)
65
67{
70
82};
83
85{
87 {
88 preFight = false;
89 dalliahTaunt = false;
90 dalliahDeath = false;
91 }
92
93 void Reset() override
94 {
95 _Reset();
96 preFight = false;
97 dalliahTaunt = false;
98 dalliahDeath = false;
99
101 }
102
103 void JustDied(Unit* /*killer*/) override
104 {
105 _JustDied();
107
109 if (dalliah->IsAlive() && !dalliah->IsInCombat())
110 dalliah->AI()->SetData(1, 1);
111 }
112
113 void JustEngagedWith(Unit* who) override
114 {
120 preFight = false;
121 }
122
123 void KilledUnit(Unit* /*victim*/) override
124 {
125 Talk(SAY_SLAY);
126 }
127
128 void MoveInLineOfSight(Unit* who) override
129 {
131 {
134
135 preFight = true;
137 }
138 }
139
140 void SetData(uint32 /*type*/, uint32 data) override
141 {
142 switch (data)
143 {
144 case 1:
146 dalliahDeath = true;
147 break;
148 default:
149 break;
150 }
151 }
152
153 void UpdateAI(uint32 diff) override
154 {
155 if (!UpdateVictim())
156 {
157 if (preFight)
158 {
159 events.Update(diff);
160
161 while (uint32 eventId = events.ExecuteEvent())
162 {
163 switch (eventId)
164 {
165 case EVENT_PREFIGHT_1:
167 dalliah->AI()->Talk(SAY_DALLIAH_CONVO_1);
169 break;
170 case EVENT_PREFIGHT_2:
173 break;
174 case EVENT_PREFIGHT_3:
176 dalliah->AI()->Talk(SAY_DALLIAH_CONVO_2);
178 break;
179 case EVENT_PREFIGHT_4:
182 break;
183 case EVENT_PREFIGHT_5:
185 dalliah->AI()->Talk(SAY_DALLIAH_CONVO_3);
187 break;
188 case EVENT_PREFIGHT_6:
191 break;
192 case EVENT_PREFIGHT_7:
194 dalliah->GetMotionMaster()->MovePoint(0, 118.6048f, 96.84852f, 22.44115f);
196 break;
197 case EVENT_PREFIGHT_8:
198 me->GetMotionMaster()->MovePoint(0, 122.1035f, 192.7203f, 22.44115f);
200 break;
201 case EVENT_PREFIGHT_9:
203 {
204 dalliah->SetFacingToObject(me);
205 me->SetFacingToObject(dalliah);
206 dalliah->SetHomePosition(dalliah->GetPositionX(), dalliah->GetPositionY(), dalliah->GetPositionZ(), 1.51737f);
208 preFight = false;
209 }
210 break;
211 default:
212 break;
213 }
214 }
215 }
216
217 if (dalliahDeath)
218 {
219 events.Update(diff);
220
221 while (uint32 eventId = events.ExecuteEvent())
222 {
223 switch (eventId)
224 {
227 break;
228 default:
229 break;
230 }
231 }
232 }
233
234 return;
235 }
236
237 events.Update(diff);
238
240 return;
241
242 while (uint32 eventId = events.ExecuteEvent())
243 {
244 switch (eventId)
245 {
249 break;
250 case EVENT_KNOCK_AWAY:
254 break;
255 case EVENT_ME_FIRST:
257 if (dalliah->IsAlive() && !dalliah->IsInCombat())
258 dalliah->AI()->Talk(SAY_AGGRO_SOCCOTHRATES_FIRST);
259 break;
260 default:
261 break;
262 }
263
265 return;
266 }
267
268 if (HealthBelowPct(25) && !dalliahTaunt)
269 {
271 dalliah->AI()->Talk(SAY_SOCCOTHRATES_25_PERCENT);
272 dalliahTaunt = true;
273 }
274 }
275
276private:
280};
281
283{
285}
uint32_t uint32
Definition: Define.h:142
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
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_CONVERSATION
Definition: arcatraz.h:37
@ DATA_DALLIAH
Definition: arcatraz.h:32
#define SPELL_FEL_IMMOLATION
void AddSC_boss_wrath_scryer_soccothrates()
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
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:371
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
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
TypeID GetTypeId() const
Definition: Object.h:173
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
void SetFacingToObject(WorldObject const *object, bool force=true)
Definition: Unit.cpp:12671
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1147
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
constexpr float GetPositionZ() const
Definition: Position.h:78
bool HealthBelowPct(uint32 pct) const
void SetData(uint32, uint32 data) override