Skip to content
Greg edited this page Feb 11, 2024 · 5 revisions

Adding default shops

Find the shop in inventories.yml, or add if you know the container id

bobs_brilliant_axes:
  id: 1
  shop: true
  defaults:
    - bronze_pickaxe: 10
    - bronze_hatchet: 10
    - iron_hatchet: 10
    - steel_hatchet: 10
    - iron_battleaxe: 10
    - steel_battleaxe: 10
    - mithril_battleaxe: 10

Make sure shop: true is set.

Add the shopkeeper to npcs.yml

bob:
  id: 519
  race: "human"
  shop: bobs_brilliant_axes
  examine: "An expert on axes."

shop: needs to be set to the containers string id for shops to open automatically when clicking the "Trade" option

Spawn the shopkeep in the right place in npc-spawns.yml

- { id: bob, x: 3228, y: 3203, plane: 0, direction: SOUTH, members: false }

Opening a shop

Shops can be opened by a player using the OpenShop event

player.events.emit(OpenShop("zekes_superior_scimitars"))
Clone this wiki locally