Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:AddSelectedReward

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

Marks one choice reward of the current quest as selected.

AddSelectedReward(rewardIndex)

Arguments

rewardIndex
number – Number of the choice reward, 1 to 25.

Returns

Nothing useful. See Details.

Details

  • The client keeps a set of selected choice rewards. This function adds rewardIndex to it. Values outside 1–25 are ignored.
  • Nothing is sent to the server by this call. The client reads the selection later, when it builds the interaction request that completes the quest. The stock quest window selects rewards first and then broadcasts SystemData.Events.INTERACT_COMPLETE_QUEST.
  • The client does not check how many rewards the quest allows. The stock UI compares against GameData.InteractQuestData.maxChoices itself.
  • After a successful call the function reports one return value without pushing one, so Lua receives the value on top of the stack, which is the last argument passed. Do not rely on this.
  • The function needs at least one argument and only reads the last one.

Errors

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

Example

Selecting the only allowed reward, from default/ea_interactionwindow/source/interactionquestwindow.lua:

if( EA_Window_InteractionQuest.choiceRewardsData[btn].selected == true )
then
    ClearSelectedRewards()
    AddSelectedReward( btn )
end

See also