|
|
@@ -381,23 +381,23 @@ function mangHeGift(human, id, buyConf, isFirst, cnt, buyNum)
|
|
|
AbsActLogic.checkAbsActClean(human, id)
|
|
|
local config = AbsActExcel.mangHeGift[1]
|
|
|
local buyCnt = human.db.absAct[id].buyCnt and human.db.absAct[id].buyCnt or 0
|
|
|
- if config.cnt <= buyCnt then
|
|
|
- return
|
|
|
- end
|
|
|
-
|
|
|
- -- if buyCnt + buyNum >= config.cnt then
|
|
|
- -- return
|
|
|
+ -- if config.cnt <= buyCnt then
|
|
|
+ -- return
|
|
|
-- end
|
|
|
+
|
|
|
+ if buyCnt + buyNum > config.cnt then
|
|
|
+ return Broadcast.sendErr(human, Lang.COPY_BUY_CNT_ERR_CNT)
|
|
|
+ end
|
|
|
|
|
|
- -- human.db.absAct[id].buyCnt = buyCnt + buyNum
|
|
|
- -- local tItemList = {}
|
|
|
- -- for index, v in ipairs(config.reward) do
|
|
|
- -- table.insert(tItemList, {v[1], v[2]*buyNum})
|
|
|
- -- end
|
|
|
- -- BagLogic.addItemList(human, tItemList, "abs_manghe")
|
|
|
+ human.db.absAct[id].buyCnt = buyCnt + buyNum
|
|
|
+ local tItemList = {}
|
|
|
+ for index, v in ipairs(config.reward) do
|
|
|
+ table.insert(tItemList, {v[1], v[2]*buyNum})
|
|
|
+ end
|
|
|
+ BagLogic.addItemList(human, tItemList, "abs_manghe")
|
|
|
|
|
|
- human.db.absAct[id].buyCnt = buyCnt + 1
|
|
|
- BagLogic.addItemList(human, config.reward, "abs_manghe")
|
|
|
+ -- human.db.absAct[id].buyCnt = buyCnt + 1
|
|
|
+ -- BagLogic.addItemList(human, config.reward, "abs_manghe")
|
|
|
query(human, id)
|
|
|
end
|
|
|
|
|
|
@@ -513,13 +513,13 @@ function isOpen(human, YYInfo, funcConfig)
|
|
|
return AbsActLogic.isStarted(human, funcConfig.funcID)
|
|
|
end
|
|
|
|
|
|
--- function GetRemainNum(human, nBuyID)
|
|
|
--- local config = AbsActExcel.mangHeGift[1]
|
|
|
--- if config.buyID ~= nBuyID then
|
|
|
--- return 0
|
|
|
--- end
|
|
|
+function GetRemainNum(human, nBuyID)
|
|
|
+ local config = AbsActExcel.mangHeGift[1]
|
|
|
+ if config.buyID ~= nBuyID then
|
|
|
+ return 0
|
|
|
+ end
|
|
|
|
|
|
--- AbsActLogic.checkAbsActClean(human, MANGHE_ABS_ID)
|
|
|
--- local buyCnt = human.db.absAct[MANGHE_ABS_ID].buyCnt and human.db.absAct[MANGHE_ABS_ID].buyCnt or 0
|
|
|
--- return buyCnt < config.cnt and (config.cnt - buyCnt) or 0
|
|
|
--- end
|
|
|
+ AbsActLogic.checkAbsActClean(human, MANGHE_ABS_ID)
|
|
|
+ local buyCnt = human.db.absAct[MANGHE_ABS_ID].buyCnt and human.db.absAct[MANGHE_ABS_ID].buyCnt or 0
|
|
|
+ return buyCnt < config.cnt and (config.cnt - buyCnt) or 0
|
|
|
+end
|