Scripts/Ruby Sanctum: Modernize scripts (#31052)

This commit is contained in:
offl
2025-06-09 22:25:43 +03:00
committed by GitHub
parent 49e02d7c30
commit f3a8f57457
4 changed files with 58 additions and 51 deletions

View File

@@ -22,7 +22,7 @@
#include "SpellAuraEffects.h"
#include "SpellScript.h"
enum Texts
enum BaltharusTexts
{
SAY_BALTHARUS_INTRO = 0, // Your power wanes, ancient one.... Soon you will join your friends.
SAY_AGGRO = 1, // Ah, the entertainment has arrived.
@@ -31,7 +31,7 @@ enum Texts
SAY_DEATH = 4 // I... didn't see that coming....
};
enum Spells
enum BaltharusSpells
{
SPELL_BARRIER_CHANNEL = 76221,
SPELL_ENERVATING_BRAND = 74502,
@@ -44,9 +44,9 @@ enum Spells
SPELL_SPAWN_EFFECT = 64195
};
enum Events
enum BaltharusEvents
{
EVENT_BLADE_TEMPEST = 1,
EVENT_BLADE_TEMPEST = 1,
EVENT_CLEAVE,
EVENT_ENERVATING_BRAND,
EVENT_INTRO_TALK,
@@ -54,18 +54,19 @@ enum Events
EVENT_CLONE
};
enum Actions
enum BaltharusActions
{
ACTION_CLONE = 1
ACTION_CLONE = 1
};
enum Phases
enum BaltharusPhases
{
PHASE_ALL = 0,
PHASE_ALL = 0,
PHASE_INTRO,
PHASE_COMBAT
};
// 39751 - Baltharus the Warborn
struct boss_baltharus_the_warborn : public BossAI
{
boss_baltharus_the_warborn(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN), _cloneCount(0) { }
@@ -87,7 +88,7 @@ struct boss_baltharus_the_warborn : public BossAI
case ACTION_INTRO_BALTHARUS:
me->setActive(true);
me->SetFarVisible(true);
events.ScheduleEvent(EVENT_INTRO_TALK, Seconds(7), 0, PHASE_INTRO);
events.ScheduleEvent(EVENT_INTRO_TALK, 7s, 0, PHASE_INTRO);
break;
case ACTION_CLONE:
{
@@ -108,9 +109,9 @@ struct boss_baltharus_the_warborn : public BossAI
BossAI::JustEngagedWith(who);
events.Reset();
events.SetPhase(PHASE_COMBAT);
events.ScheduleEvent(EVENT_CLEAVE, Seconds(13), 0, PHASE_COMBAT);
events.ScheduleEvent(EVENT_ENERVATING_BRAND, Seconds(13), 0, PHASE_COMBAT);
events.ScheduleEvent(EVENT_BLADE_TEMPEST, Seconds(18), 0, PHASE_COMBAT);
events.ScheduleEvent(EVENT_CLEAVE, 13s, 0, PHASE_COMBAT);
events.ScheduleEvent(EVENT_ENERVATING_BRAND, 13s, 0, PHASE_COMBAT);
events.ScheduleEvent(EVENT_BLADE_TEMPEST, 18s, 0, PHASE_COMBAT);
Talk(SAY_AGGRO);
}
@@ -142,7 +143,7 @@ struct boss_baltharus_the_warborn : public BossAI
if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 0)
{
++_cloneCount;
events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
events.ScheduleEvent(EVENT_CLONE, 1ms);
}
}
else
@@ -150,12 +151,12 @@ struct boss_baltharus_the_warborn : public BossAI
if (me->HealthBelowPctDamaged(66, damage) && _cloneCount == 0)
{
++_cloneCount;
events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
events.ScheduleEvent(EVENT_CLONE, 1ms);
}
else if (me->HealthBelowPctDamaged(33, damage) && _cloneCount == 1)
{
++_cloneCount;
events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
events.ScheduleEvent(EVENT_CLONE, 1ms);
}
}
@@ -193,17 +194,17 @@ struct boss_baltharus_the_warborn : public BossAI
break;
case EVENT_CLEAVE:
DoCastVictim(SPELL_CLEAVE);
events.Repeat(Seconds(20), Seconds(24));
events.Repeat(20s, 24s);
break;
case EVENT_BLADE_TEMPEST:
DoCastSelf(SPELL_BLADE_TEMPEST);
events.Repeat(Seconds(24));
events.Repeat(24s);
break;
case EVENT_ENERVATING_BRAND:
for (uint8 i = 0; i < RAID_MODE<uint8>(2, 4, 2, 4); i++)
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true, false, -SPELL_ENERVATING_BRAND))
DoCast(target, SPELL_ENERVATING_BRAND);
events.Repeat(Seconds(26));
events.Repeat(26s);
break;
case EVENT_SUMMONS_ATTACK:
summons.DoZoneInCombat(NPC_BALTHARUS_THE_WARBORN_CLONE);
@@ -226,6 +227,7 @@ private:
uint8 _cloneCount;
};
// 39899 - Baltharus the Warborn
struct npc_baltharus_the_warborn_clone : public BossAI
{
npc_baltharus_the_warborn_clone(Creature* creature) : BossAI(creature, DATA_BALTHARUS_CLONE) { }
@@ -279,17 +281,17 @@ struct npc_baltharus_the_warborn_clone : public BossAI
{
case EVENT_CLEAVE:
DoCastVictim(SPELL_CLEAVE);
events.Repeat(Seconds(20), Seconds(24));
events.Repeat(20s, 24s);
break;
case EVENT_BLADE_TEMPEST:
DoCastVictim(SPELL_BLADE_TEMPEST);
events.Repeat(Seconds(24));
events.Repeat(24s);
break;
case EVENT_ENERVATING_BRAND:
for (uint8 i = 0; i < RAID_MODE<uint8>(2, 4, 2, 4); i++)
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true, false, -SPELL_ENERVATING_BRAND))
DoCast(target, SPELL_ENERVATING_BRAND);
events.Repeat(Seconds(26));
events.Repeat(26s);
break;
default:
break;

