GetJournalQuestNumRewards

From ESOUI Wiki

Jump to: navigation, search

This function returns the number of rewards offered by the specified quest. You can use this function to iterate over the rewards and retrieve information about them.

Arguments

journalIndex
The index of the quest to retrieve; it must be a number between 1 and GetNumJournalQuests(), inclusive.

Example

local desiredQuest = "The Covetous Countess"
 
local count = GetNumJournalQuests()
for i = 1, count do
   local name = GetJournalQuestName(i)
   if name == desiredQuest then
      --
      -- We found the quest we're interested in.
      --
      d(name .. " awards the following items when completed:")
      local count = GetJournalQuestNumRewards(i)
      for j = 1, count do
         local type, name, amount, _, _, _, rewardType = GetJournalQuestRewardInfo(i, j)
         if type == REWARD_TYPE_AUTO_ITEM and rewardType == REWARD_ITEM_TYPE_ITEM then
            local id = GetJournalQuestRewardItemId(i, j)
            d("Item ID: " .. id)
         end
      end
      --
      -- Now let's stop iterating over the other quests:
      --
      break
   end
end

External links

Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox