mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 09:33:51 +00:00
feat(sql): emit creature_queststarter/questender for quest-NPC links
quest_template alone tells the server about the quest but not who hands it out. Without creature_queststarter/questender entries, players can't acquire or turn in the quest. Now writes both tables when the quest has questGiverNpcId / turnInNpcId set.
This commit is contained in:
parent
22c9bc354c
commit
b7d9d54b29
1 changed files with 17 additions and 0 deletions
|
|
@ -170,6 +170,23 @@ bool SQLExporter::exportQuests(const std::vector<Quest>& quests,
|
|||
<< ") ON DUPLICATE KEY UPDATE `LogTitle`='" << escapeSql(q.title) << "';\n";
|
||||
}
|
||||
|
||||
// creature_queststarter / creature_questender link quests to NPCs.
|
||||
// Without these the player can pick up the quest from no one.
|
||||
f << "\n-- =============================================\n";
|
||||
f << "-- creature_queststarter / _questender (quest links)\n";
|
||||
f << "-- =============================================\n\n";
|
||||
for (const auto& q : quests) {
|
||||
uint32_t entry = startEntry + q.id;
|
||||
if (q.questGiverNpcId > 0) {
|
||||
f << "INSERT IGNORE INTO `creature_queststarter` (`id`, `quest`) VALUES ("
|
||||
<< q.questGiverNpcId << ", " << entry << ");\n";
|
||||
}
|
||||
if (q.turnInNpcId > 0) {
|
||||
f << "INSERT IGNORE INTO `creature_questender` (`id`, `quest`) VALUES ("
|
||||
<< q.turnInNpcId << ", " << entry << ");\n";
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO("SQL quests exported: ", quests.size(), " quests");
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue