1616 */
1717
1818#include " ScriptMgr.h"
19+ #include " arcatraz.h"
1920#include " SpellInfo.h"
2021#include " SpellScript.h"
21- #include " arcatraz.h"
22- #include " InstanceScript.h"
23- #include " ObjectAccessor.h"
2422#include " ScriptedCreature.h"
2523
2624enum SkyrissTexts
@@ -126,11 +124,6 @@ struct boss_harbinger_skyriss : public BossAI
126124 }
127125 }
128126
129- void KilledUnit (Unit* /* victim*/ ) override
130- {
131- Talk (SAY_SLAY);
132- }
133-
134127 void DamageTaken (Unit* /* killer*/ , uint32& damage, DamageEffectType /* damageType*/ , SpellInfo const * /* spellInfo = nullptr*/ ) override
135128 {
136129 if (_phase < PHASE_HEALTH_66 && me->HealthBelowPctDamaged (66 , damage))
@@ -145,6 +138,11 @@ struct boss_harbinger_skyriss : public BossAI
145138 }
146139 }
147140
141+ void KilledUnit (Unit* /* victim*/ ) override
142+ {
143+ Talk (SAY_SLAY);
144+ }
145+
148146 void JustDied (Unit* /* killer*/ ) override
149147 {
150148 Talk (SAY_DEATH);
@@ -250,28 +248,40 @@ struct boss_harbinger_skyriss_illusion : public ScriptedAI
250248 void JustAppeared () override
251249 {
252250 DoZoneInCombat ();
253- // Should be in this sniffed order but makes it ignore other spell casts, so disabled
254- // DoCastSelf(SPELL_BIRTH);
255- DoCastSelf (SPELL_BLINK_VISUAL);
256251
257- switch (me->GetEntry ())
258- {
259- case NPC_ILLUSION_66:
260- DoCastSelf (SPELL_66_HEALTH);
261- break ;
262- case NPC_ILLUSION_33:
263- DoCastSelf (SPELL_33_HEALTH);
264- break ;
265- default :
266- break ;
267- }
268-
269- _scheduler.Schedule (2s, 10s, [this ](TaskContext task)
270- {
271- if (Unit* target = SelectTarget (SelectTargetMethod::Random, 0 ))
272- DoCast (target, IsHeroic () ? SPELL_MIND_REND_IMAGE_H : SPELL_MIND_REND_IMAGE);
273- task.Repeat (8s, 12s);
274- });
252+ _scheduler
253+ .SetValidator ([this ]
254+ {
255+ return !me->HasUnitState (UNIT_STATE_CASTING);
256+ })
257+ .Schedule (0s, [this ](TaskContext /* task*/ )
258+ {
259+ DoCastSelf (SPELL_BIRTH);
260+ })
261+ .Schedule (0s, [this ](TaskContext /* task*/ )
262+ {
263+ DoCastSelf (SPELL_BLINK_VISUAL);
264+ })
265+ .Schedule (0s, [this ](TaskContext /* task*/ )
266+ {
267+ switch (me->GetEntry ())
268+ {
269+ case NPC_ILLUSION_66:
270+ DoCastSelf (SPELL_66_HEALTH);
271+ break ;
272+ case NPC_ILLUSION_33:
273+ DoCastSelf (SPELL_33_HEALTH);
274+ break ;
275+ default :
276+ break ;
277+ }
278+ })
279+ .Schedule (2s, 10s, [this ](TaskContext task)
280+ {
281+ if (Unit* target = SelectTarget (SelectTargetMethod::Random, 0 ))
282+ DoCast (target, IsHeroic () ? SPELL_MIND_REND_IMAGE_H : SPELL_MIND_REND_IMAGE);
283+ task.Repeat (8s, 12s);
284+ });
275285 }
276286
277287 void UpdateAI (uint32 diff) override
0 commit comments