You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
854 B
Lua
39 lines
854 B
Lua
local blackmarketconf = require "blackmarketconf"
|
|
local blackmarketrefreshconf = require "blackmarketrefreshconf"
|
|
local M = {}
|
|
|
|
|
|
function M.getconf()
|
|
return blackmarketconf
|
|
end
|
|
|
|
function M.getconfbyid(id)
|
|
return blackmarketconf[tostring(id)]
|
|
end
|
|
|
|
function M.randomdiscount()
|
|
local t = {}
|
|
for k,v in pairs(blackmarketconf) do
|
|
local pools = {}
|
|
local discount = v.discount
|
|
for _, v1 in ipairs(discount) do
|
|
for i=1, v1.value do
|
|
table.insert(pools, v1.key)
|
|
end
|
|
end
|
|
for i=1,7 do
|
|
pools = table.shuffle(pools)
|
|
end
|
|
local r = math.random(1, #pools)
|
|
local rew = pools[r]
|
|
t[k] = rew
|
|
end
|
|
return t
|
|
end
|
|
|
|
|
|
function M.getrefreshspeed(num)
|
|
return blackmarketrefreshconf[tostring(checkint(num))].gold
|
|
end
|
|
|
|
return M |