TrinityCore
boss_harbinger_skyriss.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/* ScriptData
19SDName: Boss_Harbinger_Skyriss
20SD%Complete: 45
21SDComment: 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?
22SDCategory: Tempest Keep, The Arcatraz
23EndScriptData */
24
25/* ContentData
26boss_harbinger_skyriss
27boss_harbinger_skyriss_illusion
28EndContentData */
29
30#include "ScriptMgr.h"
31#include "arcatraz.h"
32#include "InstanceScript.h"
33#include "ObjectAccessor.h"
34#include "ScriptedCreature.h"
35
36enum Says
37{
44 SAY_DEATH = 6
45};
46
48{
49 SPELL_FEAR = 39415,
55 SPELL_66_ILLUSION = 36931, //entry 21466
56 SPELL_33_ILLUSION = 36932, //entry 21467
57
60};
61
63{
65 {
66 Initialize();
67 Intro = false;
68 }
69
71 {
72 IsImage33 = false;
73 IsImage66 = false;
74
75 Intro_Phase = 1;
76 Intro_Timer = 5000;
77 MindRend_Timer = 3000;
78 Fear_Timer = 15000;
79 Domination_Timer = 30000;
80 ManaBurn_Timer = 25000;
81 }
82
83 bool Intro;
86
93
94 void Reset() override
95 {
96 _Reset();
97
99 Initialize();
100 }
101
102 void MoveInLineOfSight(Unit* who) override
103 {
104 if (!Intro)
105 return;
106
108 }
109
110 void JustEngagedWith(Unit* /*who*/) override { }
111
112 void JustDied(Unit* /*killer*/) override
113 {
115 _JustDied();
116 }
117
118 void JustSummoned(Creature* summon) override
119 {
120 if (!summon)
121 return;
122 if (IsImage66)
123 summon->SetHealth(summon->CountPctFromMaxHealth(33));
124 else
125 summon->SetHealth(summon->CountPctFromMaxHealth(66));
126 if (me->GetVictim())
128 summon->AI()->AttackStart(target);
129
130 summons.Summon(summon);
131 summon->SetImmuneToAll(false);
132 }
133
134 void KilledUnit(Unit* victim) override
135 {
136 //won't yell killing pet/other unit
137 if (victim->GetEntry() == NPC_ALPHA_POD_TARGET)
138 return;
139
140 Talk(SAY_KILL);
141 }
142
143 void DoSplit(uint32 val)
144 {
145 if (me->IsNonMeleeSpellCast(false))
147
149
150 if (val == 66)
152 else
154 }
155
156 void UpdateAI(uint32 diff) override
157 {
158 if (!Intro)
159 {
160 if (Intro_Timer <= diff)
161 {
162 switch (Intro_Phase)
163 {
164 case 1:
167 ++Intro_Phase;
168 Intro_Timer = 25000;
169 break;
170 case 2:
173 {
174 //should have a better way to do this. possibly spell exist.
175 mellic->setDeathState(JUST_DIED);
176 mellic->SetHealth(0);
178 }
179 ++Intro_Phase;
180 Intro_Timer = 3000;
181 break;
182 case 3:
183 me->SetImmuneToAll(false);
184 Intro = true;
185 break;
186 }
187 }
188 else
189 Intro_Timer -=diff;
190 }
191 if (!UpdateVictim())
192 return;
193
194 if (!IsImage66 && !HealthAbovePct(66))
195 {
196 DoSplit(66);
197 IsImage66 = true;
198 }
199 if (!IsImage33 && !HealthAbovePct(33))
200 {
201 DoSplit(33);
202 IsImage33 = true;
203 }
204
205 if (MindRend_Timer <= diff)
206 {
208 DoCast(target, SPELL_MIND_REND);
209 else
211
212 MindRend_Timer = 8000;
213 }
214 else
215 MindRend_Timer -=diff;
216
217 if (Fear_Timer <= diff)
218 {
219 if (me->IsNonMeleeSpellCast(false))
220 return;
221
222 Talk(SAY_FEAR);
223
225 DoCast(target, SPELL_FEAR);
226 else
228
229 Fear_Timer = 25000;
230 }
231 else
232 Fear_Timer -=diff;
233
234 if (Domination_Timer <= diff)
235 {
236 if (me->IsNonMeleeSpellCast(false))
237 return;
238
239 Talk(SAY_MIND);
240
242 DoCast(target, SPELL_DOMINATION);
243 else
245
246 Domination_Timer = 16000 + rand32() % 16000;
247 }
248 else
249 Domination_Timer -=diff;
250
251 if (IsHeroic())
252 {
253 if (ManaBurn_Timer <= diff)
254 {
255 if (me->IsNonMeleeSpellCast(false))
256 return;
257
259 DoCast(target, H_SPELL_MANA_BURN);
260
261 ManaBurn_Timer = 16000 + rand32() % 16000;
262 }
263 else
264 ManaBurn_Timer -=diff;
265 }
266 }
267};
268
270{
272
273 void Reset() override
274 {
275 me->SetImmuneToPC(false);
277 me->SetUninteractible(false);
278 }
279
280 void JustEngagedWith(Unit* /*who*/) override { }
281};
282
284{
287}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
uint32 rand32()
Definition: Random.cpp:70
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:145
@ JUST_DIED
Definition: Unit.h:247
#define RegisterArcatrazCreatureAI(ai_name)
Definition: arcatraz.h:79
@ NPC_ALPHA_POD_TARGET
Definition: arcatraz.h:52
@ DATA_MELLICHAR
Definition: arcatraz.h:43
@ DATA_WARDENS_SHIELD
Definition: arcatraz.h:44
@ DATA_HARBINGER_SKYRISS
Definition: arcatraz.h:34
Says
@ SPELL_MIND_REND_IMAGE
@ H_SPELL_MIND_REND_IMAGE
@ H_SPELL_DOMINATION
@ H_SPELL_MANA_BURN
@ H_SPELL_MIND_REND
@ SPELL_66_ILLUSION
@ SPELL_33_ILLUSION
@ SPELL_DOMINATION
void AddSC_boss_harbinger_skyriss()
InstanceScript *const instance
SummonList summons
void _JustDied()
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:122
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
Definition: CreatureAI.cpp:328
Creature *const me
Definition: CreatureAI.h:61
void SetImmuneToPC(bool apply) override
Definition: Creature.h:170
void SetImmuneToAll(bool apply) override
Definition: Creature.h:167
CreatureAI * AI() const
Definition: Creature.h:214
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
virtual ObjectGuid GetGuidData(uint32 type) const override
uint32 GetEntry() const
Definition: Object.h:161
void Summon(Creature const *summon)
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
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
void SetHealth(uint64 val)
Definition: Unit.cpp:9346
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:3059
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
Unit * GetVictim() const
Definition: Unit.h:715
uint64 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:785
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:834
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
bool IsHeroic() const
bool HealthAbovePct(uint32 pct) const
boss_harbinger_skyriss_illusion(Creature *creature)
boss_harbinger_skyriss(Creature *creature)
void JustDied(Unit *) override
void MoveInLineOfSight(Unit *who) override
void KilledUnit(Unit *victim) override
void JustSummoned(Creature *summon) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override