17,105
edits
m (Correct typo) |
m (Revert to previous revision) |
||
Line 312: | Line 312: | ||
--Alright, time to go through all the ways you can get an item... | --Alright, time to go through all the ways you can get an item... | ||
--First up: Can we kill somebody and take theirs? | --First up: Can we kill somebody and take theirs? | ||
local killStr = | local killStr = '' | ||
local dungeonStr = | local dungeonStr = '' | ||
local count1 = 0 | |||
for i, monster in Shared.skpairs(MonsterData.Monsters) do | for i, monster in Shared.skpairs(MonsterData.Monsters) do | ||
local isDrop = false | local isDrop = false | ||
Line 344: | Line 345: | ||
--If this is a boss then we actually are completing dungeons for this and need to figure out which one | --If this is a boss then we actually are completing dungeons for this and need to figure out which one | ||
for j, dung in pairs(areaList) do | for j, dung in pairs(areaList) do | ||
if string.len(dungeonStr) > 0 then | |||
dungeonStr = dungeonStr..',' | |||
else | |||
dungeonStr = 'Completing: ' | |||
end | |||
dungeonStr = dungeonStr..Icons.Icon({dung.name, type="dungeon", notext=true}) | |||
end | end | ||
else | else | ||
count1 = count1 + 1 | |||
if string.len(killStr) > 0 then | |||
killStr = killStr..',' | |||
--if count1 % 3 == 1 and count1 > 1 then killStr = killStr..'<br/>' end | |||
killStr = killStr..Icons.Icon({monster.name, type="monster", notext="true"}) | |||
else | |||
killStr = killStr..'Killing: '..Icons.Icon({monster.name, type="monster", notext="true"}) | |||
end | |||
end | end | ||
end | end | ||
Line 353: | Line 366: | ||
-- Special exceptions for Fire/Infernal Cape and first two lore books | -- Special exceptions for Fire/Infernal Cape and first two lore books | ||
if sourceOverrides['Dungeon'][item.id] ~= nil then | if sourceOverrides['Dungeon'][item.id] ~= nil then | ||
if string.len(dungeonStr) > 0 then | |||
dungeonStr = dungeonStr .. ',' | |||
else | |||
dungeonStr = 'Completing: ' | |||
end | |||
dungeonStr = dungeonStr .. Icons.Icon({sourceOverrides['Dungeon'][item.id], type='dungeon', notext=true}) | |||
end | end | ||
if | if string.len(dungeonStr) > 0 then table.insert(lineArray, dungeonStr) end | ||
if | if string.len(killStr) > 0 then table.insert(lineArray, killStr) end | ||
--Next: Can we find it in a box? | --Next: Can we find it in a box? | ||
--While we're here, check for upgrades, cooking, and growing | --While we're here, check for upgrades, cooking, and growing | ||
local lootStr = | local lootStr = '' | ||
local upgradeStr = | local upgradeStr = '' | ||
local cookStr = | local cookStr = '' | ||
local burnStr = | local burnStr = '' | ||
local growStr = | local growStr = '' | ||
local count2 = 0 | |||
count1 = 0 | |||
for i, item2 in pairs(ItemData.Items) do | for i, item2 in pairs(ItemData.Items) do | ||
if item2.dropTable ~= nil then | if item2.dropTable ~= nil then | ||
for j, loot in pairs(item2.dropTable) do | for j, loot in pairs(item2.dropTable) do | ||
if loot[1] == item.id then | if loot[1] == item.id then | ||
count1 = count1 + 1 | |||
if string.len(lootStr) > 0 then | |||
lootStr = lootStr..',' | |||
--if count1 % 3 == 1 and count1 > 1 then lootStr = lootStr..'<br/>' end | |||
lootStr = lootStr..Icons.Icon({item2.name, type="item", notext="true"}) | |||
else | |||
lootStr = lootStr..'Opening: '..Icons.Icon({item2.name, type="item", notext="true"}) | |||
end | |||
end | end | ||
end | end | ||
end | end | ||
if item2.trimmedItemID == item.id then | if item2.trimmedItemID == item.id then | ||
count2 = count2 + 1 | |||
if string.len(upgradeStr) > 0 then | |||
upgradeStr = upgradeStr..',' | |||
--if count2 % 3 == 1 and count2 > 1 then upgradeStr = upgradeStr..'<br/>' end | |||
upgradeStr = upgradeStr..Icons.Icon({item2.name, type="item", notext="true"}) | |||
else | |||
table.insert(categoryArray, '[[Category:Upgraded Items]]') | table.insert(categoryArray, '[[Category:Upgraded Items]]') | ||
upgradeStr = upgradeStr..'Upgrading: '..Icons.Icon({item2.name, type="item", notext="true"}) | |||
end | end | ||
end | end | ||
if item2.cookedItemID == item.id then | if item2.cookedItemID == item.id then | ||
if string.len(cookStr) > 0 then | |||
if | cookStr = cookStr..','..Icons.Icon({item2.name, type="item", notext="true"}) | ||
else | |||
table.insert(categoryArray, '[[Category:Cooked Items]]') | table.insert(categoryArray, '[[Category:Cooked Items]]') | ||
cookStr = cookStr..'Cooking: '..Icons.Icon({item2.name, type="item", notext="true"}) | |||
end | end | ||
end | end | ||
if item2.burntItemID == item.id then | if item2.burntItemID == item.id then | ||
if string.len(burnStr) > 0 then | |||
if | burnStr = burnStr..','..Icons.Icon({item2.name, type="item", notext="true"}) | ||
else | |||
table.insert(categoryArray, '[[Category:Burnt Items]]') | table.insert(categoryArray, '[[Category:Burnt Items]]') | ||
burnStr = burnStr..'Burning: '..Icons.Icon({item2.name, type="item", notext="true"}) | |||
end | end | ||
end | end | ||
if item2.grownItemID == item.id then | if item2.grownItemID == item.id then | ||
if string.len(growStr) > 0 then | |||
if | growStr = growStr..','..Icons.Icon({item2.name, type="item", notext="true"}) | ||
else | |||
table.insert(categoryArray, '[[Category:Harvestable Items]]') | table.insert(categoryArray, '[[Category:Harvestable Items]]') | ||
growStr = growStr..'Growing: '..Icons.Icon({item2.name, type="item", notext="true"}) | |||
end | end | ||
end | end | ||
end | end | ||
if | if string.len(lootStr) > 0 then table.insert(lineArray, lootStr) end | ||
if | if string.len(upgradeStr) > 0 then table.insert(lineArray, upgradeStr) end | ||
if | if string.len(cookStr) > 0 then table.insert(lineArray, cookStr) end | ||
if | if string.len(burnStr) > 0 then table.insert(lineArray, burnStr) end | ||
if | if string.len(growStr) > 0 then table.insert(lineArray, growStr) end | ||
--Next: Can we take it from somebody else -without- killing them? | --Next: Can we take it from somebody else -without- killing them? | ||
local thiefStr = | local thiefStr = '' | ||
for i, npc in pairs(SkillData.Thieving) do | for i, npc in pairs(SkillData.Thieving) do | ||
if npc.lootTable ~= nil then | if npc.lootTable ~= nil then | ||
for j, loot in pairs(npc.lootTable) do | for j, loot in pairs(npc.lootTable) do | ||
if loot[1] == item.id then | if loot[1] == item.id then | ||
if string.len(thiefStr) > 0 then | |||
thiefStr = thiefStr..','..Icons.Icon({npc.name, type="thieving", notext="true"}) | |||
else | |||
thiefStr = thiefStr..'Pickpocketing: '..Icons.Icon({npc.name, type="thieving", notext="true"}) | |||
end | |||
end | end | ||
end | end | ||
end | end | ||
end | end | ||
if | if string.len(thiefStr) > 0 then table.insert(lineArray, thiefStr) end | ||
--If all else fails, I guess we should check if we can make it ourselves | --If all else fails, I guess we should check if we can make it ourselves |