Systems
Disenchant Shop
A sell-back tab on a quest-giver NPC: players hand in gear and receive the currency of one of the shops. There is no separate price list. The payout is derived from the shop's own prices and scaled by the item's quality.
Setup
Set disenchantShopId in the NPC's questgiver behavior (see NPCs). Real example, albase:trialwarden:
{
"code": "questgiver",
"trialactiveonly": true,
"shopId": "trial-warden",
"disenchantShopId": "trial-warden",
"alwaysquests": [ "albase:trial-intro" ]
}disenchantShopId is the id of a shop from config/shops/ (Shops). If no shop with that id is loaded the tab is not offered. The shop button (shopId) and the disenchant tab are independent: an NPC can have either one, or point them at different shops.
In the NPC window the Disenchant tab shows the player's balance of the shop currency. The player presses "Open Disenchant", drags items into 6 slots and presses "Disenchant". A live preview shows the payout while items are in the slots.
What can be disenchanted
An item is accepted when its collectible code appears in the shop as
- a direct item (
items[].itemCode), or - an entry of the
casePoolof a case.
Entries are ignored when cost <= 0 or when their costCurrency is set and differs from the shop's currency. Virtual case codes (itemCode starting with case:) are not items themselves. Matching is by item code only: the same item with any quality, attributes or stack size is accepted.
Pricing
payout = floor( source value x quality refund x stack size )Source value, taking the cheapest source when an item is sold in several places:
- direct item:
cost / stackSizeper item, - case pool item: the whole
costof the case (a case gives exactly one item).
Quality refund, from the item's own quality (see Quality & Reroll):
| Item | Refund |
|---|---|
| No quality on the item | 35% |
| Quality with a bonus of 0 (or below) | 35% |
Bonus equal to the highest maxBonusPercent among all registered qualities | 60% |
In between the refund grows linearly with the item's bonus percent. If no quality is registered the scale is 100.
Confirming a sale
The server re-checks every filled slot. If any item is not disenchantable the whole sale is refused ("One or more items cannot be disenchanted"); an empty set is refused too ("Place at least one item to disenchant"). On success all items are removed, the total is added to the player's balance of the shop currency, the shop's purchaseSound plays and the window reports "Disenchanted for +N". Closing the window without confirming returns every item to the player (dropped at their feet if the inventory is full).