Module:Magic: Difference between revisions

Added getStandardSpellsTable
(fixed an issue with new magic table generation)
(Added getStandardSpellsTable)
Line 277: Line 277:
   end
   end
   if spell.type == 'Spells' then
   if spell.type == 'Spells' then
     rowTxt = rowTxt..'||Combat spell with a max hit of '..(spell.maxHit * 10)
     rowTxt = rowTxt..'||data-sort-value="'..spell.maxHit..'"|Combat spell with a max hit of '..(spell.maxHit * 10)
   else
   else
     rowTxt = rowTxt..'||'..spell.description
     rowTxt = rowTxt..'||'..spell.description
Line 286: Line 286:
end
end


function p.getStandardSpellsTable(frame)
  local result = '{|class="wikitable sortable"\r\n!colspan="2"|Spell'
  result = result..'!!Requirements'
  result = result..'!!style="width:275px"|Description'
  result = result..'!!Runes'
  local spellList = {}
  for i, spell in Shared.skpairs(MagicData.Spells) do
    local rowTxt = p._getSpellRow(processSpell('Spells', i), false)
    result = result..rowTxt
  end
  result = result..'\r\n|}'
  return result
end


function p.getCurseTable(frame)
function p.getCurseTable(frame)