| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- --- 打赏返利
- local Util = require("common.Util")
- local ObjHuman = require("core.ObjHuman")
- local RechBackExcel = require("excel.present").rechargeBack
- local Msg = require("core.Msg")
- local Grid = require("bag.Grid")
- local ItemDefine = require("bag.ItemDefine")
- local BuyLogic = require("topup.BuyLogic")
- local BagLogic = require("bag.BagLogic")
- local YunYingLogic = require("yunying.YunYingLogic")
- local PanelDefine = require("broadcast.PanelDefine")
- local YyHandler = require("yunying.Handler")
- local KingWorldLogic = require("present.KingWorldLogic")
- local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
- local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
- function query(human)
- local msgRet = Msg.gc.GC_RECHARGE_BACK_QUERY
- msgRet.recharge = human.db.topupAcount or 0
- msgRet.maxCnt = #RechBackExcel
- msgRet.isEnd = 0
- local len = 0
- local getDb = human.db.rechargeBackGet or {}
- for k, config in ipairs(RechBackExcel) do
- len = len + 1
- local net = msgRet.list[len]
- net.id = k
- net.need = config.need
- net.state = getDb[k] and 2 or 0
- for j, h in ipairs(config.items) do
- Grid.makeItem(net.reward[j], h[1], h[2])
- end
- net.reward[0] = #config.items
- if len >= 10 then
- msgRet.isEnd = 0
- msgRet.list[0] = len
- Msg.send(msgRet, human.fd)
- len = 0
- end
- if k >= 3 and (not human.db.topupAcount or human.db.topupAcount < config.need) then
- break
- end
- end
- msgRet.isEnd = 1
- msgRet.list[0] = len
- Msg.send(msgRet, human.fd)
- end
- function get(human, id)
- local config = RechBackExcel[id]
- if not config then return end
- local rechargeNum = human.db.topupAcount or 0
- if config.need > rechargeNum then
- return
- end
- if human.db.rechargeBackGet and human.db.rechargeBackGet[id] then
- return
- end
-
- human.db.rechargeBackGet = human.db.rechargeBackGet or {}
- human.db.rechargeBackGet[id] = 1
- BagLogic.addItemList(human, config.items, "rechargeBack")
- query(human)
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_108)
- end
- function isDot(human)
- local getDb = human.db.rechargeBackGet or {}
- local rechargeNum = human.db.topupAcount or 0
- for k, config in ipairs(RechBackExcel) do
- if rechargeNum >= config.need and not getDb[k] then
- return true
- elseif rechargeNum < config.need then
- break
- end
- end
- return false
- end
- function isRed(human,YYInfo, funcConfig)
- local getDb = human.db.rechargeBackGet or {}
- local rechargeNum = human.db.topupAcount or 0
- for k, config in ipairs(RechBackExcel) do
- if rechargeNum >= config.need and not getDb[k] then
- return true
- elseif rechargeNum < config.need then
- break
- end
- end
- return false
- end
- function isOpen(human, YYInfo, funcConfig)
- return true
- end
|