Kelsidavis-WoWee/tools/editor/cli_dispatch.cpp

163 lines
4 KiB
C++
Raw Normal View History

#include "cli_dispatch.hpp"
#include "cli_gen_audio.hpp"
#include "cli_zone_packs.hpp"
#include "cli_audits.hpp"
#include "cli_readmes.hpp"
#include "cli_zone_inventory.hpp"
#include "cli_project_inventory.hpp"
#include "cli_gen_texture.hpp"
#include "cli_gen_mesh.hpp"
#include "cli_mesh_io.hpp"
#include "cli_mesh_edit.hpp"
#include "cli_wom_info.hpp"
#include "cli_format_validate.hpp"
#include "cli_convert.hpp"
#include "cli_format_info.hpp"
#include "cli_pack.hpp"
#include "cli_content_info.hpp"
#include "cli_zone_info.hpp"
#include "cli_data_tree.hpp"
#include "cli_diff.hpp"
#include "cli_spawn_audit.hpp"
#include "cli_items.hpp"
#include "cli_extract_info.hpp"
#include "cli_export.hpp"
#include "cli_bake.hpp"
#include "cli_migrate.hpp"
#include "cli_validate_interop.hpp"
#include "cli_glb_inspect.hpp"
#include "cli_wom_io.hpp"
#include "cli_world_io.hpp"
#include "cli_info_tree.hpp"
#include "cli_info_bytes.hpp"
#include "cli_info_extents.hpp"
#include "cli_info_water.hpp"
#include "cli_info_density.hpp"
#include "cli_info_audio.hpp"
#include "cli_world_info.hpp"
#include "cli_world_map.hpp"
#include "cli_sound_catalog.hpp"
feat(pipeline): add WSPN (Wowee Spawn Point catalog) format Novel open replacement for AzerothCore-style scattered creature_template / gameobject SQL spawn tables PLUS the ADT MDDF / MODF doodad-placement chunks. The 11th open format, and the first that covers the live world-content side (atmosphere + sounds + spawns now form the runtime "what fills this zone" picture). A WSPN file holds all spawn points for a zone in a single table, with kind discriminating creature vs game object vs static doodad. The same format powers: • server runtime — knows what NPCs / objects to spawn • editor — draws spawn markers • renderer — reads the doodad subset directly to draw static props without going through a server roundtrip Format: • magic "WSPN", version 1, little-endian • per entry: kind / entryId / position(3f) / rotation(3f) / scale / flags / respawnSec / factionId / questIdRequired / wanderRadius / label Flags packed: disabled (0x01), event-only (0x02), quest-phased (0x04). Reserved bits for future per-entry encoding extensions. API: WoweeSpawnsLoader::save / load / exists; presets makeStarter (1 each kind), makeCamp (4-bandit ring + chest + 2 tents), makeVillage (6 NPCs + 2 signs + 4 corner trees). CLI added (5 flags, 473 documented total now): --gen-spawns / --gen-spawns-camp / --gen-spawns-village --info-wspn / --validate-wspn Validator catches: out-of-range kind, NaN/inf coords, non-positive scale, doodad with non-zero respawn (static prop misuse), creature with respawn=0 (won't respawn after kill), entryId=0 (orphan reference). All 3 presets save / load / re-validate clean. Doodad and game-object entries explicitly set wanderRadius=0 so the generated catalogs are noise-free.
2026-05-09 14:57:53 -07:00
#include "cli_spawns_catalog.hpp"
feat(pipeline): add WIT (Wowee Item Template) format Novel open replacement for Blizzard's Item.dbc + ItemDisplayInfo.dbc + the SQL item_template tables that AzerothCore-style servers store item definitions in. The 12th open format added to the editor. A WIT file holds the catalog of all items in a content pack: weapons, armor, consumables, quest items, trade goods. Each entry pairs gameplay metadata (stats, level reqs, flags, weapon damage / speed) with display metadata (displayId for icon / model, quality color), so the runtime can render inventory tooltips and equip slots from a single load. Format: • magic "WITM", version 1, little-endian • per item: itemId / displayId / quality / itemClass / itemSubClass / inventoryType / flags / requiredLevel / itemLevel / sellPrice / buyPrice / maxStack / durability / damageMin / damageMax / attackSpeedMs / statCount + stats[] / name / description Enums: • Quality: Poor..Heirloom (8 levels) • Class: Consumable, Weapon, Armor, Quest, ... (13) • InventoryType: Head..Cloak..Weapon2H (18 slots) • Flags: Unique, BoP, BoE, QuestItem, Conjured, ... • StatType: Stamina, Strength, Intellect, Defense, ... API: WoweeItemLoader::save / load / exists / findById; presets makeStarter (4-item demo), makeWeapons (5 items common -> legendary), makeArmor (6-piece mail set with BoE flag). CLI added (5 flags, 480 documented total now): --gen-items / --gen-items-weapons / --gen-items-armor --info-wit / --validate-wit Validator catches: itemId=0, duplicate itemIds, weapons with 0 damage or attackSpeed, weapons with non-weapon slot, equippables with durability=0 or maxStack>1, sell price >= buy price (vendor would lose money), out-of-range quality. All 3 presets save / load / re-validate clean. Info-table output includes a gold/silver/copper price formatter for hand-readability.
2026-05-09 15:04:48 -07:00
#include "cli_items_catalog.hpp"
#include "cli_quest_objective.hpp"
#include "cli_quest_reward.hpp"
#include "cli_clone.hpp"
#include "cli_remove.hpp"
#include "cli_add.hpp"
#include "cli_random.hpp"
#include "cli_items_export.hpp"
#include "cli_items_mutate.hpp"
#include "cli_zone_create.hpp"
#include "cli_tiles.hpp"
#include "cli_zone_mgmt.hpp"
#include "cli_strip.hpp"
#include "cli_repair.hpp"
#include "cli_makefile.hpp"
#include "cli_zone_list.hpp"
#include "cli_tilemap.hpp"
#include "cli_deps.hpp"
#include "cli_for_each.hpp"
#include "cli_check.hpp"
#include "cli_introspect.hpp"
#include "cli_texture_helpers.hpp"
#include "cli_mesh_info.hpp"
#include "cli_zone_data.hpp"
#include "cli_project_actions.hpp"
#include "cli_zone_export.hpp"
namespace wowee {
namespace editor {
namespace cli {
namespace {
// Each handler family takes (int& i, int argc, char** argv,
// int& outRc) and returns true if it claimed the flag. The
// table is walked in order until one returns true. Order
// rarely matters — flags are exact-string-matched, so two
// families can't both claim the same flag — but families with
// shorter/cheaper checks still come first by convention.
using DispatchFn = bool (*)(int&, int, char**, int&);
constexpr DispatchFn kDispatchTable[] = {
handleGenAudio,
handleZonePacks,
handleAudits,
handleReadmes,
handleZoneInventory,
handleProjectInventory,
handleGenTexture,
handleGenMesh,
handleMeshIO,
handleMeshEdit,
handleWomInfo,
handleFormatValidate,
handleConvert,
handleFormatInfo,
handlePack,
handleContentInfo,
handleZoneInfo,
handleDataTree,
handleDiff,
handleSpawnAudit,
handleItems,
handleExtractInfo,
handleExport,
handleBake,
handleMigrate,
handleValidateInterop,
handleGlbInspect,
handleWomIo,
handleWorldIo,
handleInfoTree,
handleInfoBytes,
handleInfoExtents,
handleInfoWater,
handleInfoDensity,
handleInfoAudio,
handleWorldInfo,
handleWorldMap,
handleSoundCatalog,
feat(pipeline): add WSPN (Wowee Spawn Point catalog) format Novel open replacement for AzerothCore-style scattered creature_template / gameobject SQL spawn tables PLUS the ADT MDDF / MODF doodad-placement chunks. The 11th open format, and the first that covers the live world-content side (atmosphere + sounds + spawns now form the runtime "what fills this zone" picture). A WSPN file holds all spawn points for a zone in a single table, with kind discriminating creature vs game object vs static doodad. The same format powers: • server runtime — knows what NPCs / objects to spawn • editor — draws spawn markers • renderer — reads the doodad subset directly to draw static props without going through a server roundtrip Format: • magic "WSPN", version 1, little-endian • per entry: kind / entryId / position(3f) / rotation(3f) / scale / flags / respawnSec / factionId / questIdRequired / wanderRadius / label Flags packed: disabled (0x01), event-only (0x02), quest-phased (0x04). Reserved bits for future per-entry encoding extensions. API: WoweeSpawnsLoader::save / load / exists; presets makeStarter (1 each kind), makeCamp (4-bandit ring + chest + 2 tents), makeVillage (6 NPCs + 2 signs + 4 corner trees). CLI added (5 flags, 473 documented total now): --gen-spawns / --gen-spawns-camp / --gen-spawns-village --info-wspn / --validate-wspn Validator catches: out-of-range kind, NaN/inf coords, non-positive scale, doodad with non-zero respawn (static prop misuse), creature with respawn=0 (won't respawn after kill), entryId=0 (orphan reference). All 3 presets save / load / re-validate clean. Doodad and game-object entries explicitly set wanderRadius=0 so the generated catalogs are noise-free.
2026-05-09 14:57:53 -07:00
handleSpawnsCatalog,
feat(pipeline): add WIT (Wowee Item Template) format Novel open replacement for Blizzard's Item.dbc + ItemDisplayInfo.dbc + the SQL item_template tables that AzerothCore-style servers store item definitions in. The 12th open format added to the editor. A WIT file holds the catalog of all items in a content pack: weapons, armor, consumables, quest items, trade goods. Each entry pairs gameplay metadata (stats, level reqs, flags, weapon damage / speed) with display metadata (displayId for icon / model, quality color), so the runtime can render inventory tooltips and equip slots from a single load. Format: • magic "WITM", version 1, little-endian • per item: itemId / displayId / quality / itemClass / itemSubClass / inventoryType / flags / requiredLevel / itemLevel / sellPrice / buyPrice / maxStack / durability / damageMin / damageMax / attackSpeedMs / statCount + stats[] / name / description Enums: • Quality: Poor..Heirloom (8 levels) • Class: Consumable, Weapon, Armor, Quest, ... (13) • InventoryType: Head..Cloak..Weapon2H (18 slots) • Flags: Unique, BoP, BoE, QuestItem, Conjured, ... • StatType: Stamina, Strength, Intellect, Defense, ... API: WoweeItemLoader::save / load / exists / findById; presets makeStarter (4-item demo), makeWeapons (5 items common -> legendary), makeArmor (6-piece mail set with BoE flag). CLI added (5 flags, 480 documented total now): --gen-items / --gen-items-weapons / --gen-items-armor --info-wit / --validate-wit Validator catches: itemId=0, duplicate itemIds, weapons with 0 damage or attackSpeed, weapons with non-weapon slot, equippables with durability=0 or maxStack>1, sell price >= buy price (vendor would lose money), out-of-range quality. All 3 presets save / load / re-validate clean. Info-table output includes a gold/silver/copper price formatter for hand-readability.
2026-05-09 15:04:48 -07:00
handleItemsCatalog,
handleQuestObjective,
handleQuestReward,
handleClone,
handleRemove,
handleAdd,
handleRandom,
handleItemsExport,
handleItemsMutate,
handleZoneCreate,
handleTiles,
handleZoneMgmt,
handleStrip,
handleRepair,
handleMakefile,
handleZoneList,
handleTilemap,
handleDeps,
handleForEach,
handleCheck,
handleIntrospect,
handleTextureHelpers,
handleMeshInfo,
handleZoneData,
handleProjectActions,
handleZoneExport,
};
} // namespace
bool tryDispatchAll(int& i, int argc, char** argv, int& outRc) {
for (DispatchFn fn : kDispatchTable) {
if (fn(i, argc, argv, outRc)) return true;
}
return false;
}
} // namespace cli
} // namespace editor
} // namespace wowee