Skip to content

Commit

Permalink
Add support for multiple items per quest
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Aug 1, 2022
1 parent c7902d5 commit 148d9a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 1 addition & 2 deletions ItemData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ ns.itemData.questItems = {
[59063] = 175137, -- Night Fae Covenant
[59809] = 177904, -- Night Fae Covenant
[60188] = 178464, -- Night Fae Covenant
[60609] = 180008, -- Ardenweald
[60609] = 180009, -- Ardenweald
[60609] = {180008, 180009}, -- Ardenweald
[60649] = 180170, -- Ardenweald
}

Expand Down
12 changes: 11 additions & 1 deletion Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ local function GetQuestDistanceWithItem(questID)
if not itemLink then
local fallbackItemID = itemData.questItems[questID]
if fallbackItemID then
itemLink = ns:GenerateItemLinkFromID(fallbackItemID)
if type(fallbackItemID) == 'table' then
for _, itemID in next, fallbackItemID do
local link = ns:GenerateItemLinkFromID(itemID)
if GetItemCount(link) > 0 then
itemLink = link
break
end
end
else
itemLink = ns:GenerateItemLinkFromID(fallbackItemID)
end
end
end

Expand Down

0 comments on commit 148d9a2

Please sign in to comment.