<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetLootRollData</id>
	<title>API:GetLootRollData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetLootRollData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetLootRollData&amp;action=history"/>
	<updated>2026-10-17T22:25:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetLootRollData&amp;diff=30425&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetLootRollData&amp;diff=30425&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:23Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Game}}&lt;br /&gt;
Returns the items currently up for a group loot roll (Need / Greed / Pass).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rolls = GetLootRollData()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;rolls : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of 10 roll tables, indexed from 1 to 10.&lt;br /&gt;
&lt;br /&gt;
Each roll table has these fields:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;itemData&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || The item, as an [[API:GetInventoryItemData#Item data table|item data table]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;timer&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Time left to roll.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;lootSlot&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Slot of the item in its loot source. Passed to [[API:SelectItemRollChoice|SelectItemRollChoice]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rollChoice&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || The player&amp;#039;s choice so far. &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; if no choice has been made.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sourceId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Id of the loot source. Passed to [[API:SelectItemRollChoice|SelectItemRollChoice]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;allowNeed&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player may roll Need.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The pending rolls come first. The rest of the 10 entries are blank: an empty item (&amp;lt;code&amp;gt;itemData.id&amp;lt;/code&amp;gt; 0), &amp;lt;code&amp;gt;timer&amp;lt;/code&amp;gt; 0, &amp;lt;code&amp;gt;lootSlot&amp;lt;/code&amp;gt; 0, &amp;lt;code&amp;gt;rollChoice&amp;lt;/code&amp;gt; -1, &amp;lt;code&amp;gt;sourceId&amp;lt;/code&amp;gt; 0 and &amp;lt;code&amp;gt;allowNeed&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
* If the Lua state is not available, the function returns nothing.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_lootwindow/source/lootrollwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EA_Window_LootRoll.lootData = GetLootRollData()&lt;br /&gt;
...&lt;br /&gt;
for lootIndex, rollData in ipairs( EA_Window_LootRoll.lootData )&lt;br /&gt;
do&lt;br /&gt;
    if( rollData.itemData.id ~= 0 and rollData.rollChoice == EA_Window_LootRoll.ROLL_CHOICE_INAVLID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Passing automatically when the timer runs out, from the same file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SelectItemRollChoice( rollData.sourceId, rollData.lootSlot, EA_Window_LootRoll.ROLL_CHOICE_PASS )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:SelectItemRollChoice|SelectItemRollChoice]]&lt;br /&gt;
* [[API:GetInventoryItemData|GetInventoryItemData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>