Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_zuramat.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
8#include "violet_hold.h"
9
21
23{
25};
26
36
37enum Misc
38{
40};
41
43{
44public:
45 boss_zuramat() : CreatureScript("boss_zuramat") { }
46
48 {
49 return new boss_zuramatAI(creature);
50 }
51
52 struct boss_zuramatAI : public ScriptedAI
53 {
54 boss_zuramatAI(Creature* creature) : ScriptedAI(creature)
55 {
56 instance = creature->GetInstanceScript();
57 }
58
60
65
67 {
68 if (instance)
69 {
70 if (instance->GetData(DATA_WAVE_COUNT) == 6)
72 else if (instance->GetData(DATA_WAVE_COUNT) == 12)
74 }
75
77 SpellVoidShiftTimer = 15000;
79 voidDance = true;
80 }
81
83 {
85 return;
86
87 if (me->Attack(who, true))
88 {
89 me->AddThreat(who, 0.0f);
90 me->SetInCombatWith(who);
91 who->SetInCombatWith(me);
92 DoStartMovement(who);
93 }
94 }
95
96 void EnterCombat(Unit* /*who*/) OVERRIDE
97 {
99 if (instance)
100 {
101 if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_ZURAMAT_CELL)))
102 if (pDoor->GetGoState() == GOState::GO_STATE_READY)
103 {
105 return;
106 }
107 if (instance->GetData(DATA_WAVE_COUNT) == 6)
109 else if (instance->GetData(DATA_WAVE_COUNT) == 12)
111 }
112 }
113
114 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
115
116
118 {
119 //Return since we have no target
120 if (!UpdateVictim())
121 return;
122
123 if (SpellSummonVoidTimer <= diff)
124 {
126 SpellSummonVoidTimer = 20000;
127 } else SpellSummonVoidTimer -=diff;
128
129 if (SpellVoidShiftTimer <= diff)
130 {
131 if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0))
133 SpellVoidShiftTimer = 20000;
134 } else SpellVoidShiftTimer -=diff;
135
136 if (SpellShroudOfDarknessTimer <= diff)
137 {
140 } else SpellShroudOfDarknessTimer -=diff;
141
143 }
144
145 void SummonedCreatureDies(Creature* summoned, Unit* /*who*/) OVERRIDE
146 {
147 if (summoned->GetEntry() == NPC_VOID_SENTRY)
148 voidDance = false;
149 }
150
152 {
153 if (type == DATA_VOID_DANCE)
154 return voidDance ? 1 : 0;
155
156 return 0;
157 }
158
159 void JustDied(Unit* /*killer*/) OVERRIDE
160 {
162
163 if (instance)
164 {
165 if (instance->GetData(DATA_WAVE_COUNT) == 6)
166 {
168 instance->SetData(DATA_WAVE_COUNT, 7);
169 }
170 else if (instance->GetData(DATA_WAVE_COUNT) == 12)
171 {
173 instance->SetData(DATA_WAVE_COUNT, 13);
174 }
175 }
176 }
177
179 {
180 if (victim->GetTypeId() != TypeID::TYPEID_PLAYER)
181 return;
182
183 Talk(SAY_SLAY);
184 }
185
187 {
188 summon->AI()->AttackStart(me->GetVictim());
189 summon->AI()->DoCastAOE(SPELL_ZURAMAT_ADD_2);
190 summon->SetPhaseMask(17, true);
191 }
192 };
193};
194
196{
197 public:
198 achievement_void_dance() : AchievementCriteriaScript("achievement_void_dance") { }
199
200 bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
201 {
202 if (!target)
203 return false;
204
205 if (Creature* Zuramat = target->ToCreature())
206 if (Zuramat->AI()->GetData(DATA_VOID_DANCE))
207 return true;
208
209 return false;
210 }
211};
212
214{
215 new boss_zuramat();
217}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ GO_STATE_READY
Definition GameObject.h:577
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TYPEID_PLAYER
Definition Object.h:55
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ UNIT_FLAG_IMMUNE_TO_PC
Definition Unit.h:633
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_FLAGS
Creatures
@ SAY_SLAY
#define SAY_DEATH
#define SAY_AGGRO
@ NPC_VOID_SENTRY
@ DATA_VOID_DANCE
@ SAY_DEATH
@ SAY_AGGRO
@ SAY_WHISPER
@ SAY_SLAY
@ H_SPELL_VOID_SHIFT
@ SPELL_ZURAMAT_ADD_2
@ SPELL_SUMMON_VOID_SENTRY
@ H_SPELL_ZURAMAT_ADD_2
@ SPELL_VOID_SHIFT
@ H_SPELL_SHROUD_OF_DARKNESS
@ SPELL_SHROUD_OF_DARKNESS
void AddSC_boss_zuramat()
AchievementCriteriaScript(const char *name)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureScript(const char *name)
Creature * ToCreature()
Definition Object.h:207
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
bool OnCheck(Player *, Unit *target) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ DATA_WAVE_COUNT
Creature * me
ScriptedAI(Creature *creature)
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
void KilledUnit(Unit *victim) OVERRIDE
boss_zuramatAI(Creature *creature)
void MoveInLineOfSight(Unit *) OVERRIDE
void JustSummoned(Creature *summon) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE
void SummonedCreatureDies(Creature *summoned, Unit *) OVERRIDE
void JustDied(Unit *) OVERRIDE
uint32 GetData(uint32 type) const OVERRIDE
void AttackStart(Unit *who) OVERRIDE
@ DATA_ZURAMAT_CELL
Definition violet_hold.h:47
@ DATA_1ST_BOSS_EVENT
Definition violet_hold.h:11
@ DATA_2ND_BOSS_EVENT
Definition violet_hold.h:12