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 theidfield of the objective data used by the stock trackers.- optOutType
number– Opt-out choice. The stock UI uses0(no opt-out),1(opt out of all objective loot) and2(opt out of gold bags only), defined asTrackerUtils.OPT_OUT_OPTION_NONE,_ALLand_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
optOutTypeis 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(seeEA_Window_CityTracker.OnQuestOptOutinea_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
