Lua functions

PlayVoice

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

Historical signature: PlayVoice(spawn, mp3_string, key1, key2, player)

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

Function: PlayVoice(spawn, mp3_string, key1, key2, player)

Description: Spawn plays a mp3 voiceover with no text bubble.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • mp3_string (string) - String mp3_string.
  • key1 (int32) - Integer value key1.
  • key2 (int32) - Integer value key2.
  • player (Spawn) - Spawn object representing player.

Returns: None.

Observer identity: For an explicit player recipient, the actor must be the original allocation recorded as sent to that player (or the recipient itself). Another actor with a reused runtime ID does not inherit that eligibility. Retained connection and Lua actor admission still apply.

Connection lifetime: Each player or group-member connection resolved by this function is retained through the native call. A disconnect or reconnect during a callback cannot destroy that retained connection or switch the ongoing call to a replacement. A later Lua call resolves the current connection. This does not extend the lifetime of unrelated spawn or item userdata.

Checked example

Active call in a local runtime Lua script. Argument count matches current fixed C++ readers. This is a contextual call pattern, not a tested standalone script.

PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1004.mp3", 0, 0, Spawn)

Evidence: server/SpawnScripts/BeggarsCourt/AluciusValus.lua:70; binding EQ2Emu_lua_PlayVoice.

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