Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_harbinger_skyriss.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/* ScriptData
7SDName: Boss_Harbinger_Skyriss
8SD%Complete: 45
9SDComment: CombatAI not fully implemented. Timers will need adjustments. Need more docs on how event fully work. Reset all event and force start over if fail at one point?
10SDCategory: Tempest Keep, The Arcatraz
11EndScriptData */
12
13/* ContentData
14boss_harbinger_skyriss
15boss_harbinger_skyriss_illusion
16EndContentData */
17
18#include "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "arcatraz.h"
21
32
34{
35 SPELL_FEAR = 39415,
41 SPELL_66_ILLUSION = 36931, //entry 21466
42 SPELL_33_ILLUSION = 36932, //entry 21467
43
46};
47
49{
50 public:
51 boss_harbinger_skyriss() : CreatureScript("boss_harbinger_skyriss") { }
52
54 {
56 {
57 instance = creature->GetInstanceScript();
58 Intro = false;
59 }
60
62
63 bool Intro;
66
73
75 {
76 if (!Intro)
78
79 IsImage33 = false;
80 IsImage66 = false;
81
82 Intro_Phase = 1;
83 Intro_Timer = 5000;
84 MindRend_Timer = 3000;
85 Fear_Timer = 15000;
86 Domination_Timer = 30000;
87 ManaBurn_Timer = 25000;
88 }
89
91
92 {
93 if (!Intro)
94 return;
95
97 }
98
99 void EnterCombat(Unit* /*who*/) OVERRIDE { }
100
101 void JustDied(Unit* /*killer*/) OVERRIDE
102 {
104 if (instance)
106 }
107
109 {
110 if (!summon)
111 return;
112 if (IsImage66)
113 summon->SetHealth(summon->CountPctFromMaxHealth(33));
114 else
115 summon->SetHealth(summon->CountPctFromMaxHealth(66));
116 if (me->GetVictim())
117 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
118 summon->AI()->AttackStart(target);
119 }
120
122 {
123 //won't yell killing pet/other unit
124 if (victim->GetEntry() == 21436)
125 return;
126
127 Talk(SAY_KILL);
128 }
129
130 void DoSplit(uint32 val)
131 {
132 if (me->IsNonMeleeSpellCasted(false))
133 me->InterruptNonMeleeSpells(false);
134
136
137 if (val == 66)
139 else
141 }
142
144 {
145 if (!Intro)
146 {
147 if (!instance)
148 return;
149
150 if (Intro_Timer <= diff)
151 {
152 switch (Intro_Phase)
153 {
154 case 1:
156 instance->HandleGameObject(instance->GetData64(DATA_SPHERE_SHIELD), true);
157 ++Intro_Phase;
158 Intro_Timer = 25000;
159 break;
160 case 2:
162 if (Unit* mellic = Unit::GetUnit(*me, instance->GetData64(DATA_MELLICHAR)))
163 {
164 //should have a better way to do this. possibly spell exist.
165 mellic->setDeathState(DeathState::JUST_DIED);
166 mellic->SetHealth(0);
168 }
169 ++Intro_Phase;
170 Intro_Timer = 3000;
171 break;
172 case 3:
174 Intro = true;
175 break;
176 }
177 }
178 else
179 Intro_Timer -=diff;
180 }
181 if (!UpdateVictim())
182 return;
183
184 if (!IsImage66 && !HealthAbovePct(66))
185 {
186 DoSplit(66);
187 IsImage66 = true;
188 }
189 if (!IsImage33 && !HealthAbovePct(33))
190 {
191 DoSplit(33);
192 IsImage33 = true;
193 }
194
195 if (MindRend_Timer <= diff)
196 {
197 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
198 DoCast(target, SPELL_MIND_REND);
199 else
201
202 MindRend_Timer = 8000;
203 }
204 else
205 MindRend_Timer -=diff;
206
207 if (Fear_Timer <= diff)
208 {
209 if (me->IsNonMeleeSpellCasted(false))
210 return;
211
212 Talk(SAY_FEAR);
213
214 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
215 DoCast(target, SPELL_FEAR);
216 else
218
219 Fear_Timer = 25000;
220 }
221 else
222 Fear_Timer -=diff;
223
224 if (Domination_Timer <= diff)
225 {
226 if (me->IsNonMeleeSpellCasted(false))
227 return;
228
229 Talk(SAY_MIND);
230
231 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
232 DoCast(target, SPELL_DOMINATION);
233 else
235
236 Domination_Timer = 16000+rand()%16000;
237 }
238 else
239 Domination_Timer -=diff;
240
241 if (IsHeroic())
242 {
243 if (ManaBurn_Timer <= diff)
244 {
245 if (me->IsNonMeleeSpellCasted(false))
246 return;
247
248 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
249 DoCast(target, H_SPELL_MANA_BURN);
250
251 ManaBurn_Timer = 16000+rand()%16000;
252 }
253 else
254 ManaBurn_Timer -=diff;
255 }
257 }
258 };
259
261 {
262 return new boss_harbinger_skyrissAI(creature);
263 }
264};
265
267{
268 public:
269 boss_harbinger_skyriss_illusion() : CreatureScript("boss_harbinger_skyriss_illusion") { }
270
272 {
274
275 void Reset() OVERRIDE { }
276
277 void EnterCombat(Unit* /*who*/) OVERRIDE { }
278 };
279
281 {
282 return new boss_harbinger_skyriss_illusionAI(creature);
283 }
284};
285
291
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ JUST_DIED
Definition Unit.h:504
@ UNIT_FLAG_IMMUNE_TO_PC
Definition Unit.h:633
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_FLAGS
@ DATA_MELLICHAR
Definition arcatraz.h:20
@ TYPE_SHIELD_OPEN
Definition arcatraz.h:21
@ DATA_SPHERE_SHIELD
Definition arcatraz.h:22
@ TYPE_HARBINGERSKYRISS
Definition arcatraz.h:14
@ SAY_INTRO
#define SAY_DEATH
#define SAY_AGGRO
#define SAY_KILL
@ SPELL_MIND_REND_IMAGE
@ H_SPELL_MIND_REND_IMAGE
void AddSC_boss_harbinger_skyriss()
@ SPELL_FEAR
@ SPELL_DOMINATION
virtual void MoveInLineOfSight(Unit *)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
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
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool IsHeroic() const
Creature * me
bool HealthAbovePct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================