4,951
edits
Falterfire (talk | contribs) (Removed fraction columns when it will be 1/1, added average value including GP) |
Falterfire (talk | contribs) (Moved Price column to the left of fhance) |
||
Line 416: | Line 416: | ||
end | end | ||
result = result..Shared.formatnum(row[3]) | result = result..Shared.formatnum(row[3]) | ||
--Adding price columns | |||
local itemPrice = thisItem.sellsFor ~= nil and thisItem.sellsFor or 0 | |||
if itemPrice == 0 or maxQty == 1 then | |||
result = result..'||'..Icons.GP(itemPrice) | |||
else | |||
result = result..'||'..Icons.GP(itemPrice, itemPrice * maxQty) | |||
end | |||
--Getting the drop chance | --Getting the drop chance | ||
Line 429: | Line 437: | ||
result = result..'style="text-align:right"|'..Shared.round(dropChance, 2, 2)..'%' | result = result..'style="text-align:right"|'..Shared.round(dropChance, 2, 2)..'%' | ||
--Adding price | --Adding to the average loot value based on price & dropchance | ||
lootValue = lootValue + (dropChance * 0.01 * itemPrice * ((1 + maxQty) / 2)) | |||
end | end | ||
if multiDrop then | if multiDrop then | ||
result = result..'\r\n|-class="sortbottom" \r\n!colspan=" | result = result..'\r\n|-class="sortbottom" \r\n!colspan="3"|Total:' | ||
if lootChance < 100 then | if lootChance < 100 then | ||
result = result..'\r\n|style="text-align:right"|'..Shared.fraction(lootChance, 100)..'||' | result = result..'\r\n|style="text-align:right"|'..Shared.fraction(lootChance, 100)..'||' | ||
Line 447: | Line 448: | ||
end | end | ||
result = result..'style="text-align:right"|'..lootChance..'.00%' | result = result..'style="text-align:right"|'..lootChance..'.00%' | ||
end | end | ||
result = result..'\r\n|}' | result = result..'\r\n|}' | ||
result = result..'\r\nThe loot dropped by the average kill is worth '..Icons.GP(Shared.round(lootValue, 2, 0)).." if sold" | result = result..'\r\nThe loot dropped by the average kill is worth '..Icons.GP(Shared.round(lootValue, 2, 0)).." if sold" | ||
result = result..'<br/>Including | result = result..'<br/>Including GP, the average kill is worth '..Icons.GP(Shared.round(avgGp + lootValue, 2, 0)) | ||
end | end | ||