> For the complete documentation index, see [llms.txt](https://xerickerspigot.gitbook.io/arenalegends/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xerickerspigot.gitbook.io/arenalegends/gameplay/shopkeeper.md).

# Shopkeeper

The shopkeeper lets players spend round gold on equipment, consumables, anvil rolls, and mythic rolls during preparation.

## Configuration files

| File                           | Purpose                                 |
| ------------------------------ | --------------------------------------- |
| `/gameplay/shopkeeper.yml`     | NPC, prices, categories, shop settings. |
| `/menus/menu-shopkeeper.yml`   | Menu layout and item display.           |
| `/items/<category>/item-*.yml` | Shop items.                             |

## NPC

The NPC appears in the lobby at the `SHOPKEEPER` marker.

| Key                 | Effect                                          |
| ------------------- | ----------------------------------------------- |
| `entity.type`       | NPC entity type.                                |
| `entity.profession` | Villager profession, when the type supports it. |
| `entity.hologram`   | Text above the NPC.                             |

## Shop settings

| Key                        | Effect                             |
| -------------------------- | ---------------------------------- |
| `setting.gold-cost.anvil`  | Price of an extra anvil roll.      |
| `setting.gold-cost.mythic` | Price of a mythic roll.            |
| `setting.discard-items`    | Shows the **Discard Item** button. |
| `setting.hide-categories`  | Categories removed from the menu.  |

To discard an item, pick it up and click the **Discard Item** button. The item disappears and can be bought again.

## Categories

Categories come from `category-builder`. The shipped set is:

| Category      | Contains                                              |
| ------------- | ----------------------------------------------------- |
| `ALL`         | Every visible item.                                   |
| `WEAPONS`     | Swords, axes, bows, crossbows, spears, mace, trident. |
| `ARMOR`       | Armor pieces.                                         |
| `POTIONS`     | Normal and splash potions.                            |
| `SUMMONS`     | Spawn eggs and summon items.                          |
| `CONSUMABLES` | Arrows, shields, TNT, golden apples, and similar.     |
| `ANVIL`       | Anvil roll button, when not hidden.                   |
| `MYTHICS`     | Mythic roll button, when not hidden.                  |

The shipped config hides `ANVIL` and `MYTHICS`, because those buttons have their own slot in the menu and stay visible.

## Item files

| Folder              | Contents                  |
| ------------------- | ------------------------- |
| `items/weapons`     | Melee and ranged weapons. |
| `items/armors`      | Armor by material.        |
| `items/potions`     | Potions.                  |
| `items/consumables` | Utility items.            |
| `items/eggs`        | Summon items.             |
| `items/mythics`     | Mythic roll items.        |

Display and metadata use the format documented in [Item Builders](/arenalegends/menus/item-builders.md).

## Item keys

| Key                                         | Effect                                                                 |
| ------------------------------------------- | ---------------------------------------------------------------------- |
| `purchase.gold-cost`                        | Gold price.                                                            |
| `purchase.round-unlock`                     | First round in which the item appears.                                 |
| `purchase.max-concurrent`                   | Copies one player may own.                                             |
| `purchase.consumable`                       | Bought for the current round only; not part of the persistent loadout. |
| `purchase.virtual`                          | No inventory item; pair with `command`.                                |
| `purchase.category`                         | Category used for filtering.                                           |
| `upgrade.shared-id`, `upgrade.upgrade-tier` | Shared upgrade level across item tiers.                                |
| `enchant.is-enchant`                        | Marks the item as an enchantment purchase.                             |
| `enchant.max-purchases`                     | Maximum enchantment level.                                             |
| `enchant.cost-increase-per-purchase`        | Price increase per level, in percent.                                  |
| `enchant.enchants`                          | Enchantments applied.                                                  |
| `enchant.apply-to`                          | Materials that accept the enchantment.                                 |
| `mythic.is-mythic`                          | Marks the item as a mythic roll candidate.                             |
| `command`                                   | Commands run on purchase.                                              |
| `equipment-builder.<slot>.*`                | Item data per equipment slot.                                          |
