Add Quest Shopping List
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
adc76b9a87
commit
9d30c8fed8
7 changed files with 1766 additions and 3 deletions
29
QuestShoppingList/tools/generate.lua
Normal file
29
QuestShoppingList/tools/generate.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
-- Writes Data.lua from the merged.lua made by DungeonPreQuest/tools/extract.lua.
|
||||
-- usage: lua generate.lua merged.lua Data.lua
|
||||
local data = dofile(arg[1])
|
||||
local ITEM_CLASS_QUEST = 12
|
||||
|
||||
local byName = {}
|
||||
for id, item in pairs(data.objectiveItems) do
|
||||
if item.class ~= ITEM_CLASS_QUEST then
|
||||
local key = item.name:lower()
|
||||
if not byName[key] or id < byName[key] then
|
||||
byName[key] = id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local names = {}
|
||||
for name in pairs(byName) do names[#names + 1] = name end
|
||||
table.sort(names)
|
||||
|
||||
local out = assert(io.open(arg[2], "w"))
|
||||
out:write("-- Generated from QuestieDB's Forever data. Do not edit.\n")
|
||||
out:write("-- Lowercased name -> item ID, for quest objective items that aren't quest-only.\n")
|
||||
out:write("local _, ns = ...\n\nns.itemIDs = {\n")
|
||||
for _, name in ipairs(names) do
|
||||
out:write(string.format(" [%q]=%d,\n", name, byName[name]))
|
||||
end
|
||||
out:write("}\n")
|
||||
out:close()
|
||||
print("items", #names)
|
||||
Loading…
Add table
Add a link
Reference in a new issue