NxWarehouse.lua
ch["DurPercent"]
ch["DurLowPercent"]
not Work..
Code:
if ch["DurPercent"] then
local strformat = string.format
local mathfloor = math.floor
local GetInventoryItemDurability = GetInventoryItemDurability
local curDur, maxDur = 0,0
for i = 1, 20 do
local curD, maxD = GetInventoryItemDurability(i)
if maxD then
curDur = curDur + curD
maxDur = maxDur + maxD
end
end
local durPercent = strformat("%d", mathfloor((curDur/maxDur)*100))
local col = (ch["DurPercent"] < 50 or ch["DurLowPercent"] < 50) and "|cffff0000" or hicol
list:ItemAdd (cnum)
list:ItemSet (2, format (" Durability: %s%d%%, Min %d%%", col, durPercent, ch["DurLowPercent"]))