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 }
124
125 void ScheduleTasks() override
126 {
127 scheduler.Schedule(4s, [this](TaskContext& task)
128 {
130 task.Repeat(7s, 10s);
131 });
132
133 scheduler.Schedule(9s, [this](TaskContext& task)
134 {
135 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
136 DoCast(target, SPELL_VOID_SHIFT);
137 task.Repeat(15s);
138 });
139
140 scheduler.Schedule(18s, 20s, [this](TaskContext& task)
141 {
143 task.Repeat(18s, 20s);
144 });
145 }
146
147private:
149};
150
151// 29364 - Void Sentry
153{
154 npc_void_sentry(Creature* creature) : ScriptedAI(creature), _summons(creature)
155 {
157 }
158
159 void IsSummonedBy(WorldObject* /*summoner*/) override
160 {
162 }
163
164 void JustSummoned(Creature* summon) override
165 {
166 _summons.Summon(summon);
168 }
169
170 void SummonedCreatureDespawn(Creature* summon) override
171 {
172 _summons.Despawn(summon);
173 }
174
175 void DoAction(int32 actionId) override
176 {
177 if (actionId == ACTION_DESPAWN_VOID_SENTRY_BALL)
179 }
180
181 void JustDied(Unit* /*killer*/) override
182 {
184 }
185
186private:
188};
189
190// 54361, 59743 - Void Shift
192{
193 bool Validate(SpellInfo const* /*spellInfo*/) override
194 {
196 }
197
198 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
199 {
201 }
202
207};
208
210{
211 public:
212 achievement_void_dance() : AchievementCriteriaScript("achievement_void_dance") { }
213
214 bool OnCheck(Player* /*player*/, Unit* target) override
215 {
216 if (!target)
217 return false;
218
219 if (Creature* Zuramat = target->ToCreature())
220 if (Zuramat->AI()->GetData(DATA_VOID_DANCE))
221 return true;
222
223 return false;
224 }
225};
226
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ 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
TypeID GetTypeId() const
Definition BaseEntity.h:166
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:63
void SetReactState(ReactStates st)
Definition Creature.h:180
CreatureAI * AI() const
Definition Creature.h:235
uint32 GetEntry() const
Definition Object.h:89
Creature * ToCreature()
Definition Object.h:121
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
virtual void DoAction(int32 param)
Definition UnitAI.h:73
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
bool OnCheck(Player *, Unit *target) override
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
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:87
@ DATA_ZURAMAT
Definition violet_hold.h:59
#define RegisterVioletHoldCreatureAI(ai_name)
@ NPC_VOID_SENTRY