benilla-re systems structs docs

CountQuestRewardItems

function · ui · primitive

Address
0x5016a0 · 27 bytes, up to 0x5016ba
Meaning
Counts the leading reward records with an item id
Confidence
verified, proof one
Finding
ui/questpanel#counting-and-describing-items

Finding: Counting and describing items in ui: quest panel state and the quest dialog verbs

GetNumQuestRewards() and GetNumQuestChoices() count the leading records whose item id is nonzero, and GetNumQuestItems() counts the leading records whose required display id (not the item id) is nonzero, so a required item with display id 0 ends the count. GetQuestItemInfo(type, index) takes "reward", "choice" or "required" and a 1-based index and returns the name, the icon path, the count, the quality and 1 when the player can use the item, else nil; a missing or wrongly typed argument, an unknown type and an index of 8 or more raise Invalid quest item in GetQuestItemInfo("type", index) (0x501f98, 0x501fac, 0x502000). The index test is ja 6 after the decrement (0x501719), so index 7 is accepted and reads past the sixth record.

The derivation is in the doc.

Callers 1

Callees 0

None by a direct call or jump.

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