fix(scripts): Spider Queen rapid fire sweeps the three zone target groups around a player (issue 2016)

The live boss script tracks which arena zone volume (Zone1Vol..Zone8Vol, TeleVol for the default Zone3Vol) each
player last entered, and its rapid fire picks a random player, takes the three RFS target groups around that zone,
sorts each by the targets' CWOrder (CWOrder2 when the sweep crosses between zones 8 and 1), clockwise or
counter-clockwise at random, drops the first and last target of the middle group (shared with its neighbours),
turns with skill 1480 at the fourth target and fires 1394 at every target in turn, playing attack-shoot-right or
attack-shoot-left. The server shot a single random target with the single-shot animation, and the AG property zone
never subscribed the boss to the zone volumes. The zone now registers the volumes (retrying until they are spawned)
and the boss builds the sweep like the live script.

Check in game: AG Spider Queen stage 2; the rapid fire is an arc of many shots sweeping across the arena near the
player, left or right, and follows the player to other parts of the arena; after teleporting it starts from the
default side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 10:42:14 -05:00
parent 990cc74aa0
commit 300932c657
6 changed files with 176 additions and 17 deletions

View File

@@ -1,6 +1,9 @@
#pragma once
#include "CppScripts.h"
#include <functional>
#include <map>
/*
--------------------------------------------------------------
@@ -49,6 +52,22 @@ public:
void RunRapidFireShooter(Entity* self);
// A target of the rapid fire shooter (groups Zone1Targets..Zone8Targets) and its clockwise order in the arena
struct RapidFireTarget {
LWOOBJID id = LWOOBJID_EMPTY;
int32_t cwOrder = 0;
int32_t cwOrder2 = 0; // the order where the sweep crosses between zones 8 and 1
};
// The rapid fire shooter's targets for a player in primaryZone (Zone1Vol..Zone8Vol), as the live script builds
// them: the three target groups around that zone, each sorted in the sweep direction, without the first and last
// target of the middle group
static std::vector<LWOOBJID> BuildRapidFireTargets(const std::string& primaryZone, bool clockwise,
const std::function<std::vector<RapidFireTarget>(const std::string& group)>& groupTargets);
// A player touched one of the arena's zone volumes (group Zone1Vol..Zone8Vol, AggroVol or TeleVol)
void OnZoneVolumeEntered(Entity* self, Entity* player, const std::string& volumeGroup);
float PlayAnimAndReturnTime(Entity* self, const std::u16string& animId);
void OnTimerDone(Entity* self, std::string timerName) override;
@@ -89,8 +108,7 @@ private:
std::vector<LWOOBJID> hatchList = {}; //Global list maintaining a record of all the eggs we have prepped to hatch for a wave
const std::string defaultFacingZone = "Zone3Vol"; //Maintains a default facing to ensure appropriate Spider Boss positioning for teleported players
std::vector<int> inZoneTable = {}; //Keeps track through player ID index what quadrant of the zone the player is in now
std::vector<int> fromZoneTable = {}; //Keeps track through player ID index what quadrant of the zone the player was last in
std::map<LWOOBJID, std::string> inZoneTable; //Keeps track through player ID index what quadrant of the zone the player is in now
const float defaultAnimPause = 2.5f; //Default period of time to pause between missing animation actions
const std::u16string spiderJeerAnim = u"taunt"; //Animation Spider Boss plays to antagonize the player
@@ -120,7 +138,7 @@ private:
const unsigned int instanceMissionID = 1941; //Achievement to update for beating the instanced Boss
//Establishes a link for the Spider to identify rapid fire targets based on zone reference
const std::map<std::string, std::vector<std::string>> rapidFireTargetTable = {
static inline const std::map<std::string, std::vector<std::string>> rapidFireTargetTable = {
{"Zone1Vol", {"Zone8Targets", "Zone1Targets", "Zone2Targets"}},
{"Zone2Vol", {"Zone1Targets", "Zone2Targets", "Zone3Targets"}},
{"Zone3Vol", {"Zone2Targets", "Zone3Targets", "Zone4Targets"}},