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. Pass0to 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)