Lua functions

ModifyHP

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

Historical signature: ModifyHP(spawn, value)

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

Function: ModifyHP(spawn, value)

Description: Sets the Spawn's HP to the value if the value plus the current health is greater than the Spawn's Total HP. If the current health plus the is less than the total hp, then it will restore the current HP up to the value.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • value (sint32) - Integer value value.

Returns: None.

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.

ModifyHP(Pet, hp)

Evidence: server/SpawnScripts/Generic/PetModule.lua:243; binding EQ2Emu_lua_ModifyHP.

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