Skip to content

LootDroppedEvent

What the slain left behind went into the drop pile on the party's cell as the encounter ended.

Full documentation: LootDroppedEvent. Wire type: loot_dropped.

Default visibility: player

Message codes: encounter.loot.dropped

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": "What the slain left behind went into the drop pile on the party's cell as the encounter ended.\n\nEmitted by whatever ends the encounter, through\n`end_encounter`: a won battle, an\n`EndEncounter`, an evasion, an escape from a chase, or a\nturning. It comes after the\n`MonsterDefeatedEvent`s and before the\n`EncounterEndedEvent`.\n\nThe loot is the treasure each slain monster carried, the shared treasure of a group whose\nmembers were all slain, and everything a slain NPC adventurer had: gear, coins, valuables, and\nmagic items. Routed monsters take their treasure with them. An encounter where nothing drops\nemits no `LootDroppedEvent`.\n\nThe goods join any pile already on the cell. Show the pile on screen when this event arrives.\n`PlayerView.piles` has everything in it, and\n`TakeTreasure` with `feature_id=\"pile\"` picks it up.",
  "properties": {
    "code": {
      "default": "encounter.loot.dropped",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `encounter.loot.dropped`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the party sees what the fallen left on the floor."
    },
    "event_type": {
      "const": "loot_dropped",
      "default": "loot_dropped",
      "title": "Event Type",
      "type": "string",
      "description": "The event type, `loot_dropped`, which identifies this class in serialized form."
    },
    "item_ids": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Item Ids",
      "type": "array",
      "description": "What went into the pile, as a catalog id for each unit of mundane gear and an instance id for\neach valuable and each magic item. An unidentified magic item has its instance id, so its true\nnature stays hidden."
    },
    "coins_gp_value": {
      "default": 0,
      "title": "Coins Gp Value",
      "type": "integer",
      "description": "The coins that went into the pile, as their value in gold pieces."
    }
  },
  "title": "LootDroppedEvent",
  "type": "object"
}