Currencies

Configurable player wallets that power mastery, bounties, and the Token Shop

Overview

A currency is a wallet: a balance a player earns and spends. The mod uses wallets to power mastery (mastery points, material currencies), bounties, and the Token Shop, but they are general purpose. Define your own and grant or charge them from rewards, quests, achievements, or commands.

Wallets belong to the shared ZiggfreedCommon library that ships beside this mod, so one wallet is spendable by every mod on the server that knows about it, and a shop, a board and a quest reward all read the same balance. See ZiggfreedCommon for the whole picture.

Content pack assetServer/ZiggfreedCommon/Currencies/<Namespace>/<Id>.jsonCurrencies/

One file per wallet. The file name is the wallet id, and the folder under Currencies/ is just organization.

defaults<pack<owner
Override configmods/ziggfreedcommon/currencies.json

The server owner's last word: a map from a wallet id to the leaves that wallet should read differently. Everything you leave out keeps whatever the pack said, and an id no pack defines is a wallet of your own.

Two flavors

Backing is the one real choice, and nothing else changes with it:

  • A plain number - a balance this server keeps for the player, with no inventory item behind it. Leave Backing out entirely. Mastery Points and Bounty Tokens work this way, so they cannot be dropped, traded or lost.
  • Item-backed - author Backing.Item and the balance is the count of that item the player is carrying, with everything that follows from being a real item: it can be traded, and whatever your world already does with items on death applies. Life Essence works this way.

Nothing that spends a wallet ever asks which kind it is, so an offer, a reroll or a mastery node prices in either one identically.

The wallet file itself - Backing, Icon, Color, Cap, the death-loss and offline-decay rules, the visibility gate, its name key and this mod's own Meta knobs - has one field reference: Authoring Shops & Currencies: the wallet. The same file a pack authors is the file an owner overrides, so nothing there is pack-only.

A wallet nothing defines does not exist, and anything priced in it is unaffordable rather than free. That is deliberate: an unknown wallet id is reported at every price that names it, so a half-installed pack cannot hand out free goods.

The sidebar currency chips (or the Mastery page's currency header) showing live balances.
The sidebar currency chips (or the Mastery page's currency header) showing live balances.

Retuning a wallet you did not author

Never edit a pack: an update overwrites it. Write the wallet id and just the leaves you want different into mods/ziggfreedcommon/currencies.json, and everything else keeps reading the way the pack shipped it.

mods/ziggfreedcommon/currencies.json
{
  "bounty_token": { "Cap": 50000 },
  "life_essence": { "OnDeath": { "LossPercent": 0.1 } }
}

Case is ignored in a wallet id wherever one is written, so bounty_token and Bounty_Token name the same wallet.

Earning & spending

  • Earn from command rewards at level milestones, from quest and achievement rewards, from a bounty contract, from an admin grant, or passively through XpConversionPercent.
  • Spend on mastery nodes, on bounty rerolls, and at the Token Shop (including its XP Exchange).

The reward that pays a wallet is the Currency kind, with a Currency id and an Amount:

Paying a wallet from any reward list
{ "Kind": "Currency", "Params": { "Currency": "bounty_token", "Amount": 75 } }

The older spellings (CURRENCY, mmo_currency, and the flat { "type": "CURRENCY", "amount": 75 } form on the older surfaces) are translated on the way in, so content already written keeps working untouched. Write the current spelling in anything new.

Commands

The shared library owns the wallet engine, so its own admin family is the full surface and this mod's /mmocurrency is an alias over it. Either one reads and writes the same balances. The target has to be online: a balance lives on the player's own character, so there is nowhere for an offline edit to land.

CommandWhoDescription
/mmocurrency balance [--player=<name>] [--currency=<id>]PlayersShow your balances (or another player's, for admins).
/mmocurrency listPlayersList every defined wallet.
/mmocurrency give --player=<name> --currency=<id> --amount=<n>AdminAdd to a balance.
/mmocurrency take --player=<name> --currency=<id> --amount=<n>AdminSubtract from a balance.
/mmocurrency set --player=<name> --currency=<id> --amount=<n>AdminSet a balance exactly.
/zigcommerce walletsAdminList every wallet this server defines, with what backs it and whether it is enabled.
/zigcommerce show [--player=<name>]AdminEverything one player holds: balances, purchase counts, rerolls used.
/zigcommerce give | take | setAdminThe same three wallet edits, from the library's own family.

Use the named-arg form (--player= --currency= --amount=). The legacy positional form (/mmocurrency give Steve mastery_point 1) is rejected by the live command. /currency is an alias for /mmocurrency.

For server owners & pack authors

Wallets are content: author your own (or retune the Mastery Pack's Mastery Points and Life Essence) as pack files, and your mods/ziggfreedcommon/currencies.json still outranks whatever a pack says. The full authoring guide, with the storefronts and shelves that spend these wallets, is Authoring Shops & Currencies.

Prefer a content pack: author one file per wallet under Server/ZiggfreedCommon/Currencies/ inside a pack folder, zip it, and drop the .zip into your server Mods/ folder. Building the zip.