feat(pipeline): add WPCD (Wowee Player Condition) format

Novel open replacement for Blizzard's PlayerCondition.dbc +
the AzerothCore-style condition_template SQL tables. The
37th open format added to the editor.

Defines reusable boolean conditions that other formats can
reference for gating: "player has quest X completed",
"player level >= N", "player class is mage", "player has
item Y in inventory", "WSEA event Z is active".

Conditions can be grouped and combined with AND/OR
aggregators on a per-group basis: a quest-giver gossip
option that says "show only to level 60 alliance mages
who completed quest 1234" composes 4 conditions sharing
the same groupId with AND aggregation. The runtime walks
each group, applies the group's aggregator, and returns
the boolean result to the caller.

Cross-references with previously-added formats — the
targetId field has a polymorphic interpretation by kind:
  WPCD.targetId (kind=QuestCompleted/Active) -> WQT.questId
  WPCD.targetId (kind=HasItem)               -> WIT.itemId
  WPCD.targetId (kind=HasSpell)              -> WSPL.spellId
  WPCD.targetId (kind=HasAchievement)        -> WACH.achievementId
  WPCD.targetId (kind=AreaId)                -> WMS.areaId
  WPCD.targetId (kind=EventActive)           -> WSEA.eventId
  WPCD.targetId (kind=HasTitle)              -> WTIT.titleId
  WPCD.targetId (kind=FactionRep)            -> WFAC.factionId
  WPCD.targetId (kind=Class/Race)            -> WCHC class/race id

Future format extensions can reference WPCD.conditionId in
their own gating fields — WTRG triggers gated by player
state, WGSP options visible only when conditions are met,
WMOU summon spells condition-gated by quest progress, etc.

Format:
  • magic "WPCD", version 1, little-endian
  • per condition: conditionId / groupId (0 = standalone) /
    name / description / kind / aggregator / negated /
    targetId / minValue / maxValue

Enums:
  • Kind (17): AlwaysTrue / AlwaysFalse / QuestCompleted /
                QuestActive / HasItem / HasSpell / MinLevel /
                MaxLevel / ClassMatch / RaceMatch /
                FactionRep / HasAchievement / TeamSize /
                GuildLevel / EventActive / AreaId / HasTitle
  • Aggregator (2): And / Or

API: WoweeConditionLoader::save / load / exists / findById.

Three preset emitters showcase typical usage:
  • makeStarter — 4 standalone conditions covering the most
                   common kinds (quest-done / has-item /
                   min-level / class)
  • makeGated   — 5 conditions in 2 groups demonstrating
                   AND-aggregation (alliance + mage + lvl 60)
                   and OR-aggregation (did quest 1 OR quest 100)
  • makeEvent   — 3 event-gated conditions cross-referencing
                   WSEA event IDs (Hallow's End / Brewfest /
                   Winter's Veil)

CLI added (5 flags, 656 documented total now):
  --gen-conditions / --gen-conditions-gated / --gen-conditions-event
  --info-wpcd / --validate-wpcd

Validator catches: conditionId=0 + duplicates, kind /
aggregator out of range, kinds requiring targetId having
target=0 (skips AlwaysTrue/False, MinLevel/MaxLevel,
TeamSize, GuildLevel which use min/max instead), TeamSize
with min > max.
This commit is contained in:
Kelsi 2026-05-09 18:18:27 -07:00
parent d14f820a14
commit f290a0d4a9
8 changed files with 674 additions and 0 deletions

View file

@ -1217,6 +1217,16 @@ void printUsage(const char* argv0) {
std::printf(" Print WGLD entries (id / faction / level / leader + motd / rank+member+tab+perk counts)\n");
std::printf(" --validate-wgld <wgld-base> [--json]\n");
std::printf(" Static checks: id>0+unique, name+leader not empty, faction 0..1, members reference valid ranks, unique tab indices\n");
std::printf(" --gen-conditions <wpcd-base> [name]\n");
std::printf(" Emit .wpcd starter: 4 conditions covering quest-done / has-item / min-level / class kinds\n");
std::printf(" --gen-conditions-gated <wpcd-base> [name]\n");
std::printf(" Emit .wpcd 5 conditions in 2 groups (group 100 AND alliance+mage+lvl60; group 200 OR did-quest-1/100)\n");
std::printf(" --gen-conditions-event <wpcd-base> [name]\n");
std::printf(" Emit .wpcd 3 event-gated conditions referencing WSEA event IDs (Hallow's End / Brewfest / Winter's Veil)\n");
std::printf(" --info-wpcd <wpcd-base> [--json]\n");
std::printf(" Print WPCD entries (id / group / kind / aggregator / negated / target / min..max value / name)\n");
std::printf(" --validate-wpcd <wpcd-base> [--json]\n");
std::printf(" Static checks: id>0+unique, kind in 0..16, aggregator 0..1, kinds that need targetId have non-zero target\n");
std::printf(" --gen-weather-temperate <wow-base> [zoneName]\n");
std::printf(" Emit .wow weather schedule: clear-dominant + occasional rain + fog (forest / grassland)\n");
std::printf(" --gen-weather-arctic <wow-base> [zoneName]\n");