Skip to content

PurchaseEquipment

Buy equipment in town: each item_ids entry buys one purchase lot (zero time).

Full documentation: PurchaseEquipment. Wire type: purchase_equipment.

Legal session modes: town

JSON Schema

{
  "description": "Buy equipment in town: each `item_ids` entry buys one purchase lot (zero time).\n\nThe party must be in town. The whole basket prices first, and if the member\ncannot afford the total, nothing is bought. The shop stocks only the shipped\nequipment lists (`load_equipment`, see the\nequipment id index): an item the adventure bundles is\nnot for sale, however the party came by the id, and rejects as unstocked\nrather than as unknown.\n\nModes:\n    `town`\n\nRejections:\n    - `session.command.wrong_mode` - the party is not in town.\n    - `session.command.unknown_member` - `character_id` names no party member.\n    - `session.command.member_incapacitated` - the member cannot act.\n    - `session.command.unknown_item` - an entry names no equipment item.\n    - `items.purchase.not_stocked` - an entry names an item the adventure\n      bundles, which the shop does not carry.\n    - `items.purchase.insufficient_funds` - the purse cannot cover the total.\n\nEvents:\n    `ItemAcquiredEvent` listing the\n    purchases, `origin` `\"purchase\"`.",
  "properties": {
    "command_type": {
      "const": "purchase_equipment",
      "default": "purchase_equipment",
      "title": "Command Type",
      "type": "string",
      "description": "The wire discriminator. Each subclass fixes it to its own snake_case literal, like\n`\"move_party\"` or `\"open_door\"`, so you never set it yourself: constructing the subclass\ndoes. It's what `parse_command` and the\n`AnyCommand` union read to rebuild the right class\nfrom a serialized mapping, and it stays the same across releases."
    },
    "source": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Source",
      "description": "An annotation naming the authored object (a trigger or quest id) or the game\nsystem on whose behalf the command was issued. Execution never reads it: a stamped\ncommand does exactly what the same command unstamped does. It is logged and replayed\nwith the command, so the log alone answers \"why did this happen\". Absent is `None`,\nand the empty string is not a value."
    },
    "character_id": {
      "title": "Character Id",
      "type": "string",
      "description": "The buyer, by `MemberView.id`. The whole basket is\npaid for out of this member's purse, and the goods land in their pack."
    },
    "item_ids": {
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "title": "Item Ids",
      "type": "array",
      "description": "What to buy, one purchase lot per entry, so repeat an id to buy more lots. A purchase lot\nis what one purchase at the item's listed price delivers: a lot of torches costs 1 gp and\narrives as six torches, while a weapon or a suit of armour is a single item. Ids come from\n`load_equipment` (see the equipment id\nindex). An id the adventure bundles is not for sale and comes back as\n`items.purchase.not_stocked`."
    }
  },
  "required": [
    "character_id",
    "item_ids"
  ],
  "title": "PurchaseEquipment",
  "type": "object"
}