TrinityCore
Loading...
Searching...
No Matches
boss_xevozz.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 "InstanceScript.h"
21#include "MotionMaster.h"
22#include "Player.h"
23#include "ScriptedCreature.h"
24#include "SpellInfo.h"
25#include "SpellScript.h"
26#include "violet_hold.h"
27
28/*
29 * TODO:
30 * - Implement Ethereal Summon Target
31 */
32
34{
35 // Xevozz
43
44 // Ethereal Sphere
46};
47
54
55static uint32 const EtherealSphereCount = 3;
56static uint32 const EtherealSphereSummonSpells[EtherealSphereCount] = { 54102, 54137, 54138 };
57static uint32 const EtherealSphereHeroicSummonSpells[EtherealSphereCount] = { 54102, 54137, 54138 };
58
65
75
80
81// 29266 - Xevozz
82// 32231 - Ethereal Wind Trader
83struct boss_xevozz : public BossAI
84{
85 boss_xevozz(Creature* creature) : BossAI(creature, DATA_XEVOZZ) { }
86
87 void Reset() override
88 {
90 }
91
92 void JustEngagedWith(Unit* who) override
93 {
96 }
97
103
104 void JustSummoned(Creature* summon) override
105 {
106 BossAI::JustSummoned(summon);
107 summon->GetMotionMaster()->MoveFollow(me, 0.0f, 0.0f);
108 }
109
110 void KilledUnit(Unit* victim) override
111 {
112 if (victim->GetTypeId() == TYPEID_PLAYER)
113 Talk(SAY_SLAY);
114 }
115
116 void JustDied(Unit* /*killer*/) override
117 {
119 _JustDied();
120 }
121
122 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
123 {
124 if (spellInfo->Id == SPELL_ARCANE_POWER || spellInfo->Id == H_SPELL_ARCANE_POWER)
126 }
127
128 void UpdateAI(uint32 diff) override
129 {
130 if (!UpdateVictim())
131 return;
132
133 scheduler.Update(diff,
134 std::bind(&BossAI::DoMeleeAttackIfReady, this));
135 }
136
137 void ScheduleTasks() override
138 {
139 scheduler.Schedule(8s, 10s, [this](TaskContext task)
140 {
142 task.Repeat(8s, 10s);
143 });
144
145 scheduler.Schedule(10s, 11s, [this](TaskContext task)
146 {
147 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
149 task.Repeat(15s, 20s);
150 });
151
152 scheduler.Schedule(5s, [this](TaskContext task)
153 {
155
156 std::list<uint8> summonSpells = { 0, 1, 2 };
157
160 summonSpells.remove(spell);
161
162 if (IsHeroic())
163 {
165 task.Schedule(Milliseconds(2500), [this, spell](TaskContext /*task*/)
166 {
168 });
169 }
170
171 task.Schedule(33s, 35s, [this](TaskContext /*task*/)
172 {
175 });
176
177 task.Repeat(45s, 47s);
178 });
179 }
180};
181
182// 29271 - Ethereal Sphere
183// 32582 - Ethereal Sphere
185{
187 {
188 instance = creature->GetInstanceScript();
189 }
190
191 void Reset() override
192 {
195
198
199 me->DespawnOrUnsummon(40s);
200 }
201
202 void DoAction(int32 action) override
203 {
204 if (action == ACTION_SUMMON)
205 {
208 }
209 }
210
211 void UpdateAI(uint32 diff) override
212 {
213 scheduler.Update(diff);
214 }
215
217 {
218 scheduler.Schedule(1s, [this](TaskContext task)
219 {
221 {
222 if (me->IsWithinDist(xevozz, 3.0f))
223 {
224 DoCastAOE(SPELL_ARCANE_POWER);
225 me->DespawnOrUnsummon(8s);
226 return;
227 }
228 }
229 task.Repeat();
230 });
231 }
232
233private:
236};
237
238// 54164 - Summon Players
258
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
#define SpellEffectFn(F, I, N)
void AddSC_boss_xevozz()
XevozzTexts
@ SAY_DEATH
@ SAY_REPEAT_SUMMON
@ SAY_ETHEREAL_SPHERE_SUMMON
@ SAY_AGGRO
@ SAY_SUMMON_ENERGY
@ SAY_SLAY
@ SAY_SPAWN
@ SAY_CHARGED
XevozzActions
@ ACTION_SUMMON
XevozzSpells
@ SPELL_ARCANE_BARRAGE_VOLLEY
@ SPELL_ARCANE_BUFFET
@ SPELL_SUMMON_TARGET_VISUAL
static uint32 const EtherealSphereCount
XevozzCreatures
@ NPC_ETHEREAL_SPHERE
@ NPC_ETHEREAL_SPHERE2
@ NPC_ETHEREAL_SUMMON_TARGET
static uint32 const EtherealSphereSummonSpells[EtherealSphereCount]
XevozzCreatureSpells
@ SPELL_POWER_BALL_DAMAGE_TRIGGER
@ SPELL_POWER_BALL_VISUAL
@ SPELL_ARCANE_POWER
@ H_SPELL_ARCANE_POWER
@ SPELL_SUMMON_PLAYERS
@ SPELL_MAGIC_PULL
static uint32 const EtherealSphereHeroicSummonSpells[EtherealSphereCount]
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void JustSummoned(Creature *summon) override
TaskScheduler scheduler
void JustReachedHome() override
SummonList summons
void Reset() override
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Creature * GetCreature(uint32 type)
void MoveFollow(Unit *target, float dist, ChaseAngle angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
TypeID GetTypeId() const
Definition Object.h:93
uint32 Id
Definition SpellInfo.h:289
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
void DoAction(int32 info, Predicate &&predicate, uint16 max=0)
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
TaskContext & Schedule(std::chrono::duration< _Rep, _Period > const &time, TaskScheduler::task_handler_t const &task)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
TaskScheduler & Update(success_t const &callback=EmptyCallback)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
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 DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_xevozz_summon_players)
bool Validate(SpellInfo const *) override
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
bool IsHeroic() const
void JustSummoned(Creature *summon) override
void JustReachedHome() override
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
boss_xevozz(Creature *creature)
void KilledUnit(Unit *victim) override
void Reset() override
void JustEngagedWith(Unit *who) override
void ScheduleTasks() override
void UpdateAI(uint32 diff) override
npc_ethereal_sphere(Creature *creature)
TaskScheduler scheduler
InstanceScript * instance
void Reset() override
void DoAction(int32 action) override
@ DATA_HANDLE_CELLS
Definition violet_hold.h:86
@ DATA_XEVOZZ
Definition violet_hold.h:57
#define RegisterVioletHoldCreatureAI(ai_name)