TrinityCore
Loading...
Searching...
No Matches
boss_void_reaver.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 "ScriptedCreature.h"
21#include "SpellInfo.h"
22#include "the_eye.h"
23
31
39
47
48// 19516 - Void Reaver
49struct boss_void_reaver : public BossAI
50{
52
66
67 void OnSpellCast(SpellInfo const* spell) override
68 {
69 if (spell->Id == SPELL_POUNDING)
71 }
72
73 void KilledUnit(Unit* /*victim*/) override
74 {
76 }
77
78 void JustDied(Unit* /*killer*/) override
79 {
81 _JustDied();
82 }
83
84 void UpdateAI(uint32 diff) override
85 {
86 if (!UpdateVictim())
87 return;
88
89 events.Update(diff);
90
92 return;
93
94 while (uint32 eventId = events.ExecuteEvent())
95 {
96 switch (eventId)
97 {
98 case EVENT_POUNDING:
100 events.Repeat(12s, 14s);
101 break;
102 case EVENT_ARCANE_ORB:
103 {
104 std::vector<Unit*> target_list;
106 {
107 Unit* target = ref->GetVictim();
108 if (target->GetTypeId() == TYPEID_PLAYER && target->IsAlive() && !target->IsWithinDist(me, 18, false))
109 target_list.push_back(target);
110 }
111
112 Unit* target;
113 if (!target_list.empty())
115 else
116 target = me->GetVictim();
117
118 if (target)
119 DoCast(target, SPELL_ARCANE_ORB);
120
121 events.Repeat(3s);
122 break;
123 }
124 case EVENT_KNOCK_AWAY:
126 events.Repeat(20s, 22s);
127 break;
128 case EVENT_BERSERK:
130 break;
131 default:
132 break;
133 }
134
136 return;
137 }
138
140 }
141};
142
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ SPELL_ARCANE_ORB
@ SPELL_KNOCK_AWAY
@ SPELL_BERSERK
@ SPELL_POUNDING
@ EVENT_POUNDING
@ EVENT_ARCANE_ORB
@ EVENT_KNOCK_AWAY
@ EVENT_BERSERK
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_POUNDING
@ SAY_SLAY
void AddSC_boss_void_reaver()
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void CallForHelp(float fRadius)
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
TypeID GetTypeId() const
Definition Object.h:93
uint32 Id
Definition SpellInfo.h:289
Trinity::IteratorPair< ThreatListIterator, std::nullptr_t > GetUnsortedThreatList() const
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
ThreatManager & GetThreatManager()
Definition Unit.h:1155
bool IsAlive() const
Definition Unit.h:1234
Unit * GetVictim() const
Definition Unit.h:859
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1187
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
void OnSpellCast(SpellInfo const *spell) override
void JustEngagedWith(Unit *who) override
boss_void_reaver(Creature *creature)
void KilledUnit(Unit *) override
#define RegisterTheEyeCreatureAI(ai_name)
Definition the_eye.h:74
@ DATA_VOID_REAVER
Definition the_eye.h:32