feat(editor): SQL spawn export for AzerothCore/TrinityCore

Private server integration: export creature spawns, patrol waypoints,
and quest definitions as ready-to-import SQL for AzerothCore/TrinityCore.

- creature_template: name, level, health, mana, damage, armor, faction,
  npcflag (questgiver/vendor/flightmaster/innkeeper), displayId, scale
- creature: spawn position, orientation, respawn time, wander distance,
  movement type (stationary/wander/patrol)
- creature_addon + waypoint_data: patrol path waypoints with delays
- quest_template: title, description, completion text, level, XP, money
- All use ON DUPLICATE KEY UPDATE for safe re-imports
- Auto-exported as spawns.sql alongside other assets on zone save
- File > Export Server SQL menu item for standalone export
- Map ID from zone metadata panel used in spawn table
This commit is contained in:
Kelsi 2026-05-05 16:06:34 -07:00
parent 84a431880e
commit b19627d82c
5 changed files with 238 additions and 2 deletions

View file

@ -8,6 +8,7 @@
#include "quest_editor.hpp"
#include "pipeline/custom_zone_discovery.hpp"
#include "content_pack.hpp"
#include "sql_exporter.hpp"
#include "wowee_terrain.hpp"
#include "pipeline/wowee_terrain_loader.hpp"
#include <filesystem>
@ -363,6 +364,15 @@ void EditorUI::renderMenuBar(EditorApp& app) {
showSaveDialog_ = true;
if (ImGui::MenuItem("Export Open Format (.wot/.whm)", nullptr, false, app.hasTerrainLoaded()))
app.exportOpenFormat("output");
if (ImGui::MenuItem("Export Server SQL", nullptr, false,
app.getNpcSpawner().spawnCount() > 0 || app.getQuestEditor().questCount() > 0)) {
std::string sqlPath = "output/" + app.getLoadedMap() + "/spawns.sql";
editor::SQLExporter::exportAll(
app.getNpcSpawner().getSpawns(),
app.getQuestEditor().getQuests(),
sqlPath, app.getZoneManifest().mapId);
app.showToast("SQL exported: " + sqlPath);
}
if (ImGui::MenuItem("Export Content Pack (.wcp)", "Ctrl+Shift+E", false, app.hasTerrainLoaded())) {
std::string wcpPath = "output/" + app.getLoadedMap() + ".wcp";
app.exportContentPack(wcpPath);