Skip to content

QuestActivatedEvent

A quest became active.

Full documentation: QuestActivatedEvent. Wire type: quest_activated.

Default visibility: player

Message codes: session.quest.activated

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 quest became active.\n\nEmitted by `ActivateQuest`. A quest whose\n`activate_when` is `None` is active from the start of the session, with no command\nand no event.\n\nIt has player visibility, because the party knows the job it has taken on. The\ntrigger that activated the quest stays hidden, like the trigger and flag 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 event type, `quest_activated`, which identifies this class in serialized form."
    },
    "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 you don't need the adventure to show it."
    },
    "narrative": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Narrative",
      "description": "The offer text the author wrote, or `None` when there's none. The session adds the same line\nto the journal with no separate journal event, so the players see it once."
    }
  },
  "required": [
    "quest_id",
    "name"
  ],
  "title": "QuestActivatedEvent",
  "type": "object"
}