17,101
edits
mNo edit summary |
(_getDigSiteArtefactValue: Amend calculation of +1 and double consumable bonus GP values) |
||
Line 107: | Line 107: | ||
table.insert(result, 'style="text-align:right"|'..string.format(fmt, dropChance * 100)..'%') | table.insert(result, 'style="text-align:right"|'..string.format(fmt, dropChance * 100)..'%') | ||
-- Setting average gp values with various parameters | -- Setting average gp values with various parameters | ||
local artefactAvgValue = dropChance * thisItem.sellsFor * ((row.minQuantity + row.maxQuantity) / 2) | |||
plusOneMinimumRefinementValue = plusOneMinimumRefinementValue + (dropChance * thisItem.sellsFor | lootValue = lootValue + artefactAvgValue | ||
plusOneMinimumRefinementValue = plusOneMinimumRefinementValue + (dropChance * thisItem.sellsFor) | |||
-- Checking if item is a consumable, then adding its value a second time | -- Checking if item is a consumable, then adding its value a second time | ||
if Items._canItemUseSlot(thisItem, 'Consumable') | if Items._canItemUseSlot(thisItem, 'Consumable') then | ||
doubleConsumableRefinementValue = | doubleConsumableRefinementValue = doubleConsumableRefinementValue + artefactAvgValue | ||
end | end | ||
end | end | ||
Line 117: | Line 118: | ||
table.insert(result, '\r\n|}') | table.insert(result, '\r\n|}') | ||
table.insert(result, '\r\nThe average value of one action is '..Icons.GP(Shared.round(lootValue, 2, 0))..'.') | table.insert(result, '\r\nThe average value of one action is '..Icons.GP(Shared.round(lootValue, 2, 0))..'.') | ||
table.insert(result, '\r\n\nThe average value of one action with the +1 Minimum Items refinement is '..Icons.GP(Shared.round(plusOneMinimumRefinementValue, 2, 0))..'.') | table.insert(result, '\r\n\r\nThe average value of one action with the +1 Minimum Items refinement is '..Icons.GP(Shared.round(lootValue + plusOneMinimumRefinementValue, 2, 0))..'.') | ||
if doubleConsumableRefinementValue > | if doubleConsumableRefinementValue > 0 then | ||
table.insert(result, '\r\n\nThe average value of one action with the x2 Consumables refinement is '..Icons.GP(Shared.round(doubleConsumableRefinementValue, 2, 0))..'.') | table.insert(result, '\r\n\r\nThe average value of one action with the x2 Consumables refinement is '..Icons.GP(Shared.round(lootValue + doubleConsumableRefinementValue, 2, 0))..'.') | ||
end | end | ||