Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:SelectItemRollChoice

From RoR Wiki
Revision as of 19:48, 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

Sends the player's need/greed/pass choice for an item that is being rolled for.

SelectItemRollChoice(sourceId, lootSlot, rollChoice)

Arguments

sourceId
number – Source ID of the roll, as given in the loot roll data (rollData.sourceId in the stock UI).
lootSlot
number – Loot slot of the roll, as given in the loot roll data (rollData.lootSlot).
rollChoice
number – GameData.LootRoll.NEED, GameData.LootRoll.GREED or GameData.LootRoll.PASS.

Returns

Nothing.

Details

  • rollChoice values of 3 or more are ignored and nothing happens.
  • The client looks up its pending roll with the same sourceId and lootSlot. If there is none, nothing happens.
  • The choice is stored in that roll entry and sent to the server.
  • Nothing is sent if the connection is not ready, or if the entry's source ID is 0. The choice is still stored in those cases.
  • The client does not check whether "need" is allowed for the item. The stock UI checks rollData.allowNeed itself.
  • The function needs at least three arguments and only reads the last three.

Errors

None besides the generic Invalid Parameters message when an argument is not a number.

Example

From default/ea_lootwindow/source/lootrollwindow.lua:

function EA_Window_LootRoll.SelectRollOption( lootIndex, rollChoice )
    EA_Window_LootRoll.lootData[lootIndex].rollChoice = rollChoice

    SelectItemRollChoice( EA_Window_LootRoll.lootData[lootIndex].sourceId, EA_Window_LootRoll.lootData[lootIndex].lootSlot, rollChoice )

    EA_Window_LootRoll.UpdateLootRollData()
end

See also