892
edits
m (whoops) |
m (changed some item columns) |
||
Line 45: | Line 45: | ||
'SlayerTier', 'SlayerTierName', 'SlayerTierCost', | 'SlayerTier', 'SlayerTierName', 'SlayerTierCost', | ||
'SlayerTierPlayerLevel', 'SlayerTierQtyMin', 'SlayerTierQtyMax', 'SlayerCoinReward', | 'SlayerTierPlayerLevel', 'SlayerTierQtyMin', 'SlayerTierQtyMax', 'SlayerCoinReward', | ||
'ItemsID', 'ItemsWeight', ' | 'ItemsID', 'ItemsWeight', 'ItemsDenominator', 'ItemsNormalised', 'ItemsQtyMin', 'ItemsQtyMax' | ||
} | } | ||
result = result.."!"..table.concat(headers, "!!") | result = result.."!"..table.concat(headers, "!!") | ||
Line 151: | Line 151: | ||
local itemIds = {} | local itemIds = {} | ||
local itemWeights = {} | local itemWeights = {} | ||
local | local itemNormalised = {} | ||
local itemQtyMins = {} | local itemQtyMins = {} | ||
local itemQtyMaxs = {} | local itemQtyMaxs = {} | ||
Line 158: | Line 158: | ||
totalWeight = totalWeight + droppable[2] | totalWeight = totalWeight + droppable[2] | ||
end | end | ||
local itemDenominator = totalWeight * 100 | |||
for _, droppable in pairs(monster.lootTable) do | for _, droppable in pairs(monster.lootTable) do | ||
table.insert(itemIds, droppable[1]) | table.insert(itemIds, droppable[1]) | ||
local numerator = droppable[2]*monster.lootChance | |||
table.insert( | table.insert(itemWeights, numerator) | ||
table.insert(itemNormalised, denominator/numerator) | |||
table.insert(itemQtyMins, 1) | table.insert(itemQtyMins, 1) | ||
table.insert(itemQtyMaxs, droppable[3]) | table.insert(itemQtyMaxs, droppable[3]) | ||
Line 168: | Line 170: | ||
table.insert(rowTxt, table.concat(itemIds, arraySeparatorInSheets)) | table.insert(rowTxt, table.concat(itemIds, arraySeparatorInSheets)) | ||
table.insert(rowTxt, table.concat(itemWeights, arraySeparatorInSheets)) | table.insert(rowTxt, table.concat(itemWeights, arraySeparatorInSheets)) | ||
table.insert(rowTxt, | table.insert(rowTxt, itemDenominator) | ||
table.insert(rowTxt, | table.insert(rowTxt, table.concat(itemNormalised, arraySeparatorInSheets)) | ||
table.insert(rowTxt, table.concat(itemQtyMins, arraySeparatorInSheets)) | table.insert(rowTxt, table.concat(itemQtyMins, arraySeparatorInSheets)) | ||
table.insert(rowTxt, table.concat(itemQtyMaxs, arraySeparatorInSheets)) | table.insert(rowTxt, table.concat(itemQtyMaxs, arraySeparatorInSheets)) |
edits