Quests: restart resets variables, respawns giver and NPCs; final failures

Quest audit (docs/quest-audit.md, tools/questscript.mjs), fixes 2-8.
New mods/questscript.cpp scans the script code once (giver, own variables,
needed NPCs, QIS_OnEnter creations, story-ending failure labels).
questfail: generic, giverless, story-ending and NPC-gone failures stay
final; a restart restores the variables snapshot taken at Quest_Trigger,
deletes OnEnter leftovers, respawns the giver and needed NPCs and gives the
accept dialog back. questgiver slimmed on top of questscript.

Not yet tested in game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-31 02:03:20 +01:00
1 parent 7ec0fa2b8e
commit e13b82f040
10 files changed
+1557 -293

No files matched your search

+6
View File
@@ -48,6 +48,12 @@ accepting it (opcode 0x14, `0x48f320`) needs it too; the game sets it when the
hero enters the quest's region (`Quest_Trigger`). A restarted quest is now
"available": flags 1.
2026-10-30 (quest audit, `docs/quest-audit.md`): a restart also resets the
quest's variables, deletes what its `QIS_OnEnter` created, brings back the
giver and the NPCs it needs, and gives the giver the accept dialog again; some
failures stay final (generic quests, no giver, story endings, NPCs gone for
good). The script facts come from `mods/questscript.cpp`.
Marker back to the giver (request 2026-10-25: "quests that failed, should
have the blue marker point back to the quest giver"):