Skip to content

DamageDealtEvent

Damage applied to a creature.

Full documentation: DamageDealtEvent. Wire type: damage_dealt.

Default visibility: player

Message codes: combat.damage.dealt

JSON Schema

{
  "$defs": {
    "Visibility": {
      "description": "Who may see an event.\n\nThe wire values are `\"player\"` and `\"referee\"` \u2014 lowercase, serialized into every\nevent; changing them is a `schema_version` bump.",
      "enum": [
        "player",
        "referee"
      ],
      "title": "Visibility",
      "type": "string"
    }
  },
  "description": "Damage applied to a creature.\n\nEmitted by [`deal_damage`][osrlib.core.combat.deal_damage], from a weapon attack, a\nspell, or an effect such as splash damage. Carries the amount only \u2014 never the\ntarget's remaining hit points: monster HP is hidden by design, and the\nreferee-visibility\n[`HitPointsReportedEvent`][osrlib.core.events.HitPointsReportedEvent] carries it.",
  "properties": {
    "code": {
      "default": "combat.damage.dealt",
      "title": "Code",
      "type": "string"
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player"
    },
    "event_type": {
      "const": "damage_dealt",
      "default": "damage_dealt",
      "title": "Event Type",
      "type": "string"
    },
    "target_id": {
      "title": "Target Id",
      "type": "string"
    },
    "attacker_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Attacker Id"
    },
    "amount": {
      "title": "Amount",
      "type": "integer"
    },
    "rolls": {
      "default": [],
      "items": {
        "type": "integer"
      },
      "title": "Rolls",
      "type": "array"
    },
    "keys": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Keys",
      "type": "array"
    },
    "non_regenerable": {
      "default": false,
      "title": "Non Regenerable",
      "type": "boolean"
    }
  },
  "required": [
    "target_id",
    "amount"
  ],
  "title": "DamageDealtEvent",
  "type": "object"
}