Skip to content

MagicDispelledEvent

A dispel magic ended the effects on its targets, except those that survived.

Full documentation: MagicDispelledEvent. Wire type: magic_dispelled.

Default visibility: player

Message codes: magic.dispel.resolved

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": "A *dispel magic* ended the effects on its targets, except those that survived.\n\n`cast_spell` reports this when *dispel magic* resolves. Only effects marked\ndispellable can end: every effect a spell attaches is, and what a monster inflicts isn't. An effect cast by a\nhigher-level caster gets a roll to survive, with a better chance the\nwider the gap in levels, so one dispel can end some effects and leave others. Each effect that ended also has\nan `EffectReleasedEvent`, before this event.",
  "properties": {
    "code": {
      "default": "magic.dispel.resolved",
      "title": "Code",
      "type": "string",
      "description": "Fixed at `magic.dispel.resolved`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the players see the spell and what it ended."
    },
    "event_type": {
      "const": "magic_dispelled",
      "default": "magic_dispelled",
      "title": "Event Type",
      "type": "string",
      "description": "The fixed string that identifies this event class in a serialized event."
    },
    "caster_id": {
      "title": "Caster Id",
      "type": "string",
      "description": "The entity id of the caster of *dispel magic*."
    },
    "released_effect_ids": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Released Effect Ids",
      "type": "array",
      "description": "The ids of the effects the spell ended."
    },
    "surviving_effect_ids": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Surviving Effect Ids",
      "type": "array",
      "description": "The ids of the dispellable effects that survived their roll."
    }
  },
  "required": [
    "caster_id"
  ],
  "title": "MagicDispelledEvent",
  "type": "object"
}