TrinityCore
boss_anraphet.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 "Containers.h"
20#include "GridNotifiers.h"
22#include "InstanceScript.h"
23#include "Map.h"
24#include "MotionMaster.h"
25#include "ObjectAccessor.h"
26#include "Player.h"
27#include "ScriptedCreature.h"
28#include "SpellAuraEffects.h"
29#include "SpellScript.h"
30
32{
38
39 BRANN_SAY_DOOR_INTRO = 0, // Right, let's go! Just need to input the final entry sequence into the door mechanism... and...
40 BRANN_SAY_UNLOCK_DOOR = 1, // That did the trick! The control room should be right behind this... oh... wow...
41 BRANN_SAY_TROGGS = 2, // What? This isn't the control room! There's another entire defense mechanism in place, and the blasted Rock Troggs broke into here somehow. Troggs. Why did it have to be Troggs!
42 BRANN_SAY_THINK = 3, // Ok, let me think a moment.
43 BRANN_SAY_MIRRORS = 4, // Mirrors pointing all over the place.
44 BRANN_SAY_ELEMENTALS = 5, // Four platforms with huge elementals.
45 BRANN_SAY_GET_IT = 6, // I got it! I saw a tablet that mentioned this chamber. This is the Vault of Lights! Ok, simple enough. I need you adventurers to take out each of the four elementals to trigger the opening sequence for the far door!
46 BRANN_1_ELEMENTAL_DEAD = 7, // One down!
47 BRANN_2_ELEMENTAL_DEAD = 8, // Another one down! Just look at those light beams! They seem to be connecting to the far door!
48 BRANN_3_ELEMENTAL_DEAD = 9, // One more elemental to go! The door is almost open!
49 BRANN_4_ELEMENTAL_DEAD = 10, // That''s it, you''ve done it! The vault door is opening! Now we can... oh, no!
50 BRANN_SAY_ANRAPHET_DIED = 11, // We''ve done it! The control room is breached!
51 BRANN_SAY_MOMENT = 12 // Here we go! Now this should only take a moment...
52};
53
55{
65
75};
76
78{
80
83
85
87
91};
92
94{
97
99};
100
102{
106
108{
110};
111
112Position const AnraphetActivatePos = {-193.656f, 366.689f, 75.91001f, 3.138207f};
113
115{
116 {-429.583f, 367.019f, 89.79282f, 0.0f},
117 {-409.9531f, 367.0469f, 89.81111f, 0.0f},
118 {-397.8246f, 366.967f, 86.37722f, 0.0f},
119 {-383.7813f, 366.8229f, 82.07919f, 0.0f},
120 {-368.2604f, 366.7448f, 77.0984f, 0.0f},
121 {-353.6458f, 366.4896f, 75.92504f, 0.0f},
122 {-309.0608f, 366.7205f, 75.91345f, 0.0f},
123 {-276.3303f, 367.0f, 75.92413f, 0.0f},
124 {-246.5104f, 366.6389f, 75.87791f, 0.0f},
125 {-202.0417f, 366.7517f, 75.92508f, 0.0f},
126 {-187.6024f, 366.7656f, 76.23077f, 0.0f},
127 {-155.0938f, 366.783f, 86.45834f, 0.0f},
128 {-143.5694f, 366.8177f, 89.73354f, 0.0f},
129 {-128.5608f, 366.8629f, 89.74199f, 0.0f},
130 {-103.559f, 366.5938f, 89.79725f, 0.0f},
131 {-71.58507f, 367.0278f, 89.77069f, 0.0f},
132 {-35.04861f, 366.6563f, 89.77447f, 0.0f},
133};
134
135struct boss_anraphet : public BossAI
136{
137 boss_anraphet(Creature* creature) : BossAI(creature, BOSS_ANRAPHET) { }
138
140 {
144 }
145
146 void Reset() override
147 {
148 _Reset();
149 me->SetWalk(false);
152 {
153 // Set to combat automatically, Brann's event won't repeat
154 me->SetUninteractible(false);
158 }
159 }
160
161 void JustEngagedWith(Unit* who) override
162 {
166 }
167
168 void JustDied(Unit* /*killer*/) override
169 {
172
174 brann->AI()->DoAction(ACTION_ANRAPHET_DIED);
175
176 _JustDied();
177 }
178
179 void KilledUnit(Unit* victim) override
180 {
181 if (victim->GetTypeId() == TYPEID_PLAYER)
183 }
184
185 void JustReachedHome() override
186 {
190 }
191
192 void DoAction(int32 action) override
193 {
194 if (action == ACTION_ANRAPHET_INTRO)
196 }
197
198 void MovementInform(uint32 type, uint32 point) override
199 {
200 if (type != POINT_MOTION_TYPE)
201 return;
202
203 if (point == POINT_ANRAPHET_ACTIVATE)
204 {
207 }
208 }
209
210 void UpdateAI(uint32 diff) override
211 {
213 return;
214
215 events.Update(diff);
216
218 return;
219
220 while (uint32 eventId = events.ExecuteEvent())
221 {
222 switch (eventId)
223 {
225 me->SetWalk(true);
227 break;
229 me->SetWalk(false);
232 return;
236 break;
238 me->SetUninteractible(false);
241 break;
245 break;
250 break;
257 break;
260 break;
261 }
262 }
263 }
264};
265
267{
268 npc_omega_stance(Creature* creature) : ScriptedAI(creature) { }
269
270 void IsSummonedBy(WorldObject* /*who*/) override
271 {
273 }
274
275 void EnterEvadeMode(EvadeReason /*why*/) override { }
276};
277
279{
280 npc_alpha_beam(Creature* creature) : ScriptedAI(creature), _instance(nullptr) { }
281
282 void InitializeAI() override
283 {
285 }
286
287 void IsSummonedBy(WorldObject* /*summoner*/) override
288 {
290 anraphet->CastSpell(me, SPELL_ALPHA_BEAMS_BACK_CAST);
291 }
292
293 void EnterEvadeMode(EvadeReason /*why*/) override { } // Never evade
294
295private:
297};
298
300{
302
303 void InitializeAI() override
304 {
306 }
307
308 bool OnGossipSelect(Player* /*player*/, uint32 menuId, uint32 action) override
309 {
311 return true;
312
313 if (menuId == GOSSIP_MENU_START_INTRO && !action)
314 {
316 _currentPoint = 0;
317 events.Reset();
319 me->SetWalk(true);
322 }
323 return false;
324 }
325
326 void DoAction(int32 action) override
327 {
328 switch (action)
329 {
331 {
333 Talk(BRANN_1_ELEMENTAL_DEAD + dead - 1);
334 if (dead == 4)
335 {
338 anraphet->AI()->DoAction(ACTION_ANRAPHET_INTRO);
339 }
340 break;
341 }
345 break;
346 }
347 }
348
349 void UpdateAI(uint32 diff) override
350 {
351 events.Update(diff);
352
353 while (uint32 eventId = events.ExecuteEvent())
354 {
355 switch (eventId)
356 {
360 break;
366 break;
370 break;
372 me->SetFacingTo(5.445427f);
375 break;
377 me->SetFacingTo(0.6283185f);
379 break;
381 me->SetFacingTo(0.01745329f);
383 break;
387 break;
391 break;
393 me->SetFacingTo(3.141593f);
394 break;
395 }
396 }
397 }
398
399 void MovementInform(uint32 movementType, uint32 pointId) override
400 {
401 if (movementType != POINT_MOTION_TYPE)
402 return;
403
404 _currentPoint = pointId + 1;
405 Milliseconds delay = 1ms;
406
407 switch (pointId)
408 {
409 case 0:
412 return;
413 case 1:
415 delay = 1s;
416 break;
417 case 14:
419 delay = 2200ms;
420 break;
421 case 16:
423 return;
424 default:
425 break;
426 }
427
429 }
430
431protected:
435};
436
438{
439 void FilterTargets(std::list<WorldObject*>& targets)
440 {
441 if (targets.empty())
442 return;
443
445 }
446
447 void Register() override
448 {
450 }
451};
452
453// 77106 - Omega Stance (Summon)
455{
457 {
458 dest.RelocateOffset({ 0.0f, 0.0f, 30.0f, 0.0f });
459 }
460
461 void Register() override
462 {
464 }
465};
466
468{
475}
Texts
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
@ IN_PROGRESS
@ FAIL
@ DONE
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ POINT_MOTION_TYPE
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
@ EFFECT_0
Definition: SharedDefines.h:30
@ TARGET_DEST_DEST
@ TARGET_UNIT_SRC_AREA_ENEMY
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define SpellDestinationTargetSelectFn(F, I, N)
Definition: SpellScript.h:874
EvadeReason
Definition: UnitAICommon.h:30
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:297
@ UNIT_STATE_CASTING
Definition: Unit.h:270
Position const BrannIntroWaypoint[MAX_BRANN_WAYPOINTS_INTRO]
void AddSC_boss_anraphet()
@ MAX_BRANN_WAYPOINTS_INTRO
@ POINT_ANRAPHET_ACTIVATE
@ SPELL_NEMESIS_STRIKE
@ SPELL_DESTRUCTION_PROTOCOL
@ SPELL_ALPHA_BEAMS_BACK_CAST
@ SPELL_OMEGA_STANCE
@ SPELL_OMEGA_STANCE_SPIDER_TRIGGER
@ SPELL_CRUMBLING_RUIN
@ SPELL_OMEGA_STANCE_SUMMON
@ SPELL_ALPHA_BEAMS
@ PHASE_INTRO
@ PHASE_MASK_COMBAT
@ PHASE_COMBAT
Position const AnraphetActivatePos
@ ANRAPHET_SAY_KILL
@ BRANN_SAY_ANRAPHET_DIED
@ ANRAPHET_SAY_AGGRO
@ BRANN_SAY_ELEMENTALS
@ BRANN_SAY_MIRRORS
@ BRANN_SAY_THINK
@ BRANN_SAY_GET_IT
@ BRANN_2_ELEMENTAL_DEAD
@ BRANN_SAY_DOOR_INTRO
@ BRANN_SAY_UNLOCK_DOOR
@ ANRAPHET_SAY_DEATH
@ ANRAPHET_SAY_INTRO
@ BRANN_3_ELEMENTAL_DEAD
@ BRANN_1_ELEMENTAL_DEAD
@ ANRAPHET_SAY_OMEGA_STANCE
@ BRANN_SAY_MOMENT
@ BRANN_SAY_TROGGS
@ BRANN_4_ELEMENTAL_DEAD
GossipMenuIds
@ GOSSIP_MENU_START_INTRO
@ EVENT_ANRAPHET_NEMESIS_STRIKE
@ EVENT_BRANN_SET_ORIENTATION_3
@ EVENT_ANRAPHET_APPEAR
@ EVENT_BRANN_SAY_ELEMENTALS
@ EVENT_ANRAPHET_ACTIVATE_OMEGA
@ EVENT_ANRAPHET_CRUMBLING_RUIN
@ EVENT_BRANN_SET_ORIENTATION_2
@ EVENT_ANRAPHET_ALPHA_BEAMS
@ EVENT_BRANN_SET_ORIENTATION_1
@ EVENT_ANRAPHET_DESTROY
@ EVENT_ANRAPHET_OMEGA_STANCE
@ EVENT_BRANN_MOVE_INTRO
@ EVENT_BRANN_SAY_GET_IT
@ EVENT_ANRAPHET_READY
@ EVENT_ANRAPHET_ACTIVATE
@ EVENT_BRANN_SET_ORIENTATION_4
@ EVENT_BRANN_THINK
@ EVENT_BRANN_UNLOCK_DOOR
InstanceScript *const instance
void _JustReachedHome()
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
virtual bool CheckInRoom()
Definition: CreatureAI.cpp:453
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
uint8 GetPhaseMask() const
Definition: EventMap.h:75
void SetPhase(uint8 phase)
Definition: EventMap.cpp:28
void Reset()
Definition: EventMap.cpp:21
virtual bool SetBossState(uint32 id, EncounterState state)
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
Creature * GetCreature(uint32 type)
EncounterState GetBossState(uint32 id) const
void TriggerGameEvent(uint32 gameEventId, WorldObject *source=nullptr, WorldObject *target=nullptr) override
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
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
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
Definition: SpellScript.h:873
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:983
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:982
bool SetWalk(bool enable)
Definition: Unit.cpp:12707
void SetFacingTo(float const ori, bool force=true)
Definition: Unit.cpp:12653
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
void FilterTargets(std::list< WorldObject * > &targets)
void SetDest(SpellDestination &dest)
#define RegisterHallsOfOriginationCreatureAI(ai_name)
@ ACTION_ANRAPHET_INTRO
@ ACTION_ANRAPHET_DIED
@ ACTION_ELEMENTAL_DIED
@ DATA_BRANN_BRONZEBEARD
@ DATA_DEAD_ELEMENTALS
@ BOSS_ANRAPHET
@ BOSS_VAULT_OF_LIGHTS
@ SPELL_VAULT_OF_LIGHTS_CREDIT
@ ACHIEV_VAULT_OF_LIGHTS_EVENT
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
void RelocateOffset(Position const &offset)
Definition: Spell.cpp:122
void JustDied(Unit *) override
void DoAction(int32 action) override
void JustEngagedWith(Unit *who) override
void KilledUnit(Unit *victim) override
boss_anraphet(Creature *creature)
void MovementInform(uint32 type, uint32 point) override
void ScheduleCombatEvents()
void Reset() override
void UpdateAI(uint32 diff) override
void JustReachedHome() override
npc_alpha_beam(Creature *creature)
void IsSummonedBy(WorldObject *) override
void InitializeAI() override
InstanceScript * _instance
void EnterEvadeMode(EvadeReason) override
bool OnGossipSelect(Player *, uint32 menuId, uint32 action) override
void DoAction(int32 action) override
void MovementInform(uint32 movementType, uint32 pointId) override
void UpdateAI(uint32 diff) override
npc_brann_bronzebeard_anraphet(Creature *creature)
void EnterEvadeMode(EvadeReason) override
void IsSummonedBy(WorldObject *) override
npc_omega_stance(Creature *creature)