From 2f56941ad2a254b107c63919dc42758789317fbe Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 09:46:26 -0700 Subject: [PATCH] feat(sql): export quest chain link to NextQuestInChain column Quest.nextQuestId was captured by the editor and used by validateChains for cycle detection, but never made it into the AzerothCore quest_template SQL. Now resolves the editor-relative ID to the matching SQL entry (startEntry + nextQuestId) and writes it to the NextQuestInChain column. Players can now auto-progress through quest chains in-game. --- tools/editor/sql_exporter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/editor/sql_exporter.cpp b/tools/editor/sql_exporter.cpp index c30cf34b..c9eb667c 100644 --- a/tools/editor/sql_exporter.cpp +++ b/tools/editor/sql_exporter.cpp @@ -277,9 +277,14 @@ bool SQLExporter::exportQuests(const std::vector& quests, } catch (...) { /* leave as 0 */ } } + // Resolve quest-chain link to the matching SQL quest entry. + // q.nextQuestId is editor-relative; the SQL row id is startEntry + id. + uint32_t nextQuestSqlId = q.nextQuestId != 0 + ? startEntry + q.nextQuestId : 0; + f << "INSERT INTO `quest_template` " << "(`ID`, `LogTitle`, `LogDescription`, `QuestCompletionLog`, " - << "`MinLevel`, `RewardXP`, `RewardMoney`, " + << "`MinLevel`, `RewardXP`, `RewardMoney`, `NextQuestInChain`, " << "`RequiredNpcOrGo1`, `RequiredNpcOrGoCount1`, " << "`RequiredNpcOrGo2`, `RequiredNpcOrGoCount2`, " << "`RequiredNpcOrGo3`, `RequiredNpcOrGoCount3`, " @@ -299,7 +304,7 @@ bool SQLExporter::exportQuests(const std::vector& quests, << "'" << escapeSql(q.description) << "', " << "'" << escapeSql(q.completionText) << "', " << q.requiredLevel << ", " - << q.reward.xp << ", " << rewardMoney; + << q.reward.xp << ", " << rewardMoney << ", " << nextQuestSqlId; for (int k = 0; k < 4; k++) f << ", " << reqNpcOrGo[k] << ", " << reqNpcOrGoCount[k]; for (int k = 0; k < 6; k++) f << ", " << reqItemId[k] << ", " << reqItemCount[k]; for (int k = 0; k < 4; k++) f << ", " << rewardItemId[k] << ", " << rewardItemCount[k];