TrinityCore
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 "violet_hold.h"
22
24{
33};
34
36{
42 SAY_WHISPER = 5
43};
44
45enum Misc
46{
48 DATA_VOID_DANCE = 2153
49};
50
51struct boss_zuramat : public BossAI
52{
53 boss_zuramat(Creature* creature) : BossAI(creature, DATA_ZURAMAT)
54 {
55 Initialize();
56 }
57
59 {
60 _voidDance = true;
61 }
62
63 void Reset() override
64 {
66 Initialize();
67 }
68
69 void JustEngagedWith(Unit* who) override
70 {
73 }
74
75 void JustReachedHome() override
76 {
79 }
80
81 void SummonedCreatureDies(Creature* summon, Unit* /*who*/) override
82 {
83 if (summon->GetEntry() == NPC_VOID_SENTRY)
84 _voidDance = false;
85 }
86
87 void SummonedCreatureDespawn(Creature* summon) override
88 {
89 if (summon->GetEntry() == NPC_VOID_SENTRY)
92 }
93
94 uint32 GetData(uint32 type) const override
95 {
96 if (type == DATA_VOID_DANCE)
97 return _voidDance ? 1 : 0;
98
99 return 0;
100 }
101
102 void JustDied(Unit* /*killer*/) override
103 {
105 _JustDied();
106 }
107
108 void KilledUnit(Unit* victim) override
109 {
110 if (victim->GetTypeId() == TYPEID_PLAYER)
111 Talk(SAY_SLAY);
112 }
113
114 void UpdateAI(uint32 diff) override
115 {
116 if (!UpdateVictim())
117 return;
118
119 scheduler.Update(diff);
120 }
121
122 void ScheduleTasks() override
123 {
124 scheduler.Schedule(Seconds(4), [this](TaskContext task)
125 {
127 task.Repeat(Seconds(7), Seconds(10));
128 });
129
130 scheduler.Schedule(Seconds(9), [this](TaskContext task)
131 {
132 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
133 DoCast(target, SPELL_VOID_SHIFT);
134 task.Repeat(Seconds(15));
135 });
136
137 scheduler.Schedule(Seconds(18), Seconds(20), [this](TaskContext task)
138 {
140 task.Repeat(Seconds(18), Seconds(20));
141 });
142 }
143
144private:
146};
147
149{
150 npc_void_sentry(Creature* creature) : ScriptedAI(creature), _summons(creature)
151 {
153 }
154
155 void IsSummonedBy(WorldObject* /*summoner*/) override
156 {
158 }
159
160 void JustSummoned(Creature* summon) override
161 {
162 _summons.Summon(summon);
164 }
165
166 void SummonedCreatureDespawn(Creature* summon) override
167 {
168 _summons.Despawn(summon);
169 }
170
171 void DoAction(int32 actionId) override
172 {
173 if (actionId == ACTION_DESPAWN_VOID_SENTRY_BALL)
175 }
176
177 void JustDied(Unit* /*killer*/) override
178 {
180 }
181
182private:
184};
185
187{
188 public:
189 achievement_void_dance() : AchievementCriteriaScript("achievement_void_dance") { }
190
191 bool OnCheck(Player* /*player*/, Unit* target) override
192 {
193 if (!target)
194 return false;
195
196 if (Creature* Zuramat = target->ToCreature())
197 if (Zuramat->AI()->GetData(DATA_VOID_DANCE))
198 return true;
199
200 return false;
201 }
202};
203
205{
209}
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
@ REACT_PASSIVE
Definition: UnitDefines.h:506
Yells
@ DATA_VOID_DANCE
@ ACTION_DESPAWN_VOID_SENTRY_BALL
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_WHISPER
@ SAY_SLAY
@ SAY_SHIELD
@ SAY_SPAWN
@ 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
void AddSC_boss_zuramat()
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
TaskScheduler scheduler
void JustReachedHome() override
void SummonedCreatureDespawn(Creature *summon) override
void Reset() override
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetReactState(ReactStates st)
Definition: Creature.h:160
CreatureAI * AI() const
Definition: Creature.h:214
static Creature * ToCreature(Object *o)
Definition: Object.h:219
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
virtual void DoAction(int32)
Definition: UnitAI.h:72
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
bool OnCheck(Player *, Unit *target) override
void ScheduleTasks() override
void JustEngagedWith(Unit *who) override
void JustDied(Unit *) override
void SummonedCreatureDespawn(Creature *summon) override
void Initialize()
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)
Definition: violet_hold.h:164
@ NPC_VOID_SENTRY
Definition: violet_hold.h:103