bugfix, library change
This commit is contained in:
+58
-58
@@ -73,7 +73,7 @@ local WEAPON = S(
|
|||||||
|
|
||||||
function M.value(slot, quality, level)
|
function M.value(slot, quality, level)
|
||||||
local expectation
|
local expectation
|
||||||
for _, event in temp-distribution(slot, quality, level) do
|
for _, event in distribution(slot, quality, level) do
|
||||||
local value = history.value(event.item_id .. ':' .. 0)
|
local value = history.value(event.item_id .. ':' .. 0)
|
||||||
if not value then
|
if not value then
|
||||||
return
|
return
|
||||||
@@ -99,102 +99,102 @@ function M.distribution(slot, quality, level)
|
|||||||
|
|
||||||
if quality == UNCOMMON then
|
if quality == UNCOMMON then
|
||||||
if level <= 10 then
|
if level <= 10 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 10940, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.8, .2)),
|
temp-O('item_id', 10940, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.8, .2)),
|
||||||
weak-O('item_id', 10938, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .8))
|
temp-O('item_id', 10938, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .8))
|
||||||
)
|
)
|
||||||
elseif level <= 15 then
|
elseif level <= 15 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 10940, 'min_quantity', 2, 'max_quantity', 3, 'probability', p(.75, .2)),
|
temp-O('item_id', 10940, 'min_quantity', 2, 'max_quantity', 3, 'probability', p(.75, .2)),
|
||||||
weak-O('item_id', 10939, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
temp-O('item_id', 10939, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 10978, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
temp-O('item_id', 10978, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
||||||
)
|
)
|
||||||
elseif level <= 20 then
|
elseif level <= 20 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 10940, 'min_quantity', 4, 'max_quantity', 6, 'probability', p(.75, .15)),
|
temp-O('item_id', 10940, 'min_quantity', 4, 'max_quantity', 6, 'probability', p(.75, .15)),
|
||||||
weak-O('item_id', 10998, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.15, .75)),
|
temp-O('item_id', 10998, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.15, .75)),
|
||||||
weak-O('item_id', 10978, 'min_quantity', 1, 'max_quantity', 1, 'probability', .10)
|
temp-O('item_id', 10978, 'min_quantity', 1, 'max_quantity', 1, 'probability', .10)
|
||||||
)
|
)
|
||||||
elseif level <= 25 then
|
elseif level <= 25 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 11083, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.75, .2)),
|
temp-O('item_id', 11083, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.75, .2)),
|
||||||
weak-O('item_id', 11082, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
temp-O('item_id', 11082, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 11084, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
temp-O('item_id', 11084, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
||||||
)
|
)
|
||||||
elseif level <= 30 then
|
elseif level <= 30 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 11083, 'min_quantity', 2, 'max_quantity', 5, 'probability', p(.75, .2)),
|
temp-O('item_id', 11083, 'min_quantity', 2, 'max_quantity', 5, 'probability', p(.75, .2)),
|
||||||
weak-O('item_id', 11134, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
temp-O('item_id', 11134, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 11138, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
temp-O('item_id', 11138, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
||||||
)
|
)
|
||||||
elseif level <= 35 then
|
elseif level <= 35 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 11137, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.75, .2)),
|
temp-O('item_id', 11137, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.75, .2)),
|
||||||
weak-O('item_id', 11135, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
temp-O('item_id', 11135, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 11139, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
temp-O('item_id', 11139, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
||||||
)
|
)
|
||||||
elseif level <= 40 then
|
elseif level <= 40 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 11137, 'min_quantity', 2, 'max_quantity', 5, 'probability', p(.75, .2)),
|
temp-O('item_id', 11137, 'min_quantity', 2, 'max_quantity', 5, 'probability', p(.75, .2)),
|
||||||
weak-O('item_id', 11174, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
temp-O('item_id', 11174, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 11177, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
temp-O('item_id', 11177, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
||||||
)
|
)
|
||||||
elseif level <= 45 then
|
elseif level <= 45 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 11176, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.75, .2)),
|
temp-O('item_id', 11176, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.75, .2)),
|
||||||
weak-O('item_id', 11175, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
temp-O('item_id', 11175, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 11178, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
temp-O('item_id', 11178, 'min_quantity', 1, 'max_quantity', 1, 'probability', .05)
|
||||||
)
|
)
|
||||||
elseif level <= 50 then
|
elseif level <= 50 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 11176, 'min_quantity', 2, 'max_quantity', 5, 'probability', p(.75, .22)),
|
temp-O('item_id', 11176, 'min_quantity', 2, 'max_quantity', 5, 'probability', p(.75, .22)),
|
||||||
weak-O('item_id', 16202, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
temp-O('item_id', 16202, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 14343, 'min_quantity', 1, 'max_quantity', 1, 'probability', p(.05, .03))
|
temp-O('item_id', 14343, 'min_quantity', 1, 'max_quantity', 1, 'probability', p(.05, .03))
|
||||||
)
|
)
|
||||||
elseif level <= 55 then
|
elseif level <= 55 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 16204, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.75, .22)),
|
temp-O('item_id', 16204, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.75, .22)),
|
||||||
weak-O('item_id', 16203, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
temp-O('item_id', 16203, 'min_quantity', 1, 'max_quantity', 2, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 14344, 'min_quantity', 1, 'max_quantity', 1, 'probability', p(.05, .03))
|
temp-O('item_id', 14344, 'min_quantity', 1, 'max_quantity', 1, 'probability', p(.05, .03))
|
||||||
)
|
)
|
||||||
elseif level <= 60 then
|
elseif level <= 60 then
|
||||||
return A(
|
return temp-A(
|
||||||
weak-O('item_id', 16204, 'min_quantity', 2, 'max_quantity', 5, 'probability', p(.75, .22)),
|
temp-O('item_id', 16204, 'min_quantity', 2, 'max_quantity', 5, 'probability', p(.75, .22)),
|
||||||
weak-O('item_id', 16203, 'min_quantity', 2, 'max_quantity', 3, 'probability', p(.2, .75)),
|
temp-O('item_id', 16203, 'min_quantity', 2, 'max_quantity', 3, 'probability', p(.2, .75)),
|
||||||
weak-O('item_id', 14344, 'min_quantity', 1, 'max_quantity', 1, 'probability', p(.05, .03))
|
temp-O('item_id', 14344, 'min_quantity', 1, 'max_quantity', 1, 'probability', p(.05, .03))
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
elseif quality == RARE then
|
elseif quality == RARE then
|
||||||
if level <= 20 then
|
if level <= 20 then
|
||||||
return A(weak-O('item_id', 10978, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
return temp-A(temp-O('item_id', 10978, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
||||||
elseif level <= 25 then
|
elseif level <= 25 then
|
||||||
return A(weak-O('item_id', 11084, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
return temp-A(temp-O('item_id', 11084, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
||||||
elseif level <= 30 then
|
elseif level <= 30 then
|
||||||
return A(weak-O('item_id', 11138, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
return temp-A(temp-O('item_id', 11138, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
||||||
elseif level <= 35 then
|
elseif level <= 35 then
|
||||||
return A(weak-O('item_id', 11139, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
return temp-A(temp-O('item_id', 11139, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
||||||
elseif level <= 40 then
|
elseif level <= 40 then
|
||||||
return A(weak-O('item_id', 11177, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
return temp-A(temp-O('item_id', 11177, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
||||||
elseif level <= 45 then
|
elseif level <= 45 then
|
||||||
return A(weak-O('item_id', 11178, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
return temp-A(temp-O('item_id', 11178, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
||||||
elseif level <= 50 then
|
elseif level <= 50 then
|
||||||
return A(weak-O('item_id', 14343, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
return temp-A(temp-O('item_id', 14343, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
||||||
elseif level <= 55 then
|
elseif level <= 55 then
|
||||||
return A(weak-O('item_id', 14344, 'min_quantity', 1, 'max_quantity', 1, 'probability', .995), weak-O('item_id', 20725, 'min_quantity', 1, 'max_quantity', 1, 'probability', .005))
|
return temp-A(temp-O('item_id', 14344, 'min_quantity', 1, 'max_quantity', 1, 'probability', .995), temp-O('item_id', 20725, 'min_quantity', 1, 'max_quantity', 1, 'probability', .005))
|
||||||
elseif level <= 60 then
|
elseif level <= 60 then
|
||||||
return A(weak-O('item_id', 14344, 'min_quantity', 1, 'max_quantity', 1, 'probability', .995), weak-O('item_id', 20725, 'min_quantity', 1, 'max_quantity', 1, 'probability', .005))
|
return temp-A(temp-O('item_id', 14344, 'min_quantity', 1, 'max_quantity', 1, 'probability', .995), temp-O('item_id', 20725, 'min_quantity', 1, 'max_quantity', 1, 'probability', .005))
|
||||||
end
|
end
|
||||||
elseif quality == EPIC then
|
elseif quality == EPIC then
|
||||||
if level <= 40 then
|
if level <= 40 then
|
||||||
return A(weak-O('item_id', 11177, 'min_quantity', 2, 'max_quantity', 4, 'probability', 1))
|
return temp-A(temp-O('item_id', 11177, 'min_quantity', 2, 'max_quantity', 4, 'probability', 1))
|
||||||
elseif level <= 45 then
|
elseif level <= 45 then
|
||||||
return A(weak-O('item_id', 11178, 'min_quantity', 2, 'max_quantity', 4, 'probability', 1))
|
return temp-A(temp-O('item_id', 11178, 'min_quantity', 2, 'max_quantity', 4, 'probability', 1))
|
||||||
elseif level <= 50 then
|
elseif level <= 50 then
|
||||||
return A(weak-O('item_id', 14343, 'min_quantity', 2, 'max_quantity', 4, 'probability', 1))
|
return temp-A(temp-O('item_id', 14343, 'min_quantity', 2, 'max_quantity', 4, 'probability', 1))
|
||||||
elseif level <= 55 then
|
elseif level <= 55 then
|
||||||
return A(weak-O('item_id', 20725, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
return temp-A(temp-O('item_id', 20725, 'min_quantity', 1, 'max_quantity', 1, 'probability', 1))
|
||||||
elseif level <= 60 then
|
elseif level <= 60 then
|
||||||
return A(weak-O('item_id', 20725, 'min_quantity', 1, 'max_quantity', 2, 'probability', 1))
|
return temp-A(temp-O('item_id', 20725, 'min_quantity', 1, 'max_quantity', 2, 'probability', 1))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return T
|
return T
|
||||||
|
|||||||
+1
-1
@@ -107,7 +107,7 @@ end
|
|||||||
|
|
||||||
function push_record(item_record)
|
function push_record(item_record)
|
||||||
if item_record.daily_min_buyout then
|
if item_record.daily_min_buyout then
|
||||||
tinsert(item_record.data_points, 1, weak-O('value', item_record.daily_min_buyout, 'time', item_record.next_push))
|
tinsert(item_record.data_points, 1, O('value', item_record.daily_min_buyout, 'time', item_record.next_push))
|
||||||
while getn(item_record.data_points) > 11 do
|
while getn(item_record.data_points) > 11 do
|
||||||
release(item_record.data_points[getn(item_record.data_points)])
|
release(item_record.data_points[getn(item_record.data_points)])
|
||||||
tremove(item_record.data_points)
|
tremove(item_record.data_points)
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ function extend_tooltip(tooltip, link, quantity)
|
|||||||
end
|
end
|
||||||
local item_info = temp-info.item(item_id)
|
local item_info = temp-info.item(item_id)
|
||||||
if item_info then
|
if item_info then
|
||||||
local distribution = temp-disenchant.distribution(item_info.slot, item_info.quality, item_info.level)
|
local distribution = disenchant.distribution(item_info.slot, item_info.quality, item_info.level)
|
||||||
if getn(distribution) > 0 then
|
if getn(distribution) > 0 then
|
||||||
if aux_tooltip_disenchant_distribution then
|
if aux_tooltip_disenchant_distribution then
|
||||||
tooltip:AddLine('Disenchants into:', color.tooltip.disenchant.distribution())
|
tooltip:AddLine('Disenchants into:', color.tooltip.disenchant.distribution())
|
||||||
|
|||||||
@@ -584,7 +584,9 @@ local methods = {
|
|||||||
local rt = this:GetParent().row.rt
|
local rt = this:GetParent().row.rt
|
||||||
local rowData = this:GetParent().row.data
|
local rowData = this:GetParent().row.data
|
||||||
if rowData and rowData.record then
|
if rowData and rowData.record then
|
||||||
info.set_tooltip(rowData.record.itemstring, this, 'ANCHOR_RIGHT')
|
GameTooltip:SetOwner(this, 'ANCHOR_RIGHT')
|
||||||
|
info.load_tooltip(GameTooltip, rowData.record.tooltip)
|
||||||
|
GameTooltip:Show()
|
||||||
info.set_shopping_tooltip(rowData.record.slot)
|
info.set_shopping_tooltip(rowData.record.slot)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
+1
-11
@@ -4,12 +4,11 @@ module 'T'
|
|||||||
local next, getn, setn, tremove, setmetatable = next, getn, table.setn, tremove, setmetatable
|
local next, getn, setn, tremove, setmetatable = next, getn, table.setn, tremove, setmetatable
|
||||||
|
|
||||||
local wipe, acquire, release
|
local wipe, acquire, release
|
||||||
local pool, pool_size, overflow_pool, auto_release, dep_release = {}, 0, setmetatable({}, {__mode='k'}), {}, setmetatable({}, {__mode='k'})
|
local pool, pool_size, overflow_pool, auto_release = {}, 0, setmetatable({}, {__mode='k'}), {}
|
||||||
|
|
||||||
function wipe(t)
|
function wipe(t)
|
||||||
setmetatable(t, nil)
|
setmetatable(t, nil)
|
||||||
for k, v in t do
|
for k, v in t do
|
||||||
if dep_release[v] then release(v) end
|
|
||||||
t[k] = nil
|
t[k] = nil
|
||||||
end
|
end
|
||||||
t.reset, t.reset = nil, 1
|
t.reset, t.reset = nil, 1
|
||||||
@@ -39,7 +38,6 @@ M.acquire = acquire
|
|||||||
function release(t)
|
function release(t)
|
||||||
wipe(t)
|
wipe(t)
|
||||||
auto_release[t] = nil
|
auto_release[t] = nil
|
||||||
dep_release[t] = nil
|
|
||||||
if pool_size < 50 then
|
if pool_size < 50 then
|
||||||
pool_size = pool_size + 1
|
pool_size = pool_size + 1
|
||||||
pool[pool_size] = t
|
pool[pool_size] = t
|
||||||
@@ -57,14 +55,6 @@ do
|
|||||||
local function f(_, v) if v then auto_release[v] = nil; return v end end
|
local function f(_, v) if v then auto_release[v] = nil; return v end end
|
||||||
M.static = setmetatable({}, {__metatable=false, __newindex=nop, __call=f, __sub=f})
|
M.static = setmetatable({}, {__metatable=false, __newindex=nop, __call=f, __sub=f})
|
||||||
end
|
end
|
||||||
do
|
|
||||||
local function f(_, v) if v then dep_release[v] = true; return v end end
|
|
||||||
M.weak = setmetatable({}, {__metatable=false, __newindex=nop, __call=f, __sub=f})
|
|
||||||
end
|
|
||||||
do
|
|
||||||
local function f(_, v) if v then dep_release[v] = nil; return v end end
|
|
||||||
M.strong = setmetatable({}, {__metatable=false, __newindex=nop, __call=f, __sub=f})
|
|
||||||
end
|
|
||||||
|
|
||||||
M.get_T = acquire
|
M.get_T = acquire
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -77,7 +77,7 @@ function M.container_item(bag, slot)
|
|||||||
'readable', readable,
|
'readable', readable,
|
||||||
'lootable', lootable,
|
'lootable', lootable,
|
||||||
|
|
||||||
'tooltip', weak-tooltip,
|
'tooltip', tooltip,
|
||||||
'tooltip_money', tooltip_money,
|
'tooltip_money', tooltip_money,
|
||||||
'max_charges', max_charges,
|
'max_charges', max_charges,
|
||||||
'charges', charges,
|
'charges', charges,
|
||||||
@@ -154,7 +154,7 @@ function M.auction(index, query_type)
|
|||||||
'duration', duration,
|
'duration', duration,
|
||||||
'usable', usable,
|
'usable', usable,
|
||||||
|
|
||||||
'tooltip', weak-tooltip,
|
'tooltip', tooltip,
|
||||||
'tooltip_money', tooltip_money,
|
'tooltip_money', tooltip_money,
|
||||||
'max_charges', max_charges,
|
'max_charges', max_charges,
|
||||||
'charges', charges,
|
'charges', charges,
|
||||||
@@ -287,11 +287,11 @@ function M.tooltip(setter, arg1, arg2)
|
|||||||
end
|
end
|
||||||
local tooltip = T
|
local tooltip = T
|
||||||
for i = 1, AuxTooltip:NumLines() do
|
for i = 1, AuxTooltip:NumLines() do
|
||||||
tinsert(tooltip, weak-O(
|
tinsert(tooltip, O(
|
||||||
'left_text', _G['AuxTooltipTextLeft' .. i]:GetText(),
|
'left_text', _G['AuxTooltipTextLeft' .. i]:GetText(),
|
||||||
'left_color', weak-A(_G['AuxTooltipTextLeft' .. i]:GetTextColor()),
|
'left_color', A(_G['AuxTooltipTextLeft' .. i]:GetTextColor()),
|
||||||
'right_text', _G['AuxTooltipTextRight' .. i]:IsVisible() and _G['AuxTooltipTextRight' .. i]:GetText(),
|
'right_text', _G['AuxTooltipTextRight' .. i]:IsVisible() and _G['AuxTooltipTextRight' .. i]:GetText(),
|
||||||
'right_color', weak-A(_G['AuxTooltipTextRight' .. i]:GetTextColor())
|
'right_color', A(_G['AuxTooltipTextRight' .. i]:GetTextColor())
|
||||||
))
|
))
|
||||||
end
|
end
|
||||||
return tooltip, AuxTooltip.money
|
return tooltip, AuxTooltip.money
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ function M.read(schema, str)
|
|||||||
elseif schema == 'number' then
|
elseif schema == 'number' then
|
||||||
return tonumber(str)
|
return tonumber(str)
|
||||||
elseif type(schema) == 'table' and schema[1] == 'list' then
|
elseif type(schema) == 'table' and schema[1] == 'list' then
|
||||||
return weak-read_list(schema, str)
|
return read_list(schema, str)
|
||||||
elseif type(schema) == 'table' and schema[1] == 'tuple' then
|
elseif type(schema) == 'table' and schema[1] == 'tuple' then
|
||||||
return weak-read_tuple(schema, str)
|
return read_tuple(schema, str)
|
||||||
else
|
else
|
||||||
error('Invalid schema.', 2)
|
error('Invalid schema.', 2)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user