Lua functions

SetPlayerLevel

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

Historical signature: SetPlayerLevel(…) via current binding

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

Function: SetPlayerLevel(player, level)

Description: Requests an adventure-level change through the connected client's ChangeLevel path. Zero is rejected.

Parameters: player: connected player spawn. level: nonzero byte adventure level.

Returns: None. Invalid input or missing connection is logged without requesting a change.

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.

SetPlayerLevel(Spawn,2)

Evidence: server/SpawnScripts/FarJourneyFreeport/HelmsmanNyles.lua:43; binding EQ2Emu_lua_SetPlayerLevel.

Current registration: WorldServer/Lua/LuaInterface.cpp.