Lua functions

SetHouseCharacterID

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

Historical signature: SetHouseCharacterID(…) via current binding

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

Function: SetHouseCharacterID(spawn, character_id)

Sets the house-owner character ID stored on a spawn.

Parameters:

  • spawn: the spawn to update.
  • character_id: the character ID to store. Pass 0 to look up the owner of the spawn's current house instance.

Returns: None.

With a nonzero character ID, the function stores that ID directly. With 0, it retains the spawn's original zone, looks up an owning immutable house row for that zone's instance, and copies the row's owner character ID. A missing spawn, zone or house leaves the stored ID unchanged. A concurrent house reload cannot invalidate the selected row. The function does not create a house or move the spawn to another instance.

-- Copy the owner of this house instance onto the spawn.
SetHouseCharacterID(NPC, 0)

-- Set an explicit owner.
SetHouseCharacterID(NPC, 12345)

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.

SetHouseCharacterID(NPC, 0)

Evidence: server/SpawnScripts/House/HouseShop.lua:10; binding EQ2Emu_lua_SetHouseCharacterID.

Current registration: WorldServer/Lua/LuaInterface.cpp.