Lua functions

GetGroup

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

Historical signature: GetGroup(Spawn)

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

Function: GetGroup(Spawn)

Description: Returns an array of Spawns that the given spawn (player or NPC) belongs to. This can be used to iterate over group members or to perform group-wide actions.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.

Returns: An array of Spawn objects that represents the spawn’s group. If the spawn is not in a group, this may return nil.

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 group = GetGroup(NPC)

Evidence: server/SpawnScripts/Generic/NPCModule.lua:361; binding EQ2Emu_lua_GetGroup.

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