Anonymous

Module:Items: Difference between revisions

From Melvor Idle
Added new Creation Table override for arrow shafts
(Adding a space in front of glove charges to fix an issue)
(Added new Creation Table override for arrow shafts)
Line 225: Line 225:
     qty = item.fletchQty
     qty = item.fletchQty
     time = 2
     time = 2
    if item.name == 'Arrow Shafts' then
      --Arrow Shafts get special (weird) treatment
      req = '1 of any [[Log]]'
      qty = '15 - 135'
    end
     table.insert(tables, p.buildCreationTable(skill, lvl, xp, req, qty, time))
     table.insert(tables, p.buildCreationTable(skill, lvl, xp, req, qty, time))
   end
   end
Line 369: Line 374:
   if req ~= nil then  
   if req ~= nil then  
     result = result..'\r\n|-\r\n!style="text-align: right;"|Materials\r\n|'
     result = result..'\r\n|-\r\n!style="text-align: right;"|Materials\r\n|'
     for i, mat in pairs(req) do
     if type(req) == 'table' then
      if i > 1 then result = result..'<br/>' end
      for i, mat in pairs(req) do
      local matItem = p.getItemByID(mat.id)
        if i > 1 then result = result..'<br/>' end
      if matItem == nil then
        local matItem = p.getItemByID(mat.id)
        result = result..mat.qty..'x ?????'
        if matItem == nil then
      else
          result = result..mat.qty..'x ?????'
        result = result..Icons.Icon({matItem.name, type='item', qty=mat.qty})
        else
          result = result..Icons.Icon({matItem.name, type='item', qty=mat.qty})
        end
       end
       end
    else
    result = result..req
     end
     end
   end
   end