Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Added range of prices for chest drop tables, fixed column order
(Added getChestDrops)
(Added range of prices for chest drop tables, fixed column order)
Line 452: Line 452:
     end
     end
     result = result..'\r\n{|class="wikitable sortable"'
     result = result..'\r\n{|class="wikitable sortable"'
     result = result..'\r\n!Item!!Qty!!Price'
     result = result..'\r\n!Item!!Qty'
    result = result..'!!colspan="2"|Chance!!Price'


    result = result..'!!colspan="2"|Chance'
     --Sort the loot table by weight in descending order
     --Sort the loot table by weight in descending order
     table.sort(chest.dropTable, function(a, b) return a[2] > b[2] end)
     table.sort(chest.dropTable, function(a, b) return a[2] > b[2] end)
Line 476: Line 476:


       result = result..'||style="text-align:right" data-sort-value="'..thisItem.sellsFor..'"'
       result = result..'||style="text-align:right" data-sort-value="'..thisItem.sellsFor..'"'
       result = result..'|'..Icons.GP(thisItem.sellsFor)
       if qty > 1 then
        result = result..'|'..Icons.GP(thisItem.sellsFor, thisItem.sellsFor * qty)
      else
        result = result..'|'..Icons.GP(thisItem.sellsFor)
      end
     end
     end
     result = result..'\r\n|}'
     result = result..'\r\n|}'