HoardGeneratedEvent
The engine rolled treasure and put it in a cache, before the party has found it.
Full documentation: HoardGeneratedEvent. Wire type: hoard_generated.
Default visibility: referee
Message codes: treasure.hoard.generated
JSON Schema
{
"$defs": {
"Visibility": {
"description": "Who may see an event: the players, or only the referee.\n\nEvery event has one of these values, because in B/X the referee makes some rolls behind a screen. Filter\na log on it before you show anything to a player, or call\n`GameSession.view`, which builds the players' view and the referee's\nview for you. A narrator that plays the referee reads every event.\n\nA serialized event contains the lowercase value. The values stay fixed within a `schema_version`, the version\nstamp of the saved format.\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": "The engine rolled treasure and put it in a cache, before the party has found it.\n\nEmitted when the party first enters an area whose author declared treasure, on the\ncell it enters, and when monsters the author placed in an area appear with their lair\nhoard, on the area's first cell. The goods go into a cache on that cell, which the\nparty empties with `TakeTreasure`, passing the\ncache's id as `feature_id` while standing on the cell.\n\nIt has referee visibility, and it lists everything: telling the players would be\ntelling them what is in the room. A referee front end, or an LLM running the game,\nreads 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 party learns what the cache contains when it takes the treasure."
},
"event_type": {
"const": "hoard_generated",
"default": "hoard_generated",
"title": "Event Type",
"type": "string",
"description": "The event type, `hoard_generated`, which identifies this class in serialized form."
},
"cache_ref": {
"title": "Cache Ref",
"type": "string",
"description": "The id of the cache the treasure went into, like `\"cache-0001\"`. Pass it as `feature_id` to\n`TakeTreasure` from the cache's cell."
},
"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. Treasure rolled on the unguarded-treasure table has `(\"unguarded\",)`."
},
"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"
}