Lua functions

GetFactionID

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

Historical signature: GetFactionID(spawn)

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

Function: GetFactionID(spawn)

Description: Gets the faction_id of the current Spawn.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.

Returns: UInt32 faction_id of the Spawn.

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.

local faction = GetFactionID(NPC)

Evidence: server/SpawnScripts/Generic/GenericGuardVoiceOvers.lua:39; binding EQ2Emu_lua_GetFactionID.

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