feat(sql): emit RequiredNpcOrGo for TalkToNPC quest objectives

Previously only KillCreature and CollectItem objectives translated
to SQL. AzerothCore reuses RequiredNpcOrGo for talk objectives
(count=1 indicates an interaction rather than a kill), so wire that
through and add a comment about which objective types need server
scripts (ExploreArea/EscortNPC/UseObject).
This commit is contained in:
Kelsi 2026-05-06 09:44:23 -07:00
parent a0480dc3a2
commit 9309e62ab9

View file

@ -248,11 +248,21 @@ bool SQLExporter::exportQuests(const std::vector<Quest>& quests,
reqNpcOrGo[npcSlot] = resolveCreatureEntry(id);
reqNpcOrGoCount[npcSlot] = obj.targetCount;
npcSlot++;
} else if (obj.type == QuestObjectiveType::TalkToNPC && npcSlot < 4) {
// AzerothCore reuses RequiredNpcOrGo for talk objectives —
// count=1 indicates an interaction rather than a kill.
reqNpcOrGo[npcSlot] = resolveCreatureEntry(id);
reqNpcOrGoCount[npcSlot] = 1;
npcSlot++;
} else if (obj.type == QuestObjectiveType::CollectItem && itemSlot < 6) {
reqItemId[itemSlot] = id;
reqItemCount[itemSlot] = obj.targetCount;
itemSlot++;
}
// ExploreArea / EscortNPC / UseObject have no direct
// quest_template column; they need server scripts. Silently
// skipped here (validateChains warns if a quest has no SQL-
// representable objectives).
}
f << "INSERT INTO `quest_template` "