benilla-re systems structs docs

Script::UnitLevel

function · ui · primitive

Address
0x517fc0 · 404 bytes, up to 0x518153
Signature
int __fastcall (lua_State *L)
Meaning
Pushes the level of a unit: -1 for far hostile or world boss, drunk reduction, roster level
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/unitlevels#unitlevel
Test
ui::luabind_517fc0_unit_level

Finding: UnitLevel in ui: unit levels and the gray range

UnitLevel(unit) raises Usage: UnitLevel("unit") for a missing argument and pushes one number. With the object held (type mask 8) the answer is UNIT_FIELD_LEVEL (+0x70), unless the first of these applies:

  1. The player exists, the unit's reaction toward it is 1 or less and the player's level is at most the unit's minus 10: -1.
  2. The unit's creature rank (0x605620) is 3, a world boss: -1.
  3. The level is above 0, the player's drunkenness is nonzero and the player can attack the unit (0x606980): the level less the drunk reduction, at least 1.

With no object held the answer is the level word at +0x12 of the party or raid record 0x496400 finds, else the number 0.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 12

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