Module:Skills/Gathering: Difference between revisions

getThievingSourcesForItem: Amend weightings for general rare items to be integers (allows Items/SourceTables to express chances as fractions)
(_getThievingNPCLootTables: Resolve a couple issues with displayed fractional drop chances; getThievingGeneralRareTable: Split from _getThievingNPCLootTables)
(getThievingSourcesForItem: Amend weightings for general rare items to be integers (allows Items/SourceTables to express chances as fractions))
Line 677: Line 677:
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, wt = drop.chance, totalWt = 100, level = 1})
table.insert(resultArray, {npc = 'all', minQty = 1, maxQty = 1, wt = 1, totalWt = Shared.round2(1/(drop.chance/100), 0), level = 1})
end
end
end
end