Script::UnitArmor
function · ui · primitive
- Address
0x5192e0· 306 bytes, up to0x519411- 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
- ClntObjMgrGetActivePlayer objectlayer
- GetUnitFromToken ui
- GetArmorSchoolIndex unassigned
- CGPlayer_C::GetStat objectlayer
- lua_isstring lua
- lua_tostring lua
- lua_pushnumber lua
- luaL_error lua
Calls and jumps by a bare address, from tables/calls.tsv.