Module:Skills: Difference between revisions

getThievingNPCTable/getThievingNavbox: Fix text shown for some NPC pages
(_getLootTableValue: Added for average loot table sale value; _formatLootTable: Support output in table form; _getThievingNPCStat: Add lootValue, pickpocketValue, lootList stats)
(getThievingNPCTable/getThievingNavbox: Fix text shown for some NPC pages)
Line 196: Line 196:
   -- Create row for each NPC
   -- Create row for each NPC
   for i, npc in Shared.skpairs(SkillData.Thieving) do
   for i, npc in Shared.skpairs(SkillData.Thieving) do
    local linkText = (npc.name ~= p._getThievingNPCStat(npc, 'pageName') and p._getThievingNPCStat(npc, 'pageName') .. '|' .. npc.name) or npc.name
     table.insert(returnPart, '|-\r\n|style="text-align: left;" |' .. Icons.Icon({npc.name, type='thieving', size=50, notext=true}))
     table.insert(returnPart, '|-\r\n|style="text-align: left;" |' .. Icons.Icon({npc.name, type='thieving', size=50, notext=true}))
     table.insert(returnPart, '|style="text-align: left;" |[[' .. p._getThievingNPCStat(npc, 'pageName') .. ']]')
     table.insert(returnPart, '|style="text-align: left;" |[[' .. linkText .. ']]')
     table.insert(returnPart, '|style="text-align: right;" |' .. p._getThievingNPCStat(npc, 'level'))
     table.insert(returnPart, '|style="text-align: right;" |' .. p._getThievingNPCStat(npc, 'level'))
     table.insert(returnPart, '|style="text-align: right;" |' .. p._getThievingNPCStat(npc, 'xp'))
     table.insert(returnPart, '|style="text-align: right;" |' .. p._getThievingNPCStat(npc, 'xp'))
Line 219: Line 220:
   -- Create row for each NPC
   -- Create row for each NPC
   for i, npc in Shared.skpairs(SkillData.Thieving) do
   for i, npc in Shared.skpairs(SkillData.Thieving) do
     table.insert(npcList, Icons.Icon({npc.name, type='thieving', notext=true}) .. ' [[' .. p._getThievingNPCStat(npc, 'pageName') .. ']]')
    local linkText = (npc.name ~= p._getThievingNPCStat(npc, 'pageName') and p._getThievingNPCStat(npc, 'pageName') .. '|' .. npc.name) or npc.name
     table.insert(npcList, Icons.Icon({npc.name, type='thieving', notext=true}) .. ' [[' .. linkText .. ']]')
   end
   end
   table.insert(returnPart, table.concat(npcList, ' • '))
   table.insert(returnPart, table.concat(npcList, ' • '))