As the title says, it would be nice if we could have functions which allow us to easily iterate over all existing items or abilities without the need to filter by item name and set a hardcoded limit like this:
Lua Code:
for i=1, 140000 do
local link = ("|H0:item:%d:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h"):format(i)
local name = GetItemLinkName(link)
if(name ~= "") then
-- something
end
end
I'd say the simplest solution would be a function similar to GetNextMailId which returns the next valid itemId.
Lua Code:
function GetNextItemLinkIter(state, itemId)
itemId = GetNextItemId(itemId)
return itemId, ("|H0:item:%d:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h"):format(itemId)
end
for id, link in GetNextItemLinkIter do
-- something
end