Module:Skills/Gathering: Difference between revisions

added level to the output from getThievingSourcesForItem
(added rare items to getThievingSourcesForItem and canItemBeStolen)
(added level to the output from getThievingSourcesForItem)
Line 649: Line 649:
end
end
if dropWt > 0 then
if dropWt > 0 then
table.insert(resultArray, {npc = npc.name, minQty = 1, maxQty = dropQty, chance = dropWt / totalWt * 100})
table.insert(resultArray, {npc = npc.name, minQty = 1, maxQty = dropQty, chance = dropWt / totalWt * 100, level = npc.level})
end
end
--Chance of -1 on unique drops is to indicate variable chance
--Chance of -1 on unique drops is to indicate variable chance
if npc.uniqueDrop ~= nil and npc.uniqueDrop.itemID == itemID then
if npc.uniqueDrop ~= nil and npc.uniqueDrop.itemID == itemID then
table.insert(resultArray, {npc = npc.name, minQty = npc.uniqueDrop.qty, maxQty = npc.uniqueDrop.qty, chance = -1})
table.insert(resultArray, {npc = npc.name, minQty = npc.uniqueDrop.qty, maxQty = npc.uniqueDrop.qty, chance = -1, level = npc.level})
end
end
if areaNPCs[npc.id] ~= nil then
if areaNPCs[npc.id] ~= nil then
table.insert(resultArray, {npc = npc.name, minQty = areaNPCs[npc.id], maxQty = areaNPCs[npc.id], chance = thievingAreaLootChance})
table.insert(resultArray, {npc = npc.name, minQty = areaNPCs[npc.id], maxQty = areaNPCs[npc.id], chance = thievingAreaLootChance, level = npc.level})
end
end
end
end
Line 664: Line 664:
for i, drop in pairs(SkillData.Thieving.RareItems) do
for i, drop in pairs(SkillData.Thieving.RareItems) do
if drop.itemID == itemID then
if drop.itemID == itemID then
table.insert(resultArray, {npc = 'all', minQty = 1, maxQty = 1, chance = drop.chance})
table.insert(resultArray, {npc = 'all', minQty = 1, maxQty = 1, chance = drop.chance, level = 1})
end
end
end
end