|
|
@@ -129,18 +129,33 @@ end
|
|
|
|
|
|
-- 获取奖励
|
|
|
function getReward(human, id)
|
|
|
- local status = getStatus(human, id)
|
|
|
- if status ~= STATUS_CANGET then
|
|
|
- return
|
|
|
+ -- local status = getStatus(human, id)
|
|
|
+ -- if status ~= STATUS_CANGET then
|
|
|
+ -- return
|
|
|
+ -- end
|
|
|
+
|
|
|
+ -- local config = OnlineRewardExcel.onlineReward[id]
|
|
|
+ -- human.db.onlineReward.getId[id] = 1
|
|
|
+ -- -- 增加物品
|
|
|
+ -- BagLogic.cleanMomentItemList()
|
|
|
+ -- BagLogic.updateMomentItem(1, config.itemID, config.itemCnt)
|
|
|
+ -- BagLogic.addMomentItemList(human, "online_reward")
|
|
|
+ -- sendOnlineReward(human)
|
|
|
+
|
|
|
+ -- 改为一键领取
|
|
|
+ local itemList = {}
|
|
|
+ for k, v in ipairs(OnlineRewardExcel.onlineReward) do
|
|
|
+ local status = getStatus(human, k)
|
|
|
+ if status == STATUS_CANGET then
|
|
|
+ human.db.onlineReward.getId[k] = 1
|
|
|
+ itemList[v.itemID] = (itemList[v.itemID] or 0) + v.itemCnt
|
|
|
+ end
|
|
|
end
|
|
|
|
|
|
- local config = OnlineRewardExcel.onlineReward[id]
|
|
|
- human.db.onlineReward.getId[id] = 1
|
|
|
- -- 增加物品
|
|
|
- BagLogic.cleanMomentItemList()
|
|
|
- BagLogic.updateMomentItem(1, config.itemID, config.itemCnt)
|
|
|
- BagLogic.addMomentItemList(human, "online_reward")
|
|
|
- sendOnlineReward(human)
|
|
|
+ if next(itemList) then
|
|
|
+ BagLogic.addItemList(human, itemList, "online_reward")
|
|
|
+ sendOnlineReward(human)
|
|
|
+ end
|
|
|
end
|
|
|
|
|
|
function isDot(human)
|