Lua functions

GetCurrentHP

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

Historical signature: GetCurrentHP(spawn)

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

Function: GetCurrentHP(spawn)

Description: Returns the current HP of the Spawn, this can be represented as GetHP(spawn) as well.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.

Returns: SInt32 current hp value 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.

if GetCurrentHP(NPC) <= (GetMaxHP(NPC) / 2) then

Evidence: server/SpawnScripts/GreaterFaydark/grobins.lua:26; binding EQ2Emu_lua_GetCurrentHP.

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