Skip to content

TreasureSoldEvent

Valuables were sold in town, and the coins are in the purse.

Full documentation: TreasureSoldEvent. Wire type: treasure_sold.

Default visibility: player

Message codes: town.treasure.sold

JSON Schema

{
  "$defs": {
    "Visibility": {
      "description": "Who is allowed to see an event.\n\nEvery event has one of these two values, and the split exists because B/X keeps some rolls behind the\nreferee's screen. Filter a log on it before you show anything to a player, or call\n`GameSession.view`, which builds the player's and the referee's\nviews for you. A narrator playing referee reads both.\n\nThe values are the lowercase strings and they serialize into every event, so a renamed value is a\n`schema_version` bump.\n\nExamples:\n    ```python\n    from osrlib.core.events import DamageDealtEvent, HitPointsReportedEvent, Visibility\n\n    log = [\n        DamageDealtEvent(target_id=\"monster-0001\", amount=5),\n        HitPointsReportedEvent(target_id=\"monster-0001\", current_hp=2, max_hp=7),\n    ]\n    shown = [event.code for event in log if event.visibility is Visibility.PLAYER]\n    assert shown == [\"combat.damage.dealt\"]  # the goblin's remaining hit points stay hidden\n    ```",
      "enum": [
        "player",
        "referee"
      ],
      "title": "Visibility",
      "type": "string"
    }
  },
  "description": "Valuables were sold in town, and the coins are in the purse.\n\nEmitted by `SellTreasure`. Gems and\njewellery sell for their full listed value, which keeps one gold piece worth one\nexperience point however treasure is converted.",
  "properties": {
    "code": {
      "default": "town.treasure.sold",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `town.treasure.sold`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the party made the sale."
    },
    "event_type": {
      "const": "treasure_sold",
      "default": "treasure_sold",
      "title": "Event Type",
      "type": "string",
      "description": "The wire discriminator, `treasure_sold`."
    },
    "character_id": {
      "title": "Character Id",
      "type": "string",
      "description": "The member who sold them and now holds the coins."
    },
    "instance_ids": {
      "items": {
        "type": "string"
      },
      "title": "Instance Ids",
      "type": "array",
      "description": "The session-scoped ids of the valuables that were sold."
    },
    "gp_value": {
      "title": "Gp Value",
      "type": "integer",
      "description": "What they fetched, in gold pieces."
    }
  },
  "required": [
    "character_id",
    "instance_ids",
    "gp_value"
  ],
  "title": "TreasureSoldEvent",
  "type": "object"
}