Module:Skills/Artisan: Difference between revisions

Added bag crafting
(adding perfect item icons to the cooking table)
(Added bag crafting)
Line 298: Line 298:
   elseif category == "Necklaces"  then data =  
   elseif category == "Necklaces"  then data =  
         Items.getItems(function(item) return item.type == "Amulet" and item.craftingLevel ~= nil end)
         Items.getItems(function(item) return item.type == "Amulet" and item.craftingLevel ~= nil end)
  elseif category == "Bags"   then data =
  Items.getItems(function(item) return item.type == 'Bag' and item.craftingLevel ~= nil end)
   end
   end


Line 321: Line 323:


     local matArray = {}
     local matArray = {}
    if craft.craftGPCost ~= nil and craft.craftGPCost > 0 then
    table.insert(matArray, Icons.GP(craft.craftGPCost))
    end
     for j, mat in Shared.skpairs(craft.craftReq) do
     for j, mat in Shared.skpairs(craft.craftReq) do
       local matItem = Items.getItemByID(mat.id)
       local matItem = Items.getItemByID(mat.id)
       table.insert(matArray, Icons.Icon({matItem.name, type='item', notext=true, qty=mat.qty}))
       table.insert(matArray, Icons.Icon({matItem.name, type='item', notext=true, qty=mat.qty}))
     end
     end
     result = result..'\r\n|'..table.concat(matArray, ' ')
     result = result..'\r\n|'..table.concat(matArray, ', ')
   end
   end