4,951
edits
Falterfire (talk | contribs) (Added Chest EV) |
Falterfire (talk | contribs) (Removed fraction columns when it will be 1/1, added average value including GP) |
||
Line 383: | Line 383: | ||
result = result.."'''Loot:'''" | result = result.."'''Loot:'''" | ||
local avgGp = 0 | |||
if monster.dropCoins ~= nil then | if monster.dropCoins ~= nil then | ||
avgGp = (monster.dropCoins[1] + monster.dropCoins[2]) / 2 | |||
local gpTxt = Icons.GP(monster.dropCoins[1], monster.dropCoins[2]) | local gpTxt = Icons.GP(monster.dropCoins[1], monster.dropCoins[2]) | ||
if lootChance == 100 then | if lootChance == 100 then | ||
Line 417: | Line 419: | ||
--Getting the drop chance | --Getting the drop chance | ||
local dropChance = (row[2] / totalWt * lootChance) | local dropChance = (row[2] / totalWt * lootChance) | ||
result = result..'||style="text-align:right" data-sort-value="'..row[2]..'"' | if dropChance ~= 100 then | ||
--Show fraction as long as it isn't going to be 1/1 | |||
result = result..'||style="text-align:right"|'..Shared.round(dropChance, 2, 2)..'%' | result = result..'||style="text-align:right" data-sort-value="'..row[2]..'"' | ||
result = result..'|'..Shared.fraction(row[2] * lootChance, totalWt * 100) | |||
result = result..'||' | |||
else | |||
result = result..'||colspan="2" data-sort-value="'..row[2]..'"' | |||
end | |||
result = result..'style="text-align:right"|'..Shared.round(dropChance, 2, 2)..'%' | |||
--Adding price columns | --Adding price columns | ||
Line 442: | Line 450: | ||
end | end | ||
result = result..'\r\n|}' | result = result..'\r\n|}' | ||
result = result..'\r\nThe loot | 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 the GP, the average kill is worth '..Icons.GP(Shared.round(avgGp + lootValue, 2, 0)) | |||
end | end | ||