fix(Scripts/ICC): Fix Risen Archmage respawn after wipe - #25772
Conversation
|
Do believe this is right, but the comments could probably just be trimmed quite a bit |
- In ValithriaDespawner::Execute(), iterate through GetCreatureRespawnTimes() to find Risen Archmages that were killed but corpse already decayed - Set respawn time to 11 seconds for all Risen Archmages (entry 36968) - Previously, Cell::VisitObjects could only find creatures still in world, missing those that died and decayed during long battles - Keep DespawnOrUnsummon(0ms, 11s) for visible Archmages as fallback
e777fd5 to
e71f6bb
Compare
- Both Valithria and Risen Archmages respawn in 11s after wipe - Valithria DB default respawn time is 604800s (7 days) - When corpse decays, Cell::VisitObjects can't find them - DespawnOrUnsummon() never called, respawn time not reset - operator(): use DespawnOrUnsummon(0ms, 11s) - Execute(): iterate respawn times for decayed corpses
e71f6bb to
7cab302
Compare
Last night, after testing, if all players die immediately after opening BOSS, Archmage will refresh normally. However, if Archmage's body disappears and then the team is destroyed, it will not refresh. Therefore, I have submitted the repair again today. Please review again |
|
This doesn't seem right |
7cab302 to
0e0d8b7
Compare
0e0d8b7 to
7cab302
Compare
📝 WalkthroughWalkthroughValithria Dreamwalker reset handling now updates saved respawn times for the boss and risen archmages, and forces encounter creatures to despawn with explicit 11-second timing after restoring their stored position. ChangesValithria reset timing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp (1)
238-240: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the 11-second reset delay into one constant.
The reset timing now has to stay synchronized between persisted respawn timestamps and
DespawnOrUnsummon; using one named duration avoids future drift.♻️ Proposed refactor
+static constexpr auto ValithriaResetRespawnDelay = 11s; + - time_t newRespawnTime = GameTime::GetGameTime().count() + 11; + time_t newRespawnTime = GameTime::GetGameTime().count() + ValithriaResetRespawnDelay.count(); for (ObjectGuid::LowType spawnId : toRespawn) map->SaveCreatureRespawnTime(spawnId, newRespawnTime); @@ // Force the encounter's 11s reset; the DB respawn delay can be up to 7 days. - creature->DespawnOrUnsummon(0ms, 11s); + creature->DespawnOrUnsummon(0ms, ValithriaResetRespawnDelay);Also applies to: 283-284
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp` around lines 238 - 240, The reset delay is duplicated as a raw 11-second value and should be centralized to keep respawn persistence and despawn timing in sync. Introduce a single named constant for the reset duration in the Valithria Dreamwalker logic, then use it both where `newRespawnTime` is computed and where `DespawnOrUnsummon` is scheduled, so the timing stays consistent across the affected code paths.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp`:
- Around line 238-240: The reset delay is duplicated as a raw 11-second value
and should be centralized to keep respawn persistence and despawn timing in
sync. Introduce a single named constant for the reset duration in the Valithria
Dreamwalker logic, then use it both where `newRespawnTime` is computed and where
`DespawnOrUnsummon` is scheduled, so the timing stays consistent across the
affected code paths.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: d860ed7f-9bec-4ca2-88eb-9304d7023c0f
📒 Files selected for processing (1)
src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
…::id PR azerothcore#25197 renamed CreatureData::id1 to id, so the despawner loop no longer compiled. Update the field access and clean up the loop per review: - Snapshot matching spawnIds first, then re-time outside the iteration to avoid mutating GetCreatureRespawnTimes() while iterating it. - Drop the redundant per-map mapid guard (the store is already per-map). - Trim the comments. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Heads up: while working on this branch, Claude (an AI assistant) force-pushed without permission and messed up the PR history. It's been restored, the original commits are intact, and the branch is now updated with a clean merge of master plus one new commit on top, no rewritten history. Apologies for the noise (and the confused CodeRabbit run). What's on the branch now:
CodeRabbit's only note is a nitpick: factor the @Nyeriah you said "this doesn't seem right", what specifically looks wrong to you? If it's the boss script touching the map respawn table in |
|
I have already applied this PR to my product server and tested it for several weeks with everything going well |
|
Thanks for the PR, but the issue here was that we shouldn’t ever need to manipulate respawns in boss scripts like this. TrinityCore’s approach offers a cleaner and therefore better solution to this problem |
Changes Proposed
Script Changes (boss_valithria_dreamwalker.cpp)
Problem: Risen Archmages (NPC 37868) were not respawning after Valithria encounter wipe. Instead of the intended 11-second respawn, they took 7 days (604800 seconds from database).
Root Cause: The old code used RemoveCorpse() followed by SetRespawnTime(11). However, RemoveCorpse() already saved the original spawntime from the database (7 days) before SetRespawnTime(11) could set the new value.
Solution: Changed from RemoveCorpse() + SetRespawnTime(11) to DespawnOrUnsummon(0ms, 11s). This function properly despawns the creature and sets the 11-second respawn timer without database conflicts.
Technical Details:
AI-assisted Pull Requests
Issues Addressed
Source
Tests Performed
How to Test
Known Issues
None