benilla-re systems structs docs

Script::UnitArmor

function · ui · primitive

Address
0x5192e0 · 306 bytes, up to 0x519411
Signature
int __fastcall (lua_State *L)
Meaning
Returns a unit's armor base, effective value, armor and buffs from the armor school resistance
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/unitstats#resistances-and-armor

Finding: Resistances and armor in ui: unit stat functions

UnitResistance(unit, i) returns the base, the resistance, the positive buff and the negative buff, all integers. For the local player the base is the field less the buffs, the resistance is the field (0 when it is negative), and the buffs come from PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE and NEGATIVE (fields 1187 and 1194). Any other unit gets the field raised to 0 as both base and resistance, and 0 for both buffs. UnitArmor(unit) does the same for the armor school and returns five values: the base, the effective armor, the armor, and the two buffs. A field below zero makes the resistance and both armor copies 0 while the base keeps the signed difference.

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.