<?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%3ASelectItemRollChoice</id>
	<title>API:SelectItemRollChoice - 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%3ASelectItemRollChoice"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SelectItemRollChoice&amp;action=history"/>
	<updated>2026-10-17T10:25:52Z</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:SelectItemRollChoice&amp;diff=30687&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:SelectItemRollChoice&amp;diff=30687&amp;oldid=prev"/>
		<updated>2026-10-16T19:48:30Z</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=Loot}}&lt;br /&gt;
Sends the player&amp;#039;s need/greed/pass choice for an item that is being rolled for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SelectItemRollChoice(sourceId, lootSlot, rollChoice)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;sourceId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Source ID of the roll, as given in the loot roll data (&amp;lt;code&amp;gt;rollData.sourceId&amp;lt;/code&amp;gt; in the stock UI).&lt;br /&gt;
;lootSlot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Loot slot of the roll, as given in the loot roll data (&amp;lt;code&amp;gt;rollData.lootSlot&amp;lt;/code&amp;gt;).&lt;br /&gt;
;rollChoice : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – &amp;lt;code&amp;gt;GameData.LootRoll.NEED&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GameData.LootRoll.GREED&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;GameData.LootRoll.PASS&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* &amp;lt;code&amp;gt;rollChoice&amp;lt;/code&amp;gt; values of 3 or more are ignored and nothing happens.&lt;br /&gt;
* The client looks up its pending roll with the same &amp;lt;code&amp;gt;sourceId&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lootSlot&amp;lt;/code&amp;gt;. If there is none, nothing happens.&lt;br /&gt;
* The choice is stored in that roll entry and sent to the server.&lt;br /&gt;
* Nothing is sent if the connection is not ready, or if the entry&amp;#039;s source ID is 0. The choice is still stored in those cases.&lt;br /&gt;
* The client does not check whether &amp;quot;need&amp;quot; is allowed for the item. The stock UI checks &amp;lt;code&amp;gt;rollData.allowNeed&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
* The function needs at least three arguments and only reads the last three.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument is not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_lootwindow/source/lootrollwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function EA_Window_LootRoll.SelectRollOption( lootIndex, rollChoice )&lt;br /&gt;
    EA_Window_LootRoll.lootData[lootIndex].rollChoice = rollChoice&lt;br /&gt;
&lt;br /&gt;
    SelectItemRollChoice( EA_Window_LootRoll.lootData[lootIndex].sourceId, EA_Window_LootRoll.lootData[lootIndex].lootSlot, rollChoice )&lt;br /&gt;
&lt;br /&gt;
    EA_Window_LootRoll.UpdateLootRollData()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:LootItem|LootItem]]&lt;br /&gt;
* [[API:AssignLootItem|AssignLootItem]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>