Module:EncounterTable: Difference between revisions

Jump to navigation Jump to search
122 bytes added ,  18:54, 12 November 2019
process args attempt
(should probably work now)
(process args attempt)
Line 1: Line 1:
local p = {}
local p = {}
local process_args = require('Module:ProcessArgs')


--a lot taken from lol gamepedia
--a lot taken from lol gamepedia
Line 63: Line 64:


function p.start(frame)
function p.start(frame)
  local tblName = frame.args['name'] or ''
args = process_args.merge(true)
  local tblName = args['name'] or ''
  local result = {}
  local result = {}
  local totalWeight = 0
  local totalWeight = 0
  for i, row in ipairs(frame.args) do
  for i, row in ipairs(args) do
   local newrow = p.splitEncounterTableArgs(row)
   local newrow = p.splitEncounterTableArgs(row)
   result[i] = newrow
   result[i] = newrow
Line 86: Line 88:
       finalTable[i]['item'] = 'Item from [[EncounterTable:' .. row['table'] .. '|' .. row['table'] .. ']]'
       finalTable[i]['item'] = 'Item from [[EncounterTable:' .. row['table'] .. '|' .. row['table'] .. ']]'
     else
     else
       error('What')
       error('A table and item cannot be specified at the same time!')
     end
     end
     -- dice tooltip quantity
     -- dice tooltip quantity

Navigation menu