Economy Bridge
CoreLib provides a shared economy bridge so business modules can use similar configuration for costs, rewards, and formulas.
Common fields
| Field | Type | Default | Meaning |
|---|---|---|---|
economy.enabled | boolean | true | Enable economy costs or rewards. |
economy.provider | string | auto | Economy provider: auto, vault, or excellenteconomy. |
economy.currency | string | "" | Currency ID. Leave blank for the Vault default currency; required for ExcellentEconomy. |
economy.base_cost | number | — | Base cost. |
economy.cost_formula | string | — | Dynamic cost formula, accepting expression variables. |
economy.currencies | list | — | Multi-currency list, where supported by the module. |
Providers
| Provider ID | Plugin | Notes |
|---|---|---|
vault | Vault | Works with any Vault-compatible economy plugin. |
excellenteconomy | ExcellentEconomy | Supports multiple currencies. |
Automatic provider selection
When provider is blank or auto:
| Condition | Result |
|---|---|
currency is not blank | Prefers ExcellentEconomy. |
currency is blank | Uses Vault with its default currency. |
An explicit provider is given | Looked up by ID; fails when unavailable. |
ExcellentEconomy always requires a non-blank currency, and auto never infers a default ExcellentEconomy currency — set currency explicitly.
Multiple currencies
Some modules can charge several currencies at once:
economy:
enabled: true
currencies:
- provider: vault
currency: ''
amount: 500
- provider: excellenteconomy
currency: gems
amount: 10That charges 500 of the Vault default currency and 10 ExcellentEconomy gems together.
Some modules also accept items as a currency:
economy:
enabled: true
currencies:
- provider: vault
amount: 1000
- provider: item
item:
type: vanilla
id: EMERALD
amount: 3Whether the multi-currency list and the item currency are honoured depends on the calling module.
When the charge happens
The point at which a cost is taken differs per module:
| Module | Charged at | Notes |
|---|---|---|
| EmakiStrengthen | Before the attempt starts | Charged on success and failure alike (configurable). |
| EmakiForge | On confirmation | Taken after the confirm button is clicked. |
| EmakiSkills | Before the cast | Consumed once requirements pass; a failed cast is not refunded. |
| EmakiGem | On operation confirm | Socket opening, inlay, extraction, and upgrade each configure their own cost. |
When configuring, decide explicitly whether a failed attempt still pays, whether cancelling refunds, and whether an insufficient balance blocks the operation (usually it should).
Cost formula forms
# Linear growth, gentle
cost_formula: '100 + %star% * 50'
# Exponential growth, steep at high levels
cost_formula: '100 * pow(1.5, %star%)'
# Clamped so the cost never goes negative
cost_formula: 'max(10, 100 + %star% * 50 - %bonus%)'Formula variables are injected by the calling module; Strengthen, for example, supplies %star% and %level%. Avoid negative prices in production, since players can exploit them to farm money.
Economy actions
| Action ID | Parameters |
|---|---|
give_money | required amount; provider=auto; currency="" |
take_money | required amount; provider=auto; currency="" |
set_money | required amount; provider=auto; currency="" |
actions:
- 'give_money amount=100 provider=vault'
- 'take_money amount=25.5 provider=excellenteconomy currency=gems'Check Vault or ExcellentEconomy loading if economy actions do not work.