From d07748398fbb49ac206736cef435c03aadedd838 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 09:51:38 -0700 Subject: [PATCH] feat(sql): warn about unsupported quest objective types in export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-scans the quest list and emits a single header note when any quest uses ExploreArea / EscortNPC / UseObject — those have no direct quest_template column and need AzerothCore script_quest hooks. Prevents silent dropping of objectives leaving an unfinished quest in-game; the user sees the warning once at the top of 02_spawns.sql instead of having to grep through editor logs. --- tools/editor/sql_exporter.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/editor/sql_exporter.cpp b/tools/editor/sql_exporter.cpp index c9eb667c..3788c909 100644 --- a/tools/editor/sql_exporter.cpp +++ b/tools/editor/sql_exporter.cpp @@ -225,6 +225,27 @@ bool SQLExporter::exportQuests(const std::vector& quests, f << "-- quest_template (quest definitions)\n"; f << "-- =============================================\n\n"; + // Pre-scan for unsupported objective types and emit a single header + // comment so users know which quests will need manual server-side + // scripting after import. + bool hasUnsupportedObj = false; + for (const auto& q : quests) { + for (const auto& obj : q.objectives) { + if (obj.type == QuestObjectiveType::ExploreArea || + obj.type == QuestObjectiveType::EscortNPC || + obj.type == QuestObjectiveType::UseObject) { + hasUnsupportedObj = true; + break; + } + } + if (hasUnsupportedObj) break; + } + if (hasUnsupportedObj) { + f << "-- NOTE: some quests use objective types (ExploreArea, EscortNPC,\n" + << "-- UseObject) that have no direct quest_template column.\n" + << "-- Implement them via AzerothCore script_quest hooks.\n\n"; + } + for (const auto& q : quests) { uint32_t entry = startEntry + q.id; uint32_t rewardMoney = q.reward.gold * 10000 + q.reward.silver * 100 + q.reward.copper;