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

@ -9,6 +9,7 @@
#include "pipeline/wowee_building.hpp"
#include "pipeline/wowee_collision.hpp"
#include "pipeline/wmo_loader.hpp"
#include "sql_exporter.hpp"
#include "core/coordinates.hpp"
#include <nlohmann/json.hpp>
#include "rendering/vk_context.hpp"
@ -875,8 +876,13 @@ void EditorApp::exportZone(const std::string& outputDir) {
}
}
// Update WDT with additional tiles from adjacent exports
// (future: scan output dir for existing ADTs and include all in WDT)
// Export SQL for private server integration (AzerothCore/TrinityCore)
if (npcSpawner_.spawnCount() > 0 || questEditor_.questCount() > 0) {
std::string sqlPath = base + "/spawns.sql";
SQLExporter::exportAll(npcSpawner_.getSpawns(),
questEditor_.getQuests(),
sqlPath, zoneManifest_.mapId);
}
// Save placed objects
if (objectPlacer_.objectCount() > 0) {