benilla-re systems structs docs

Script::UnitHealthMax

function · ui · orchestration

Address
0x5175b0 · 182 bytes, up to 0x517665
Signature
int __fastcall (lua_State *L)
Meaning
Pushes a unit's maximum health from its object, else from its party or pet record
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/party#reading-a-member-without-its-object

Finding: Reading a member without its object in ui: the party, its leader and its members' records

The Lua getters read the unit's descriptor while its object is held, and otherwise the record found by 0x496400 (party, then raid), then the pet record from 0x496420. A getter that finds nothing gives 0, or nil for a predicate. Record fields: +0x08 status (1 online, 4 dead, 8 ghost), +0x09 power type, u16 words +0x0a health, +0x0c maximum, +0x0e power, +0x10 maximum power, +0x12 level; the pet block is the same layout at +0x80, its fields at +0xd8 (power type), +0xdc, +0xde, +0xe0, +0xe2.

functionheld objectrecordpet record
UnitHealth+0x40 clamped at 0; 0 when dynamic flags +0x224 bit 0x20+0x0a+0x5c
UnitHealthMax+0x58+0x0c+0x5e
UnitMana+0x44 + 4*type, divided by the type's display divisor; 0 with the same flag+0x0e+0x60
UnitManaMax+0x5c + 4*type, divided+0x10+0x62
UnitPowerType+0x7b byte+0x09+0x58
UnitLevelits own function (unitlevels#unitlevel)+0x12none
UnitIsConnectedalways 1+0x08 bit 1, else nil1 when found
UnitIsDeadhealth at or below 0, or the dynamic flag+0x08 bit 4none
UnitIsGhostplayer type and PLAYER_FLAGS ghost bit+0x08 bit 8none
UnitIsDeadOrGhost0x605f30 or the dynamic flag+0x08 bits 4 and 8none

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 8

Calls and jumps by a bare address, from tables/calls.tsv.