Exiles Reach: fix ride-giver Jaina on Darkmaul Plains + respawn on abandon

- The ride-giver the player actually talks to is on the Darkmaul Plains
  (phase 13779), and its phase was removed when the ride was accepted
  (!QuestAccepted) — so Jaina vanished on accept. Show it until the ride is
  rewarded (matches the ogre-ruins GARRICK_CAMP fix).
- OnQuestStatusChange does NOT fire on quest abandon (RemoveActiveQuest
  erases the entry without the hook), so the respawn-on-abandon never ran.
  Detect the active->gone transition in OnPlayerWorldObjectUpdate and force
  the mowed-down undead to respawn (Map::Respawn), while keeping them dead
  on completion.
This commit is contained in:
devbox
2026-08-24 14:27:33 +10:00
parent c354643e47
commit 2317f0fe7d
2 changed files with 42 additions and 14 deletions
+41 -13
View File
@@ -36,6 +36,40 @@ public:
// Undead mowed down by the giant boar (spawnIds), so they can be respawned
// if the ride quest is abandoned.
static std::unordered_set<ObjectGuid::LowType> s_mowedDownUndead;
// Players currently on the boar ride, so an abandon can be detected (the
// OnQuestStatusChange hook does NOT fire for quest abandon).
static std::unordered_set<ObjectGuid> s_rideActivePlayers;
void CheckRideAbandon(Player* player)
{
ObjectGuid const guid = player->GetGUID();
bool active = false;
bool rewarded = false;
for (uint32 questId : { QUEST_RIDE_OF_THE_SCIENTIFICALLY_ENHANCED_BOAR, QUEST_H_THE_REDEATHER })
{
QuestStatus const status = player->GetQuestStatus(questId);
if (status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE)
active = true;
else if (status == QUEST_STATUS_REWARDED)
rewarded = true;
}
if (active)
s_rideActivePlayers.insert(guid);
else if (s_rideActivePlayers.erase(guid))
{
// Was riding and no longer is: abandoned (respawn the undead) or
// completed (let them stay mowed down).
if (!rewarded)
{
if (Map* map = player->GetMap())
for (ObjectGuid::LowType spawnId : s_mowedDownUndead)
map->Respawn(SPAWN_TYPE_CREATURE, spawnId);
}
s_mowedDownUndead.clear();
}
}
void OnLogin(Player* player, bool /*firstLogin*/) override
{
@@ -49,6 +83,7 @@ public:
void OnPlayerWorldObjectUpdate(Player* player, uint32 /*diff*/) override
{
CheckExilesReachSceneSpells(player);
CheckRideAbandon(player);
}
void OnSceneTriggerEvent(Player* player, uint32 sceneInstanceID, std::string sceneEvent) override
@@ -183,25 +218,18 @@ public:
if (questId == QUEST_AN_END_TO_BEGINNINGS || questId == QUEST_H_AN_END_TO_BEGINNINGS)
CancelExilesReachSceneAuras(player);
// Ride of the Scientifically Enhanced Boar: if the quest is abandoned,
// bring the mowed-down undead back so the ride can be retried.
// Ride of the Scientifically Enhanced Boar: clear the mowed-down tracking
// when the ride is completed (the mobs stay mowed down). Abandon is
// detected in CheckRideAbandon (OnQuestStatusChange doesn't fire for
// quest abandon).
if (questId == QUEST_RIDE_OF_THE_SCIENTIFICALLY_ENHANCED_BOAR || questId == QUEST_H_THE_REDEATHER)
{
QuestStatus const status = player->GetQuestStatus(questId);
if (status == QUEST_STATUS_NONE)
{
if (Map* map = player->GetMap())
for (ObjectGuid::LowType spawnId : s_mowedDownUndead)
map->Respawn(SPAWN_TYPE_CREATURE, spawnId); // force the pending respawn now
if (player->GetQuestStatus(questId) == QUEST_STATUS_REWARDED)
s_mowedDownUndead.clear();
}
else if (status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_REWARDED)
s_mowedDownUndead.clear();
}
}
};
std::unordered_set<ObjectGuid::LowType> exiles_reach_general_playerscript::s_mowedDownUndead;
std::unordered_set<ObjectGuid> exiles_reach_general_playerscript::s_rideActivePlayers;
class map_exiles_reach : public WorldMapScript
{
@@ -67,7 +67,7 @@ public:
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_HARPY_ROOST_MEREDY_RITUAL }, true);
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_QUILBOAR_BRIARPATCH_15276, PHASE_ALLIANCE_QUILBOAR_BRIARPATCH_16917 }, player->GetQuestStatus(QUEST_DOWN_WITH_THE_QUILBOAR) != QUEST_STATUS_REWARDED);
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_DARKMAUL_PLAINS_SPRINGSTOCK }, QuestCompletedOrRewarded(player, QUEST_DOWN_WITH_THE_QUILBOAR) && !player->GetSummonedCreatureByEntry(NPC_DARKMAUL_PLAINS_SPRINGSTOCK) && !player->GetSummonedCreatureByEntry(NPC_DARKMAUL_PLAINS_SPRINGSTOCK_RESIZING_SUMMON));
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_DARKMAUL_PLAINS_GARRICK }, QuestCompletedOrRewarded(player, QUEST_DOWN_WITH_THE_QUILBOAR) && !QuestAccepted(player, QUEST_RIDE_OF_THE_SCIENTIFICALLY_ENHANCED_BOAR));
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_DARKMAUL_PLAINS_GARRICK }, QuestCompletedOrRewarded(player, QUEST_DOWN_WITH_THE_QUILBOAR) && !QuestRewarded(player, QUEST_RIDE_OF_THE_SCIENTIFICALLY_ENHANCED_BOAR));
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_DARKMAUL_PLAINS_AUSTIN }, QuestCompletedOrRewarded(player, QUEST_DOWN_WITH_THE_QUILBOAR));
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_DARKMAUL_PLAINS_13394 }, QuestCompleted(player, QUEST_DOWN_WITH_THE_QUILBOAR));
WowCommunity::PhaseShift(player, { PHASE_ALLIANCE_DARKMAUL_PLAINS_13780 }, QuestCompleted(player, QUEST_DOWN_WITH_THE_QUILBOAR));