Lua functions

GetPCTOfHP

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

Historical signature: GetPCTOfHP(spawn, pct)

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

Function: GetPCTOfHP(spawn, pct)

Description: Get the Spawn's amount of hp in UInt32 value using a float percentage.

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • pct (float) - Floating point value pct.

Returns: UInt32 representation of the hp against the percentage provided for 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 GetHP(Target) > GetPCTOfHP(Target, 50) then

Evidence: server/Spells/Priest/Druid/Fury/BackintotheFray.lua:14; binding EQ2Emu_lua_GetPCTOfHP.

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