Skip to content

HoardGeneratedEvent

Treasure was rolled up and placed, before anyone has found it.

Full documentation: HoardGeneratedEvent. Wire type: hoard_generated.

Default visibility: referee

Message codes: treasure.hoard.generated

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": "Treasure was rolled up and placed, before anyone has found it.\n\nEmitted when the party first enters an area whose author declared treasure, and\nwhen a keyed encounter's monsters bring their lair hoard with them. The goods go\ninto a cache the party has to find and open with\n`TakeTreasure`.\n\nIt's referee visibility, and it itemizes everything: telling the players would\nbe telling them what is in the room. A referee front end, or an LLM running the\ngame, reads it to know what is there.",
  "properties": {
    "code": {
      "default": "treasure.hoard.generated",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `treasure.hoard.generated`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "referee",
      "description": "Referee visibility: the contents are the answer to a question the party hasn't asked\nyet."
    },
    "event_type": {
      "const": "hoard_generated",
      "default": "hoard_generated",
      "title": "Event Type",
      "type": "string",
      "description": "The wire discriminator, `hoard_generated`."
    },
    "cache_ref": {
      "title": "Cache Ref",
      "type": "string",
      "description": "The id of the cache the treasure went into, allocated by the session as `cache-NNNN`. The\nparty reaches it through the cell it sits on, not through this id."
    },
    "treasure_types": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Treasure Types",
      "type": "array",
      "description": "The treasure-type letters that were rolled, one entry per roll, so a hoard rolled from two\nletters lists both."
    },
    "coins_gp_value": {
      "default": 0,
      "title": "Coins Gp Value",
      "type": "integer",
      "description": "The coins in the hoard, as their value in gold pieces."
    },
    "valuable_ids": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Valuable Ids",
      "type": "array",
      "description": "The session-scoped instance ids of the gems and jewellery in the hoard."
    },
    "magic_item_ids": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Magic Item Ids",
      "type": "array",
      "description": "The session-scoped instance ids of the magic items in the hoard."
    }
  },
  "required": [
    "cache_ref"
  ],
  "title": "HoardGeneratedEvent",
  "type": "object"
}