Lua functions

PlaySound

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

Historical signature: PlaySound(spawn, sound_string, x, y, z, player)

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

Function: PlaySound(spawn, sound_string, x, y, z, player)

Description: Plays a sound using the sound_string to the area or specified player.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • sound_string (string) - String sound_string.
  • x (int32) - Integer value x.
  • y (int32) - Integer value y.
  • z (int32) - Integer value z.
  • player (Spawn) - Spawn object representing player.

Returns: None.

Checked example

Active call in a local runtime Lua script. A missing player sends the sound to the zone. This is a contextual call pattern, not a tested standalone script.

PlaySound(NPC,"sounds/critters/cat/cat_hiss001.wav",GetX(NPC), GetY(NPC), GetZ(NPC))

Evidence: server/SpawnScripts/BeggarsCourt/Kith.lua:49; binding EQ2Emu_lua_PlaySound.

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