benilla-re systems structs docs

Script::SelectTrainerService

function · ui · primitive

Address
0x4d8e60 · 64 bytes, up to 0x4d8e9f
Signature
int __fastcall (lua_State *L)
Meaning
Selects the trainer service at an index and returns nothing
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/trainer#selection

Finding: Selection in ui: the trainer window

The selection is the spell id of the chosen record. SelectTrainerService(index) truncates the index, subtracts 1 and stores that record's id; an index below 1 or at the total length or above clears the selection. A hidden record can be selected. GetTrainerSelectionIndex() searches the whole array for the stored id and returns its 1-based position, or 0 when the id is 0, the array is empty or the id is absent. A trained row leaves the visible list but stays in the array, so the index it returns is then above GetNumTrainerServices(). A group header holds -1, so selecting one reads back the first header.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 5

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