Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GameData.InteractData.GetLootList

From RoR Wiki
Revision as of 19:42, 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 · Loot functions
Version: WAR 1.4.8

Returns the items in the loot window: the loot of the corpse or object the player is looting.

items = GameData.InteractData.GetLootList()

Arguments

None.

Returns

items
table – Array of item data tables, indexed from 1. Empty if there is no loot.

Details

  • Each call builds a new table from the client's stored loot list.
  • The index of an item in this table is the lootIndex used by LootItem and AssignLootItem.
  • If the Lua state is not available, the function returns nothing.

Errors

None.

Example

From default/ea_lootwindow/source/lootwindow.lua:

EA_Window_Loot.lootData = GameData.InteractData.GetLootList()
EA_Window_Loot.lootDataDisplayOrder = {}

for lootIndex, _ in ipairs( EA_Window_Loot.lootData ) 
do
    table.insert( EA_Window_Loot.lootDataDisplayOrder, lootIndex )
end   	

ListBoxSetDisplayOrder("EA_Window_LootList", EA_Window_Loot.lootDataDisplayOrder )

-- Show the Window when it contains items
WindowSetShowing( "EA_Window_Loot", EA_Window_Loot.lootDataDisplayOrder[1] ~= nil  )

See also