4,951
edits
Falterfire (talk | contribs) (added p.getThievingNPCLootTables) |
Falterfire (talk | contribs) (changed how rare odds are displayed) |
||
Line 341: | Line 341: | ||
end | end | ||
return result | return result | ||
end | |||
function p._getThievingNPCStat(npc) | |||
end | |||
function p.getThievingNPCStat(frame) | |||
local npcName = frame.args ~= nil and frame.args[1] or frame | |||
local npc = p.getThievingNPC(npcName) | |||
if npc == nil then | |||
return "ERROR: Invalid Thieving NPC "..npcName.."[[Category:Pages with script errors]]" | |||
end | |||
return p._getThievingNPCStat(npc) | |||
end | end | ||
Line 349: | Line 363: | ||
--Five sections here: GP, normal loot, area loot, rare loot, and unique item | --Five sections here: GP, normal loot, area loot, rare loot, and unique item | ||
--First up, GP: | --First up, GP: | ||
local gpTxt = 'Successfully pickpocketing '..npc.name..' will always give '..Icons.GP(1, npc.maxGP) | local gpTxt = 'Successfully pickpocketing the '..npc.name..' will always give '..Icons.GP(1, npc.maxGP) | ||
table.insert(sectionTxt, gpTxt) | table.insert(sectionTxt, gpTxt) | ||
Line 431: | Line 445: | ||
rareTxt = rareTxt..'\r\n{|class="wikitable sortable"' | rareTxt = rareTxt..'\r\n{|class="wikitable sortable"' | ||
rareTxt = rareTxt..'\r\n!Item!!Qty' | rareTxt = rareTxt..'\r\n!Item!!Qty' | ||
rareTxt = rareTxt..'!!Price!! | rareTxt = rareTxt..'!!Price!!Chance' | ||
for i, drop in pairs(SkillData.Thieving.RareItems) do | for i, drop in pairs(SkillData.Thieving.RareItems) do | ||
local thisItem = Items.getItemByID(drop.itemID) | local thisItem = Items.getItemByID(drop.itemID) | ||
local odds = drop.chance | local odds = drop.chance | ||
rareTxt = rareTxt..'\r\n|-\r\n|'..Icons.Icon({thisItem.name, type='item'}) | rareTxt = rareTxt..'\r\n|-\r\n|'..Icons.Icon({thisItem.name, type='item'}) | ||
rareTxt = rareTxt..'||1||data-sort-value="'..thisItem.sellsFor..'"|'..Icons.GP(thisItem.sellsFor) | rareTxt = rareTxt..'||1||data-sort-value="'..thisItem.sellsFor..'"|'..Icons.GP(thisItem.sellsFor) | ||
rareTxt = rareTxt..'||style="text-align:right" data-sort-value="'..odds..'" | rareTxt = rareTxt..'||style="text-align:right" data-sort-value="'..odds..'"|'..Shared.round(odds, 4, 4)..'%' | ||
end | end | ||
rareTxt = rareTxt..'\r\n|}' | rareTxt = rareTxt..'\r\n|}' |