Anonymous

Module:Skills/Gathering: Difference between revisions

From Melvor Idle
added getThievingNPCTable
(actually finished getThievingNPCStat)
(added getThievingNPCTable)
Line 530: Line 530:
return p._getThievingNPCLootTables(npc)
return p._getThievingNPCLootTables(npc)
end
function p.getThievingNPCTable()
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'!colspan="2"Name!!Area!!'..Icons.Icon({'Thieving', type='skill', notext=true})..' Level!!Experience!!Max Hit!!Perception!!Unique Drop'
local npcArray = Shared.clone(SkillData.Thieving.NPCs)
table.sort(npcArray, function(a, b) return a.level < b.level end)
for i, npc in Shared.skpairs(npcArray) do
result = result..'\r\n|-'
result = result..'\r\n|'..Icons.Icon({npc.name, type='thieving', size='50', notext=true})
if npc.name == 'Golbin' or npc.name == 'Wizard' or npc.name == 'Cyclops' then
result = result..'||[['..npc.name..' (thieving)|'..npc.name..']]'
else
result = result..'||[['..npc.name..']]'
end
local area = p.getThievingNPCArea(npc)
result = result..'||'..area.name
result = result..'||'..Icons._SkillReq('Thieving', npc.level)
result = result..'||style="text-align:right"|'..npc.xp
result = result..'||style="text-align:right"|'..(npc.maxHit * 10)
result = result..'||style="text-align:right"|'..npc.perception
if npc.uniqueDrop ~= nil and npc.uniqueDrop.itemID > -1 then
local uniqueDrop = Items.getItemByID(npc.uniqueDrop.itemID)
if npc.uniqueDrop.qty > 1 then
result = result..'||data-sort-value="'..uniqueDrop.name..'"|'..Icons.Icon({uniqueDrop.name, type='item', qty = npc.uniqueDrop.qty})
else
result = result..'||data-sort-value="'..uniqueDrop.name..'"|'..Icons.Icon({uniqueDrop.name, type='item'})
end
else
result = result..'|| '
end
end
result = result..'\r\n|}'
return result
end
end


return p
return p