Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetLootRollData

From RoR Wiki
Revision as of 19:44, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Game functions
Version: WAR 1.4.8

Returns the items currently up for a group loot roll (Need / Greed / Pass).

rolls = GetLootRollData()

Arguments

None.

Returns

rolls
table – Array of 10 roll tables, indexed from 1 to 10.

Each roll table has these fields:

Key Type Meaning
itemData table The item, as an item data table.
timer number Time left to roll.
lootSlot number Slot of the item in its loot source. Passed to SelectItemRollChoice.
rollChoice number The player's choice so far. -1 if no choice has been made.
sourceId number Id of the loot source. Passed to SelectItemRollChoice.
allowNeed boolean true if the player may roll Need.

Details

  • The pending rolls come first. The rest of the 10 entries are blank: an empty item (itemData.id 0), timer 0, lootSlot 0, rollChoice -1, sourceId 0 and allowNeed true.
  • If the Lua state is not available, the function returns nothing.

Errors

None.

Example

From ea_lootwindow/source/lootrollwindow.lua:

EA_Window_LootRoll.lootData = GetLootRollData()
...
for lootIndex, rollData in ipairs( EA_Window_LootRoll.lootData )
do
    if( rollData.itemData.id ~= 0 and rollData.rollChoice == EA_Window_LootRoll.ROLL_CHOICE_INAVLID)

Passing automatically when the timer runs out, from the same file:

SelectItemRollChoice( rollData.sourceId, rollData.lootSlot, EA_Window_LootRoll.ROLL_CHOICE_PASS )

See also