API:GetDatabaseQuestData
From RoR Wiki
UI Lua API · Quest functions
Version: WAR 1.4.8
Returns the data of a quest by id, including its rewards. Used for quest links in chat.
questData = GetDatabaseQuestData(questId)
Arguments
- questId
number– Id of the quest.
Returns
- questData
table– A quest table with the same fields as the entries of GetQuestData, plus arewardsfield. Nothing is returned if the quest is not found.
The rewards table has these fields:
| 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
questIdis converted to a 16-bit integer.- The client first looks in its database of linked quests, then in the player's own quest log.
- The quest fields are filled by the same code as GetQuestData.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From ea_chatwindow/source/chathyperlinking.lua:
local questData = GetDatabaseQuestData( questId )
if( not questData )
then
-- Show an error message
return
end
Reading a reward item, from the same file:
local itemData = questData.rewards.itemsGiven[rewardIndex]
