fix(Scripts/Sartharion): randomize Flame Tsunami wave direction (#25370)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Andrew
2026-04-03 21:02:48 -03:00
committed by GitHub
parent 71928da8d4
commit 9c6a69d8db

View File

@@ -136,7 +136,7 @@ enum Misc
// Movement points // Movement points
POINT_LANDING = 1, POINT_LANDING = 1,
// Lava directions. Its used to identify to which side lava was moving by last time // Lava directions
LAVA_LEFT_SIDE = 0, LAVA_LEFT_SIDE = 0,
LAVA_RIGHT_SIDE = 1, LAVA_RIGHT_SIDE = 1,
@@ -307,7 +307,6 @@ struct boss_sartharion : public BossAI
{ {
explicit boss_sartharion(Creature* creature) : BossAI(creature, DATA_SARTHARION), explicit boss_sartharion(Creature* creature) : BossAI(creature, DATA_SARTHARION),
dragonsCount(0), dragonsCount(0),
lastLavaSide(LAVA_RIGHT_SIDE),
usedBerserk(false), usedBerserk(false),
below11PctReached(false) below11PctReached(false)
{ {
@@ -628,8 +627,8 @@ private:
extraEvents.ScheduleEvent(EVENT_SARTHARION_START_LAVA, 3600ms); extraEvents.ScheduleEvent(EVENT_SARTHARION_START_LAVA, 3600ms);
extraEvents.ScheduleEvent(EVENT_SARTHARION_FINISH_LAVA, 11s); extraEvents.ScheduleEvent(EVENT_SARTHARION_FINISH_LAVA, 11s);
// Send wave from left // Randomly choose which side the wave comes from
if (lastLavaSide == LAVA_RIGHT_SIDE) if (urand(LAVA_LEFT_SIDE, LAVA_RIGHT_SIDE) == LAVA_LEFT_SIDE)
{ {
for (uint8 i = 0; i < MAX_LEFT_LAVA_TSUNAMIS; ++i) for (uint8 i = 0; i < MAX_LEFT_LAVA_TSUNAMIS; ++i)
{ {
@@ -638,10 +637,7 @@ private:
if (((i - 1) % 3 == 0) && tsunami) // If center of wave if (((i - 1) % 3 == 0) && tsunami) // If center of wave
tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true); tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
} }
lastLavaSide = LAVA_LEFT_SIDE;
} }
// from right
else else
{ {
for (uint8 i = 0; i < MAX_RIGHT_LAVA_TSUNAMIS; ++i) for (uint8 i = 0; i < MAX_RIGHT_LAVA_TSUNAMIS; ++i)
@@ -651,8 +647,6 @@ private:
if (((i - 1) % 3 == 0) && tsunami) // If center of wave if (((i - 1) % 3 == 0) && tsunami) // If center of wave
tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true); tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
} }
lastLavaSide = LAVA_RIGHT_SIDE;
} }
} }
@@ -683,7 +677,6 @@ private:
EventMap extraEvents; EventMap extraEvents;
std::list<uint32> volcanoBlows; std::list<uint32> volcanoBlows;
uint8 dragonsCount; uint8 dragonsCount;
uint8 lastLavaSide; // 0 = left, 1 = right
bool usedBerserk; bool usedBerserk;
bool below11PctReached; bool below11PctReached;
}; };