aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-07-15 01:53:48 +0300
committerShauren <shauren.trinity@gmail.com>2022-03-11 17:01:26 +0100
commit960999b53d40cc75983393c01478be1c1a766074 (patch)
tree6fed468d2886d87416f2c3e22702bbeec48b1bf1
parent9797c64a978cadfd13bcf134f42255300b85dae1 (diff)
Scripts/Ruby Sanctum: Update Zarithrian to new register model (#26697)
(cherry picked from commit 6f8a7c5641081a087cb1399665cac72fa4aeb0c2)
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp356
1 files changed, 167 insertions, 189 deletions
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
index 0ede1122c8d..8dd2ef7d465 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
@@ -64,217 +64,195 @@ enum MinionsMovement
POINT_GENERAL_ROOM = 3
};
-class boss_general_zarithrian : public CreatureScript
+struct boss_general_zarithrian : public BossAI
{
- public:
- boss_general_zarithrian() : CreatureScript("boss_general_zarithrian") { }
+ boss_general_zarithrian(Creature* creature) : BossAI(creature, DATA_GENERAL_ZARITHRIAN) { }
- struct boss_general_zarithrianAI : public BossAI
+ void Reset() override
+ {
+ _Reset();
+ if (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
{
- boss_general_zarithrianAI(Creature* creature) : BossAI(creature, DATA_GENERAL_ZARITHRIAN) { }
-
- void Reset() override
+ me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
+ }
+ }
+
+ bool CanAIAttack(Unit const* target) const override
+ {
+ return (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE && BossAI::CanAIAttack(target));
+ }
+
+ void JustEngagedWith(Unit* who) override
+ {
+ BossAI::JustEngagedWith(who);
+ Talk(SAY_AGGRO);
+ events.ScheduleEvent(EVENT_CLEAVE, 8s);
+ events.ScheduleEvent(EVENT_INTIDMDATING_ROAR, 14s);
+ events.ScheduleEvent(EVENT_SUMMON_ADDS, 15s);
+ if (Is25ManRaid())
+ events.ScheduleEvent(EVENT_SUMMON_ADDS2, Seconds(16));
+ }
+
+ // Override to not set adds in combat yet.
+ void JustSummoned(Creature* summon) override
+ {
+ summons.Summon(summon);
+ }
+
+ void JustDied(Unit* /*killer*/) override
+ {
+ _JustDied();
+ Talk(SAY_DEATH);
+ }
+
+ void EnterEvadeMode(EvadeReason /*why*/) override
+ {
+ summons.DespawnAll();
+ _DespawnAtEvade();
+ }
+
+ void KilledUnit(Unit* victim) override
+ {
+ if (victim->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
{
- _Reset();
- if (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
+ case EVENT_SUMMON_ADDS:
+ Talk(SAY_ADDS);
+ [[fallthrough]];
+ case EVENT_SUMMON_ADDS2:
{
- me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- me->SetImmuneToPC(false);
- }
- }
-
- bool CanAIAttack(Unit const* target) const override
- {
- return (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE && BossAI::CanAIAttack(target));
- }
+ if (Creature* stalker1 = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ZARITHRIAN_SPAWN_STALKER_1)))
+ stalker1->CastSpell(stalker1, SPELL_SUMMON_FLAMECALLER, true);
- void JustEngagedWith(Unit* who) override
- {
- BossAI::JustEngagedWith(who);
- Talk(SAY_AGGRO);
- events.ScheduleEvent(EVENT_CLEAVE, 8s);
- events.ScheduleEvent(EVENT_INTIDMDATING_ROAR, 14s);
- events.ScheduleEvent(EVENT_SUMMON_ADDS, 15s);
- if (Is25ManRaid())
- events.ScheduleEvent(EVENT_SUMMON_ADDS2, Seconds(16));
- }
-
- // Override to not set adds in combat yet.
- void JustSummoned(Creature* summon) override
- {
- summons.Summon(summon);
- }
-
- void JustDied(Unit* /*killer*/) override
- {
- _JustDied();
- Talk(SAY_DEATH);
- }
+ if (Creature* stalker2 = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ZARITHRIAN_SPAWN_STALKER_2)))
+ stalker2->CastSpell(stalker2, SPELL_SUMMON_FLAMECALLER, true);
- void EnterEvadeMode(EvadeReason /*why*/) override
- {
- summons.DespawnAll();
- _DespawnAtEvade();
- }
-
- void KilledUnit(Unit* victim) override
- {
- if (victim->GetTypeId() == TYPEID_PLAYER)
- Talk(SAY_KILL);
- }
-
- void UpdateAI(uint32 diff) override
- {
- if (!UpdateVictim())
- return;
-
- events.Update(diff);
-
- if (me->HasUnitState(UNIT_STATE_CASTING))
- return;
-
- while (uint32 eventId = events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_SUMMON_ADDS:
- Talk(SAY_ADDS);
- [[fallthrough]];
- case EVENT_SUMMON_ADDS2:
- {
- if (Creature* stalker1 = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ZARITHRIAN_SPAWN_STALKER_1)))
- stalker1->CastSpell(stalker1, SPELL_SUMMON_FLAMECALLER, true);
-
- if (Creature* stalker2 = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ZARITHRIAN_SPAWN_STALKER_2)))
- stalker2->CastSpell(stalker2, SPELL_SUMMON_FLAMECALLER, true);
-
- events.Repeat(Seconds(45));
- break;
- }
- case EVENT_INTIDMDATING_ROAR:
- DoCastSelf(SPELL_INTIMIDATING_ROAR);
- events.Repeat(Seconds(35), Seconds(40));
- break;
- case EVENT_CLEAVE:
- DoCastVictim(SPELL_CLEAVE_ARMOR);
- events.ScheduleEvent(EVENT_CLEAVE, 15s);
- break;
- default:
- break;
- }
-
- if (me->HasUnitState(UNIT_STATE_CASTING))
- return;
+ events.Repeat(Seconds(45));
+ break;
}
-
- DoMeleeAttackIfReady();
+ case EVENT_INTIDMDATING_ROAR:
+ DoCastSelf(SPELL_INTIMIDATING_ROAR);
+ events.Repeat(Seconds(35), Seconds(40));
+ break;
+ case EVENT_CLEAVE:
+ DoCastVictim(SPELL_CLEAVE_ARMOR);
+ events.ScheduleEvent(EVENT_CLEAVE, 15s);
+ break;
+ default:
+ break;
}
- };
- CreatureAI* GetAI(Creature* creature) const override
- {
- return GetRubySanctumAI<boss_general_zarithrianAI>(creature);
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
}
+
+ DoMeleeAttackIfReady();
+ }
};
-class npc_onyx_flamecaller : public CreatureScript
+struct npc_onyx_flamecaller : public ScriptedAI
{
- public:
- npc_onyx_flamecaller() : CreatureScript("npc_onyx_flamecaller") { }
-
- struct npc_onyx_flamecallerAI : public ScriptedAI
+ npc_onyx_flamecaller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _lavaGoutCount(0) { }
+
+ void Reset() override
+ {
+ _events.Reset();
+ _lavaGoutCount = 0;
+ me->SetReactState(REACT_DEFENSIVE);
+ MoveToGeneral();
+ }
+
+ void JustEngagedWith(Unit* /*who*/) override
+ {
+ _events.ScheduleEvent(EVENT_BLAST_NOVA, 17s);
+ _events.ScheduleEvent(EVENT_LAVA_GOUT, 3s);
+ }
+
+ void EnterEvadeMode(EvadeReason /*why*/) override { }
+
+ void IsSummonedBy(WorldObject* /*summoner*/) override
+ {
+ // Let Zarithrian count as summoner.
+ if (Creature* zarithrian = _instance->GetCreature(DATA_GENERAL_ZARITHRIAN))
+ zarithrian->AI()->JustSummoned(me);
+ }
+
+ void MovementInform(uint32 type, uint32 pointId) override
+ {
+ if (type != SPLINE_CHAIN_MOTION_TYPE && pointId != POINT_GENERAL_ROOM)
+ return;
+
+ DoZoneInCombat();
+ }
+
+ void MoveToGeneral()
+ {
+ if (me->GetPositionY() < 500.0f)
+ me->GetMotionMaster()->MoveAlongSplineChain(POINT_GENERAL_ROOM, SPLINE_GENERAL_WEST, false);
+ else
+ me->GetMotionMaster()->MoveAlongSplineChain(POINT_GENERAL_ROOM, SPLINE_GENERAL_EAST, false);
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
{
- npc_onyx_flamecallerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _lavaGoutCount(0) { }
-
- void Reset() override
- {
- _events.Reset();
- _lavaGoutCount = 0;
- me->SetReactState(REACT_DEFENSIVE);
- MoveToGeneral();
- }
-
- void JustEngagedWith(Unit* /*who*/) override
- {
- _events.ScheduleEvent(EVENT_BLAST_NOVA, 17s);
- _events.ScheduleEvent(EVENT_LAVA_GOUT, 3s);
- }
-
- void EnterEvadeMode(EvadeReason /*why*/) override { }
-
- void IsSummonedBy(WorldObject* /*summoner*/) override
- {
- // Let Zarithrian count as summoner.
- if (Creature* zarithrian = _instance->GetCreature(DATA_GENERAL_ZARITHRIAN))
- zarithrian->AI()->JustSummoned(me);
- }
-
- void MovementInform(uint32 type, uint32 pointId) override
- {
- if (type != SPLINE_CHAIN_MOTION_TYPE && pointId != POINT_GENERAL_ROOM)
- return;
-
- DoZoneInCombat();
- }
-
- void MoveToGeneral()
- {
- if (me->GetPositionY() < 500.0f)
- me->GetMotionMaster()->MoveAlongSplineChain(POINT_GENERAL_ROOM, SPLINE_GENERAL_WEST, false);
- else
- me->GetMotionMaster()->MoveAlongSplineChain(POINT_GENERAL_ROOM, SPLINE_GENERAL_EAST, false);
- }
-
- void UpdateAI(uint32 diff) override
+ switch (eventId)
{
- if (!UpdateVictim())
- return;
-
- if (me->HasUnitState(UNIT_STATE_CASTING))
- return;
-
- _events.Update(diff);
-
- while (uint32 eventId = _events.ExecuteEvent())
- {
- switch (eventId)
+ case EVENT_BLAST_NOVA:
+ DoCastAOE(SPELL_BLAST_NOVA);
+ _events.Repeat(Seconds(15), Seconds(20));
+ break;
+ case EVENT_LAVA_GOUT:
+ if (_lavaGoutCount >= 3)
{
- case EVENT_BLAST_NOVA:
- DoCastAOE(SPELL_BLAST_NOVA);
- _events.Repeat(Seconds(15), Seconds(20));
- break;
- case EVENT_LAVA_GOUT:
- if (_lavaGoutCount >= 3)
- {
- _lavaGoutCount = 0;
- _events.Repeat(Seconds(8));
- break;
- }
- DoCastVictim(SPELL_LAVA_GOUT);
- _lavaGoutCount++;
- _events.Repeat(Seconds(1));
- break;
- default:
- break;
+ _lavaGoutCount = 0;
+ _events.Repeat(Seconds(8));
+ break;
}
- }
-
- DoMeleeAttackIfReady();
+ DoCastVictim(SPELL_LAVA_GOUT);
+ _lavaGoutCount++;
+ _events.Repeat(Seconds(1));
+ break;
+ default:
+ break;
}
- private:
- EventMap _events;
- InstanceScript* _instance;
- uint8 _lavaGoutCount;
- };
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return GetRubySanctumAI<npc_onyx_flamecallerAI>(creature);
}
+
+ DoMeleeAttackIfReady();
+ }
+private:
+ EventMap _events;
+ InstanceScript* _instance;
+ uint8 _lavaGoutCount;
};
void AddSC_boss_general_zarithrian()
{
- new boss_general_zarithrian();
- new npc_onyx_flamecaller();
+ RegisterRubySanctumCreatureAI(boss_general_zarithrian);
+ RegisterRubySanctumCreatureAI(npc_onyx_flamecaller);
}