TrinityCore
Loading...
Searching...
No Matches
boss_zuramat.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 "InstanceScript.h"
20#include "ScriptedCreature.h"
21#include "SpellScript.h"
22#include "violet_hold.h"
23
33
45
51
52// 29314 - Zuramat the Obliterator
53// 32230 - Void Lord
54struct boss_zuramat : public BossAI
55{
56 boss_zuramat(Creature* creature) : BossAI(creature, DATA_ZURAMAT)
57 {
58 Initialize();
59 }
60
62 {
63 _voidDance = true;
64 }
65
66 void Reset() override
67 {
69 Initialize();
70 }
71
72 void JustEngagedWith(Unit* who) override
73 {
76 }
77
83
84 void SummonedCreatureDies(Creature* summon, Unit* /*who*/) override
85 {
86 if (summon->GetEntry() == NPC_VOID_SENTRY)
87 _voidDance = false;
88 }
89
90 void SummonedCreatureDespawn(Creature* summon) override
91 {
92 if (summon->GetEntry() == NPC_VOID_SENTRY)
95 }
96
97 uint32 GetData(uint32 type) const override
98 {
99 if (type == DATA_VOID_DANCE)
100 return _voidDance ? 1 : 0;
101
102 return 0;
103 }
104
105 void JustDied(Unit* /*killer*/) override
106 {
108 _JustDied();
109 }
110
111 void KilledUnit(Unit* victim) override
112 {
113 if (victim->GetTypeId() == TYPEID_PLAYER)
114 Talk(SAY_SLAY);
115 }
116
117 void UpdateAI(uint32 diff) override
118 {
119 if (!UpdateVictim())
120 return;
121
122 scheduler.Update(diff,
123 std::bind(&BossAI::DoMeleeAttackIfReady, this));
124 }
125
126 void ScheduleTasks() override
127 {
128 scheduler.Schedule(4s, [this](TaskContext task)
129 {
131 task.Repeat(7s, 10s);
132 });
133
134 scheduler.Schedule(9s, [this](TaskContext task)
135 {
136 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
137 DoCast(target, SPELL_VOID_SHIFT);
138 task.Repeat(15s);
139 });
140
141 scheduler.Schedule(18s, 20s, [this](TaskContext task)
142 {
144 task.Repeat(18s, 20s);
145 });
146 }
147
148private:
150};
151
152// 29364 - Void Sentry
154{
155 npc_void_sentry(Creature* creature) : ScriptedAI(creature), _summons(creature)
156 {
158 }
159
160 void IsSummonedBy(WorldObject* /*summoner*/) override
161 {
163 }
164
165 void JustSummoned(Creature* summon) override
166 {
167 _summons.Summon(summon);
169 }
170
171 void SummonedCreatureDespawn(Creature* summon) override
172 {
173 _summons.Despawn(summon);
174 }
175
176 void DoAction(int32 actionId) override
177 {
178 if (actionId == ACTION_DESPAWN_VOID_SENTRY_BALL)
180 }
181
182 void JustDied(Unit* /*killer*/) override
183 {
185 }
186
187private:
189};
190
191// 54361, 59743 - Void Shift
211
213{
214 public:
215 achievement_void_dance() : AchievementCriteriaScript("achievement_void_dance") { }
216
217 bool OnCheck(Player* /*player*/, Unit* target) override
218 {
219 if (!target)
220 return false;
221
222 if (Creature* Zuramat = target->ToCreature())
223 if (Zuramat->AI()->GetData(DATA_VOID_DANCE))
224 return true;
225
226 return false;
227 }
228};
229
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ EFFECT_0
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
#define AuraEffectRemoveFn(F, I, N, M)
@ REACT_PASSIVE
ZuramatSpells
@ SPELL_ZURAMAT_ADD_DUMMY
@ SPELL_ZURAMAT_ADD_2
@ SPELL_SUMMON_VOID_SENTRY
@ SPELL_VOID_SHIFT
@ SPELL_VOID_SHIFTED
@ SPELL_SUMMON_VOID_SENTRY_BALL
@ SPELL_ZURAMAT_ADD
@ SPELL_SHROUD_OF_DARKNESS
ZuramatMisc
@ DATA_VOID_DANCE
@ ACTION_DESPAWN_VOID_SENTRY_BALL
void AddSC_boss_zuramat()
ZuramatTexts
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_WHISPER
@ SAY_SLAY
@ SAY_SHIELD
@ SAY_SPAWN
HookList< EffectApplyHandler > AfterEffectRemove
Unit * GetTarget() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
TaskScheduler scheduler
void JustReachedHome() override
void SummonedCreatureDespawn(Creature *summon) override
void Reset() override
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetReactState(ReactStates st)
Definition Creature.h:119
CreatureAI * AI() const
Definition Creature.h:154
static Creature * ToCreature(Object *o)
Definition Object.h:186
TypeID GetTypeId() const
Definition Object.h:93
uint32 GetEntry() const
Definition Object.h:81
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
TaskScheduler & Update(success_t const &callback=EmptyCallback)
virtual void DoAction(int32)
Definition UnitAI.h:154
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 DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
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)
bool OnCheck(Player *, Unit *target) override
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_zuramat_void_shift)
void ScheduleTasks() override
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
void SummonedCreatureDespawn(Creature *summon) override
void JustReachedHome() override
void SummonedCreatureDies(Creature *summon, Unit *) override
uint32 GetData(uint32 type) const override
void Reset() override
void UpdateAI(uint32 diff) override
boss_zuramat(Creature *creature)
void KilledUnit(Unit *victim) override
void SummonedCreatureDespawn(Creature *summon) override
void JustSummoned(Creature *summon) override
void DoAction(int32 actionId) override
void JustDied(Unit *) override
void IsSummonedBy(WorldObject *) override
npc_void_sentry(Creature *creature)
SummonList _summons
@ DATA_HANDLE_CELLS
Definition violet_hold.h:86
@ DATA_ZURAMAT
Definition violet_hold.h:58
#define RegisterVioletHoldCreatureAI(ai_name)
@ NPC_VOID_SENTRY