Lua functions

StartConversation

Registered in this checkout as EQ2Emu_lua_StartConversation; implementation found at WorldServer/Lua/LuaFunctions.cpp:1139.

Historical signature: StartConversation(conversation, source, player, text, mp3, key1, key2, language, can_close)

Parameter and behavior details in the historical explanation are under review against the current implementation.

Function: StartConversation(conversation, source, player, text[, mp3, key1, key2, language, can_close])

Attempts to display an actor conversation using owned choices from a builder.

Parameters:

  • conversation (Conversation): an open builder with at least one choice.
  • source (Spawn): the original source actor.
  • player (Player): the recipient Player.
  • text (string): nonempty dialogue text.
  • mp3 (string, optional): voice asset path; defaults to an empty string.
  • key1, key2 (uint32, optional): voice keys; default to 0.
  • language (integer, optional): language identifier; defaults to 0 and uses the native 8-bit field.
  • can_close (integer, optional): numeric 0 or 1; defaults to 1.

Returns: None.

Missing/invalid arguments, an empty builder, or no current matching Player connection leave the builder unconsumed. Once a valid send attempt begins, the builder is consumed before formatting or queue callbacks. It cannot be appended to or sent again, including from a nested callback. Create a new builder for another attempt. A missing formatter or rejected transport does not guarantee delivery and does not reopen the consumed builder.

The native call owns its choices, text and voice path and retains the original Player operation. A reconnect, Player replacement or scene change during preparation cannot redirect the request to a replacement. Displayed replies store copied values and weak original-source/session observations. A reply acquires the original source for its callback; retired/reused sources and stale or duplicate replies cannot select a successor menu's functions. Publishing a new menu from a reply callback and explicitly closing the claimed menu remain supported. The dialogue protocol supports at most 65,535 choices.

Checked example

Active call in a local runtime Lua script. Audio, keys, language, and close flag have defaults. The binding also handles arguments dynamically. This is a contextual call pattern, not a tested standalone script.

StartConversation(con, NPC, Spawn, "Where to?")

Evidence: server/SpawnScripts/antonica/AGriffonTamer.lua:91; binding EQ2Emu_lua_StartConversation.

Current registration: WorldServer/Lua/LuaInterface.cpp. Historical explanation: EQ2Emu Lua documentation.