17,101
edits
(getFishTable: Correct sort order for Cooking level column) |
(Use Thieving drop chances from game data instead of hard-coded values) |
||
Line 9: | Line 9: | ||
local Items = require('Module:Items') | local Items = require('Module:Items') | ||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
function p.getConstellationByID(constID) | function p.getConstellationByID(constID) | ||
Line 453: | Line 450: | ||
local normalTxt = '===Possible Common Drops:===\r\nUp to one of these will be received on a successful pickpocket:' | local normalTxt = '===Possible Common Drops:===\r\nUp to one of these will be received on a successful pickpocket:' | ||
local totalWt = 0 | local totalWt = 0 | ||
local lootChance = | local lootChance = SkillData.Thieving.ItemChance | ||
local lootValue = 0 | local lootValue = 0 | ||
Line 544: | Line 541: | ||
lineTxt = lineTxt..'\r\n|-\r\n|'..Icons.Icon({thisItem.name, type='item'}) | lineTxt = lineTxt..'\r\n|-\r\n|'..Icons.Icon({thisItem.name, type='item'}) | ||
lineTxt = lineTxt..'||'..drop.qty..'||data-sort-value="'..thisItem.sellsFor..'"|'..Icons.GP(thisItem.sellsFor) | lineTxt = lineTxt..'||'..drop.qty..'||data-sort-value="'..thisItem.sellsFor..'"|'..Icons.GP(thisItem.sellsFor) | ||
lineTxt = lineTxt..'||style="text-align:right"|'..Shared.fraction(1, 1/( | lineTxt = lineTxt..'||style="text-align:right"|'..Shared.fraction(1, 1/(SkillData.Thieving.AreaUniqueChance/100)) | ||
lineTxt = lineTxt..'||'..Shared.round( | lineTxt = lineTxt..'||'..Shared.round(SkillData.Thieving.AreaUniqueChance, 2, 2)..'%' | ||
dropLines[thisItem.name] = lineTxt | dropLines[thisItem.name] = lineTxt | ||
end | end | ||
Line 552: | Line 549: | ||
end | end | ||
areaTxt = areaTxt..'\r\n|-class="sortbottom" \r\n!colspan="3"|Total:' | areaTxt = areaTxt..'\r\n|-class="sortbottom" \r\n!colspan="3"|Total:' | ||
areaTxt = areaTxt..'\r\n|style="text-align:right"|'..Shared.fraction(1, 1/( | areaTxt = areaTxt..'\r\n|style="text-align:right"|'..Shared.fraction(1, 1/(SkillData.Thieving.AreaUniqueChance/100))..'||' | ||
areaTxt = areaTxt..'style="text-align:right"|'..Shared.round( | areaTxt = areaTxt..'style="text-align:right"|'..Shared.round(SkillData.Thieving.AreaUniqueChance, 2, 2)..'%' | ||
areaTxt = areaTxt..'\r\n|}' | areaTxt = areaTxt..'\r\n|}' | ||
table.insert(sectionTxt, areaTxt) | table.insert(sectionTxt, areaTxt) | ||
Line 707: | Line 704: | ||
end | end | ||
if dropWt > 0 then | if dropWt > 0 then | ||
table.insert(resultArray, {npc = npc.name, minQty = 1, maxQty = dropQty, wt = dropWt * | table.insert(resultArray, {npc = npc.name, minQty = 1, maxQty = dropQty, wt = dropWt * SkillData.Thieving.ItemChance, totalWt = totalWt * 100, level = npc.level}) | ||
end | end | ||
Line 716: | Line 713: | ||
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], wt = | table.insert(resultArray, {npc = npc.name, minQty = areaNPCs[npc.id], maxQty = areaNPCs[npc.id], wt = SkillData.Thieving.AreaUniqueChance, totalWt = 100, level = npc.level}) | ||
end | end | ||
end | end |