Skip to content

ItemsGivenEvent

Items or coins passed from one party member to another.

Full documentation: ItemsGivenEvent. Wire type: items_given.

Default visibility: player

Message codes: exploration.item.given

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": "Items or coins passed from one party member to another.\n\nEmitted by `GiveItems`. Update both characters\non your inventory screen when it arrives: nothing enters or leaves the party, so\nthe party's total is unchanged.",
  "properties": {
    "code": {
      "default": "exploration.item.given",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `exploration.item.given`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the party arranged the handover."
    },
    "event_type": {
      "const": "items_given",
      "default": "items_given",
      "title": "Event Type",
      "type": "string",
      "description": "The wire discriminator, `items_given`."
    },
    "character_id": {
      "title": "Character Id",
      "type": "string",
      "description": "The member who handed the goods over."
    },
    "recipient_id": {
      "title": "Recipient Id",
      "type": "string",
      "description": "The member who took them."
    },
    "item_ids": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Item Ids",
      "type": "array",
      "description": "What was handed over, as catalog ids for mundane gear and instance ids for valuables and\nmagic items."
    },
    "coins_gp_value": {
      "default": 0,
      "title": "Coins Gp Value",
      "type": "integer",
      "description": "The coins handed over, as their value in gold pieces."
    }
  },
  "required": [
    "character_id",
    "recipient_id"
  ],
  "title": "ItemsGivenEvent",
  "type": "object"
}