Skip to content

SellTreasure

Sell valuables in town at full value (zero time).

Full documentation: SellTreasure. Wire type: sell_treasure.

Legal session modes: town

JSON Schema

{
  "description": "Sell valuables in town at full value (zero time).\n\nThe party must be in town. Each entry names a carried valuable's instance id,\nand the coins credit its carrier's purse. osrlib adopts full `value_gp` as the\nsale price: the OSE SRD prices treasure but names no exchange spread, and full\nvalue keeps the 1-gp-1-XP identity clean. Magic items have no fixed sale value\n(RAW's own words) and are refused, and revealed curses stick.\n\nModes:\n    `town`\n\nRejections:\n    - `session.command.wrong_mode` - the party is not in town.\n    - `town.sell.no_fixed_value` - magic items cannot be sold for a fixed\n      price.\n    - `exploration.item.not_carried` - no member carries a valuable with that\n      instance id.\n\nEvents:\n    `TreasureSoldEvent` per selling\n    member, with the credited value.",
  "properties": {
    "command_type": {
      "const": "sell_treasure",
      "default": "sell_treasure",
      "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."
    },
    "item_ids": {
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "title": "Item Ids",
      "type": "array",
      "description": "The gems and jewellery to sell, by the per-instance ids they have in\n`MemberView.inventory`. Each one is credited to\nwhichever member is carrying it, so a mixed basket pays several purses. Magic items have no\nfixed price and come back as `town.sell.no_fixed_value`."
    }
  },
  "required": [
    "item_ids"
  ],
  "title": "SellTreasure",
  "type": "object"
}