View File

@@ -22,7 +22,7 @@
#include "ruby_sanctum.h"
#include "ScriptedCreature.h"
enum Texts
enum ZarithrianTexts
{
SAY_AGGRO = 0, // Alexstrasza has chosen capable allies.... A pity that I must END YOU!
SAY_KILL = 1, // You thought you stood a chance? - It's for the best.
@@ -30,7 +30,7 @@ enum Texts
SAY_DEATH = 3, // HALION! I...
};
enum Spells
enum ZarithrianSpells
{
// General Zarithrian
SPELL_INTIMIDATING_ROAR = 74384,
@@ -44,10 +44,10 @@ enum Spells
SPELL_LAVA_GOUT = 74394
};
enum Events
enum ZarithrianEvents
{
// General Zarithrian
EVENT_CLEAVE = 1,
EVENT_CLEAVE = 1,
EVENT_INTIDMDATING_ROAR,
EVENT_SUMMON_ADDS,
EVENT_SUMMON_ADDS2,
@@ -57,13 +57,14 @@ enum Events
EVENT_LAVA_GOUT
};
enum MinionsMovement
enum ZarithrianMisc
{
SPLINE_GENERAL_EAST = 1,
SPLINE_GENERAL_WEST = 2,
POINT_GENERAL_ROOM = 3
};
// 39746 - General Zarithrian
struct boss_general_zarithrian : public BossAI
{
boss_general_zarithrian(Creature* creature) : BossAI(creature, DATA_GENERAL_ZARITHRIAN) { }
@@ -91,7 +92,7 @@ struct boss_general_zarithrian : public BossAI
events.ScheduleEvent(EVENT_INTIDMDATING_ROAR, 14s);
events.ScheduleEvent(EVENT_SUMMON_ADDS, 15s);
if (Is25ManRaid())
events.ScheduleEvent(EVENT_SUMMON_ADDS2, Seconds(16));
events.ScheduleEvent(EVENT_SUMMON_ADDS2, 16s);
}
// Override to not set adds in combat yet.
@@ -143,12 +144,12 @@ struct boss_general_zarithrian : public BossAI
if (Creature* stalker2 = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ZARITHRIAN_SPAWN_STALKER_2)))
stalker2->CastSpell(stalker2, SPELL_SUMMON_FLAMECALLER, true);
events.Repeat(Seconds(45));
events.Repeat(45s);
break;
}
case EVENT_INTIDMDATING_ROAR:
DoCastSelf(SPELL_INTIMIDATING_ROAR);
events.Repeat(Seconds(35), Seconds(40));
events.Repeat(35s, 40s);
break;
case EVENT_CLEAVE:
DoCastVictim(SPELL_CLEAVE_ARMOR);
@@ -166,6 +167,7 @@ struct boss_general_zarithrian : public BossAI
}
};
// 39814 - Onyx Flamecaller
struct npc_onyx_flamecaller : public ScriptedAI
{
npc_onyx_flamecaller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _lavaGoutCount(0) { }
@@ -225,18 +227,18 @@ struct npc_onyx_flamecaller : public ScriptedAI
{
case EVENT_BLAST_NOVA:
DoCastAOE(SPELL_BLAST_NOVA);
_events.Repeat(Seconds(15), Seconds(20));
_events.Repeat(15s, 20s);
break;
case EVENT_LAVA_GOUT:
if (_lavaGoutCount >= 3)
{
_lavaGoutCount = 0;
_events.Repeat(Seconds(8));
_events.Repeat(8s);
break;
}
DoCastVictim(SPELL_LAVA_GOUT);
_lavaGoutCount++;
_events.Repeat(Seconds(1));
_events.Repeat(1s);
break;
default:
break;
@@ -245,6 +247,7 @@ struct npc_onyx_flamecaller : public ScriptedAI
DoMeleeAttackIfReady();
}
private:
EventMap _events;
InstanceScript* _instance;

View File

@@ -23,7 +23,7 @@
#include "ScriptedCreature.h"
#include "SpellScript.h"
enum Texts
enum SavianaTexts
{
SAY_AGGRO = 0, // You will sssuffer for this intrusion! (17528)
SAY_CONFLAGRATION = 1, // Burn in the master's flame! (17532)
@@ -31,7 +31,7 @@ enum Texts
SAY_KILL = 3, // Halion will be pleased. (17530) - As it should be.... (17529)
};
enum Spells
enum SavianaSpells
{
SPELL_CONFLAGRATION = 74452,
SPELL_FLAME_BEACON = 74453,
@@ -40,7 +40,7 @@ enum Spells
SPELL_FLAME_BREATH = 74403,
};
enum Events
enum SavianaEvents
{
EVENT_ENRAGE = 1,
EVENT_FLIGHT = 2,
@@ -53,7 +53,7 @@ enum Events
EVENT_GROUP_LAND_PHASE = 1,
};
enum MovementPoints
enum SavianaPoints
{
POINT_FLIGHT = 1,
POINT_LAND = 2,
@@ -61,15 +61,16 @@ enum MovementPoints
POINT_LAND_GROUND = 4
};
enum Misc
enum SavianaMisc
{
SOUND_ID_DEATH = 17531,
SOUND_ID_DEATH = 17531
};
Position const SavianaRagefireFlyOutPos = {3155.51f, 683.844f, 95.0f, 4.69f};
Position const SavianaRagefireFlyInPos = {3151.07f, 636.443f, 79.540f, 4.69f};
Position const SavianaRagefireLandPos = {3151.07f, 636.443f, 78.649f, 4.69f};
// 39747 - Saviana Ragefire
struct boss_saviana_ragefire : public BossAI
{
boss_saviana_ragefire(Creature* creature) : BossAI(creature, DATA_SAVIANA_RAGEFIRE) { }
@@ -87,9 +88,9 @@ struct boss_saviana_ragefire : public BossAI
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
events.Reset();
events.ScheduleEvent(EVENT_ENRAGE, Seconds(20), EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLAME_BREATH, Seconds(14), EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLIGHT, Seconds(60), EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_ENRAGE, 20s, EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLAME_BREATH, 14s, EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLIGHT, 60s, EVENT_GROUP_LAND_PHASE);
}
void JustDied(Unit* /*killer*/) override
@@ -110,18 +111,18 @@ struct boss_saviana_ragefire : public BossAI
Talk(SAY_CONFLAGRATION);
break;
case POINT_LAND:
events.ScheduleEvent(EVENT_LAND_GROUND, Milliseconds(1));
events.ScheduleEvent(EVENT_LAND_GROUND, 1ms);
break;
case POINT_LAND_GROUND:
me->SetCanFly(false);
me->SetDisableGravity(false);
me->SetReactState(REACT_AGGRESSIVE);
events.ScheduleEvent(EVENT_ENRAGE, Seconds(1), EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLAME_BREATH, Seconds(2), Seconds(4), EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLIGHT, Seconds(50), EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_ENRAGE, 1s, EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLAME_BREATH, 2s, 4s, EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLIGHT, 50s, EVENT_GROUP_LAND_PHASE);
break;
case POINT_TAKEOFF:
events.ScheduleEvent(EVENT_AIR_MOVEMENT, Milliseconds(1));
events.ScheduleEvent(EVENT_AIR_MOVEMENT, 1ms);
break;
default:
break;
@@ -172,11 +173,11 @@ struct boss_saviana_ragefire : public BossAI
case EVENT_ENRAGE:
DoCastSelf(SPELL_ENRAGE);
Talk(EMOTE_ENRAGED);
events.Repeat(Seconds(24));
events.Repeat(24s);
break;
case EVENT_FLAME_BREATH:
DoCastVictim(SPELL_FLAME_BREATH);
events.Repeat(Seconds(20), Seconds(30));
events.Repeat(20s, 30s);
break;
case EVENT_AIR_MOVEMENT:
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyOutPos);

View File

@@ -24,7 +24,7 @@
#include "ScriptedGossip.h"
#include "SpellScript.h"
enum Texts
enum RubySanctumTexts
{
SAY_XERESTRASZA_EVENT = 0,
SAY_XERESTRASZA_EVENT_1 = 1,
@@ -37,7 +37,7 @@ enum Texts
SAY_XERESTRASZA_INTRO = 8,
};
enum Events
enum RubySanctumEvents
{
EVENT_XERESTRASZA_EVENT_1 = 1,
EVENT_XERESTRASZA_EVENT_2 = 2,
@@ -48,13 +48,14 @@ enum Events
EVENT_XERESTRASZA_EVENT_7 = 7,
};
enum Spells
enum RubySanctumSpells
{
SPELL_RALLY = 75416
};
Position const xerestraszaMovePos = {3151.236f, 379.8733f, 86.31996f, 0.0f};
// 40429 - Sanctum Guardian Xerestrasza
struct npc_xerestrasza : public ScriptedAI
{
npc_xerestrasza(Creature* creature) : ScriptedAI(creature)