Script::UnitManaMax
function · ui · primitive
- Address
0x5177e0· 344 bytes, up to0x517937- Signature
int __fastcall (lua_State *L)- Meaning
- Pushes a unit's maximum power 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.
| function | held object | record | pet 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 |
UnitLevel | its own function (unitlevels#unitlevel) | +0x12 | none |
UnitIsConnected | always 1 | +0x08 bit 1, else nil | 1 when found |
UnitIsDead | health at or below 0, or the dynamic flag | +0x08 bit 4 | none |
UnitIsGhost | player type and PLAYER_FLAGS ghost bit | +0x08 bit 8 | none |
UnitIsDeadOrGhost | 0x605f30 or the dynamic flag | +0x08 bits 4 and 8 | none |
The derivation is in the doc.
Callers 0
None by a direct call or jump.
Callees 9
- ClntObjMgrObjectPtr objectlayer
- GPartyInfo::GetRemoteStats ui
- GetPartyPetRecord ui
- Script::GetGUIDFromName ui
- GetPowerDisplayDivisor spell
- lua_isstring lua
- lua_tostring lua
- lua_pushnumber lua
- luaL_error lua
Calls and jumps by a bare address, from tables/calls.tsv.