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
2026-05-05 16:06:34 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "npc_spawner.hpp"
|
|
|
|
|
#include "quest_editor.hpp"
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
|
|
namespace wowee {
|
|
|
|
|
namespace editor {
|
|
|
|
|
|
|
|
|
|
class SQLExporter {
|
|
|
|
|
public:
|
|
|
|
|
// Export creature spawns as AzerothCore/TrinityCore SQL
|
|
|
|
|
static bool exportCreatures(const std::vector<CreatureSpawn>& spawns,
|
|
|
|
|
const std::string& path,
|
|
|
|
|
uint32_t mapId = 9000,
|
|
|
|
|
uint32_t startEntry = 100000);
|
|
|
|
|
|
2026-05-06 03:33:36 -07:00
|
|
|
// Export quest definitions as AzerothCore quest_template SQL.
|
|
|
|
|
// `spawns` is used to translate the editor's per-spawn .id values stored
|
|
|
|
|
// in quest links (questGiverNpcId, turnInNpcId, KillCreature targetName)
|
|
|
|
|
// into the matching SQL `entry` (which is `creatureStartEntry + index`).
|
|
|
|
|
// Pass an empty spawns vector if no translation is needed.
|
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
2026-05-05 16:06:34 -07:00
|
|
|
static bool exportQuests(const std::vector<Quest>& quests,
|
|
|
|
|
const std::string& path,
|
2026-05-06 03:33:36 -07:00
|
|
|
uint32_t startEntry = 100000,
|
|
|
|
|
const std::vector<CreatureSpawn>* spawns = nullptr,
|
|
|
|
|
uint32_t creatureStartEntry = 100000);
|
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
2026-05-05 16:06:34 -07:00
|
|
|
|
|
|
|
|
// Export everything to a single SQL file
|
|
|
|
|
static bool exportAll(const std::vector<CreatureSpawn>& spawns,
|
|
|
|
|
const std::vector<Quest>& quests,
|
|
|
|
|
const std::string& path,
|
|
|
|
|
uint32_t mapId = 9000,
|
|
|
|
|
uint32_t startEntry = 100000);
|
2026-05-06 06:46:58 -07:00
|
|
|
|
|
|
|
|
// Escape a string for safe inclusion inside single-quoted SQL literal.
|
|
|
|
|
// Doubles single quotes and escapes backslashes — matches MySQL/MariaDB
|
|
|
|
|
// string literal rules used by AzerothCore/TrinityCore. Use whenever you
|
|
|
|
|
// emit user-provided text into SQL outside of this class.
|
|
|
|
|
static std::string escape(const std::string& s);
|
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
2026-05-05 16:06:34 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace editor
|
|
|
|
|
} // namespace wowee
|