Commit graph

2 commits

Author SHA1 Message Date
Kelsi
dea95a2ad9 feat(editor): add WTKN JSON round-trip authoring workflow
Closes the WTKN open-format loop with --export-wtkn-json /
--import-wtkn-json, mirroring the JSON pairs added for
every other novel binary format. All 22 binary formats
added since WOL now have full JSON round-trip authoring.

Each token round-trips all 8 scalar fields (tokenId, name,
description, iconPath, category, maxBalance, weeklyCap,
flags). Two enum-typed fields (category and flags) emit
dual int + name forms.

The flag bitset emits string-array form so a hand-author
can write ["hidden", "resets"] instead of having to
remember that HiddenUntilEarned|ResetsOnLogout = 0xC.

Verified byte-identical round-trip on the PvP preset
(8 tokens: Honor + Arena + 6 BG marks of honor with
maxBalance + weeklyCap + flags all preserved).

Adds 2 flags (596 documented total now).
2026-05-09 16:56:55 -07:00
Kelsi
b632554b5b feat(pipeline): add WTKN (Wowee Token catalog) format
Novel open replacement for Blizzard's Currency.dbc +
CurrencyCategory.dbc + CurrencyTypes.dbc + the AzerothCore-
style player_currency SQL tables. The 28th open format
added to the editor.

Defines secondary currency tokens beyond gold: Honor Points
(PvP), Arena Points (rated PvP), Marks of Honor (per
battleground), faction reputation tokens, holiday-event
currencies. Each token has a balance cap, optional weekly
cap (regenerating earnings limit), and a category for
grouping in the player's currency tab.

Cross-references:
  WTRN.item.extendedCost -> WTKN.entry.tokenId
                             (vendors can charge in tokens
                              instead of copper — when
                              extendedCost > 0 the runtime
                              looks up the matching token)

Format:
  • magic "WTKN", version 1, little-endian
  • per token: tokenId / name / description / iconPath /
    category / maxBalance / weeklyCap / flags

Enums:
  • Category (6): Misc / Pvp / Reputation / Crafting /
                   Seasonal / Holiday
  • Flags:        AccountWide / Tradeable / HiddenUntilEarned /
                   ResetsOnLogout / ConvertsToGold

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

Three preset emitters showcase typical token shapes:
  • makeStarter  — 3 tokens (Honor / Marks / Stormwind Guard
                    rep) covering Pvp + Reputation categories
  • makePvp      — full PvP set: Honor (75k) + Arena (5k +
                    weekly 1500) + 6 BG marks of honor for
                    classic + TBC + WotLK battlegrounds
  • makeSeasonal — 4 holiday tokens (Tricky Treats /
                    Brewfest / Coin of Ancestry / Stranger's
                    Gift) all flagged ResetsOnLogout to make
                    them event-bound

CLI added (5 flags, 592 documented total now):
  --gen-tokens / --gen-tokens-pvp / --gen-tokens-seasonal
  --info-wtkn / --validate-wtkn

Validator catches: tokenId=0 + duplicates, empty name,
unknown category, weeklyCap > maxBalance (cap unreachable),
ResetsOnLogout + AccountWide combo (incoherent — account
state survives logout by definition).
2026-05-09 16:53:11 -07:00