Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GameData.GetQuestRewards

From RoR Wiki

UI Lua API · Quest functions
Version: WAR 1.4.8

Returns the rewards of a quest in the player's quest log.

rewards = GameData.GetQuestRewards(questId)

Arguments

questId
number – Id of a quest in the player's quest log.

Returns

rewards
table – Rewards table, or nothing if the quest is not in the quest log.
Key Type Meaning
xp number Experience reward.
money number Money reward.
itemsGiven table Array, indexed from 1, of item data tables for the items always given.
itemsChosen table Array, indexed from 1, of item data tables for the items to choose from.
maxChoices number How many of the itemsChosen items can be picked.

Details

  • Only quests in the player's own quest log are found. For other quests use GetDatabaseQuestData.
  • If there is no player object, or the Lua state is not available, the function returns nothing.

Errors

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

Example

From ea_tomeofknowledge/source/tomewindow_questjournal.lua:

local questRewards = GameData.GetQuestRewards( questId )

TomeWindow.QuestJournal.visibleQuestRewardItems.money = questRewards.money
TomeWindow.QuestJournal.visibleQuestRewardItems.xp = questRewards.xp

See also