Kelsidavis-WoWee/tools/editor/cli_factions_catalog.hpp

12 lines
202 B
C++
Raw Normal View History

feat(pipeline): add WFAC (Wowee Faction Catalog) format Novel open replacement for Blizzard's Faction.dbc + FactionTemplate.dbc + the AzerothCore-style reputation_reward / reputation_spillover SQL tables. The 17th open format added to the editor. Combines the "displayable Faction" (player-facing name + reputation thresholds for friendly/honored/revered/exalted) with the "FactionTemplate matrix" (which factions are hostile to which) into one entry. The runtime walks the catalog to answer two questions: • "Will faction A attack faction B on sight?" -> enemy list • "What rep tier is the player with X?" -> thresholds Cross-references with previously-added formats: WCRT.entry.factionId -> WFAC.entry.factionId WFAC.entry.parentFactionId -> WFAC.entry.factionId WFAC.entry.enemies[] -> WFAC.entry.factionId WFAC.entry.friends[] -> WFAC.entry.factionId The starter preset's factionId 35 (Friendly) and 14 (Hostile) deliberately match the WCRT preset defaults, so the demo content stack is consistent: WCRT.makeBandit's factionId=14 has a real entry in WFAC.makeStarter that declares it hostile to friendly NPCs (35) and players (1). Format: • magic "WFAC", version 1, little-endian • per faction: factionId / parentFactionId / name / description / reputationFlags / baseReputation / 7 ascending tier thresholds (hostile..exalted) / enemies[] / friends[] Enums: • ReputationFlags: VisibleOnTab / AtWarDefault / Hidden / NoReputation / IsHeader (group label) • Tier (canonical): Hated / Hostile / Unfriendly / Neutral / Friendly / Honored / Revered / Exalted API: WoweeFactionLoader::save / load / exists / findById + WoweeFaction::isHostile(a, b); presets makeStarter (3-faction demo matching WCRT defaults), makeAlliance (header + Stormwind / Darnassus / Ironforge with reciprocal friend lists + Defias enemy), makeWildlife (4 beast factions, each hostile to player but ignoring other beasts). CLI added (5 flags, 514 documented total now): --gen-factions / --gen-factions-alliance / --gen-factions-wildlife --info-wfac / --validate-wfac Validator catches: factionId=0 + duplicates, empty name, threshold ordering violations (hostile must be < unfriendly < neutral < ... < exalted), self-listed as enemy or friend, faction in both enemies and friends (incoherent).
2026-05-09 15:37:59 -07:00
#pragma once
namespace wowee {
namespace editor {
namespace cli {
bool handleFactionsCatalog(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee