Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LootRollOptOut

From RoR Wiki

UI Lua API · Loot functions
Version: WAR 1.4.8

Tells the server which loot the player wants to opt out of for a public quest or other objective.

LootRollOptOut(objectiveId, optOutType)

Arguments

objectiveId
number – Id of the objective, as in the id field of the objective data used by the stock trackers.
optOutType
number – Opt-out choice. The stock UI uses 0 (no opt-out), 1 (opt out of all objective loot) and 2 (opt out of gold bags only), defined as TrackerUtils.OPT_OUT_OPTION_NONE, _ALL and _GOLD.

Returns

Nothing.

Details

  • The client sends the objective id and the opt-out value to the server and does nothing else. It does not check that the objective exists. Only the low byte of optOutType is sent.
  • Nothing is sent if the connection is not ready.
  • The stock UI updates its check boxes when the server answers with SystemData.Events.PUBLIC_QUEST_OPTOUT (see EA_Window_CityTracker.OnQuestOptOut in ea_objectivetrackers/source/citytrackerwindow.lua).
  • The function needs at least two arguments and only reads the last two.

Errors

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

Example

From default/ea_objectivetrackers/source/trackerutils.lua:

function TrackerUtils.SetOptOutOption( windowName, index, optOutValue)
    local checkBoxName = windowName.."CheckBox"
    if(ButtonGetPressedFlag(checkBoxName) == false) then
        local objectiveId = DataUtils.activeObjectivesData[index].id
        LootRollOptOut(objectiveId, optOutValue) 
    end
    EA_Window_ContextMenu.HideAll()    
end

See also