Dialogue
Conversations run by the server, shown in the game's dialogue list with an optional line above it. A page is { line?, onRight?, options: [{ id, text, enabled? }] }, with 1 to 8 rows and unique ids. `enabled: false` only greys a row, so check costs in your handler. A player has one conversation at a time. Events are dialogueChoice(session, player, optionId) and dialogueClosed(session, player, reason), where the reason is 0 for Dialogue.close, 1 if the player backed out, 2 if another conversation replaced it, and 3 if interrupted because the player left, was knocked out or went out of reach, it timed out, or the NPC died.
dialogue.open()
Dialogue.open(player, page, options)Opens a conversation and returns the session id. Returns 0 for an unusable page, or a player who is gone or still loading.
dialogue.update()
Dialogue.update(session, page)Shows the next page. Returns false if the session has ended or the page is unusable.
dialogue.close()
Dialogue.close(session)Ends the conversation with reason 0. Returns false if it has already ended.
dialogue.activeSession()
Dialogue.activeSession(player)The player's conversation, or 0.