Anonymous

Module:Skills: Difference between revisions

From Melvor Idle
1,118 bytes removed ,  8 June 2021
moved getPotionNavbox to Module:Navboxes
(_formatLootTable: Re-order columns for table output & include total row)
(moved getPotionNavbox to Module:Navboxes)
Line 386: Line 386:
   end
   end


  result = result..'\r\n|}'
  return result
end
function p.getPotionNavbox(frame)
  --•
  local result = '{| class="wikitable" style="margin:auto; clear:both; width: 100%"'
  result = result..'\r\n!colspan=2|'..Icons.Icon({'Herblore', 'Potions', type='skill'})
  local CombatPots = {}
  local SkillPots = {}
  for i, potData in Shared.skpairs(SkillData.Herblore.ItemData) do
    if potData.category == 0 then
      table.insert(CombatPots, Icons.Icon({potData.name, type='item', img=(potData.name..' I')}))
    else
      if potData.name == 'Bird Nests Potion' then
        table.insert(SkillPots, Icons.Icon({"Bird Nest Potion", type='item', img="Bird Nest Potion I"}))
      else
        table.insert(SkillPots, Icons.Icon({potData.name, type='item', img=(potData.name..' I')}))
      end
    end
  end
  result = result..'\r\n|-\r\n!Combat Potions\r\n|class="center" style="vertical-align:middle;"'
  result = result..'|'..table.concat(CombatPots, ' • ')
  result = result..'\r\n|-\r\n!Skill Potions\r\n|class="center" style="vertical-align:middle;"'
  result = result..'|'..table.concat(SkillPots, ' • ')
   result = result..'\r\n|}'
   result = result..'\r\n|}'
   return result
   return result
444

edits