Skip to content

QuestActivatedEvent

A quest came into play.

Full documentation: QuestActivatedEvent. Wire type: quest_activated.

Default visibility: player

Message codes: session.quest.activated

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": "A quest came into play.\n\nEmitted by `ActivateQuest`. A quest the\nadventure marked as standing from the start needs no activation and no event: it\nis active from the first command.\n\nIt's player visibility, because a job the party has taken on is theirs to know,\nwhile the clause that set it off stays behind the screen with the trigger and\nflag events.",
  "properties": {
    "code": {
      "default": "session.quest.activated",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `session.quest.activated`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the party is being given the job."
    },
    "event_type": {
      "const": "quest_activated",
      "default": "quest_activated",
      "title": "Event Type",
      "type": "string",
      "description": "The wire discriminator, `quest_activated`."
    },
    "quest_id": {
      "title": "Quest Id",
      "type": "string",
      "description": "Which quest, as the id the adventure gave it."
    },
    "name": {
      "title": "Name",
      "type": "string",
      "description": "The quest's display name, so a renderer needs no copy of the adventure to show it."
    },
    "narrative": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Narrative",
      "description": "The offer beat the author wrote, or `None` when there's none. The same line is appended to\nthe journal, so this event and that entry report one moment once."
    }
  },
  "required": [
    "quest_id",
    "name"
  ],
  "title": "QuestActivatedEvent",
  "type": "object"
}