Lua functions

ChangeFaction

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

Historical signature: ChangeFaction(spawn, faction_id, increase_or_decrease)

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

Function: ChangeFaction(spawn, faction_id, increase_or_decrease)

Description:

Changes the faction on the Spawn for the faction_id by increasing or decreasing the value. Decrease would be a negative value.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • faction_id (uint32) - Integer value faction_id.
  • increase_or_decrease (sint32) - Integer value increase.

Returns: True boolean if successful updating the faction value.

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.

ChangeFaction(Target, 12, -100000)

Evidence: server/Spells/Commoner/TheOverlordsWill.lua:25; binding EQ2Emu_lua_ChangeFaction.

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