SCFC 8 месяцев назад
Родитель
Сommit
804ed63b49

+ 4 - 0
script/common/LogDefine.lua

@@ -260,6 +260,10 @@ DEFINE = {
 	BusOneBuy				= 264,			 -- 新商业活动1-超值大礼
 	BusOneYuanZheng			= 265,			 -- 新商业活动1-远征豪礼
 	BusOneHeroYuanZheng		= 266,			 -- 新商业活动1-英雄远征
+	BusThreeTask			= 267,			 -- 新商业活动3-任务
+	BusThreeGrandGift		= 268,			 -- 新商业活动3-超值豪礼
+	BusThreeActDice			= 269,			 -- 新商业活动3-掷骰子
+	BusThreeDiscountStore	= 270,			 -- 新商业活动3-特价商店
 
 	abs_totalReach          = 500,           -- 周期性活动累计
     abs_singleReach         = 501,           -- 周期性活动单次

+ 14 - 14
script/common/ProtoID.lua

@@ -1584,20 +1584,20 @@ _ENV[1627]="GC_CYCLMAKEFOOD_QUERY"
 _ENV[1628]="CG_CYCLMAKEFOOD_MAKEFOOD"
 _ENV[1629]="GC_CYCLMAKEFOOD_MAKEFOOD"
 
--- _ENV[1630]="CG_NEW_BUSTHREEACT_TASKQUERY"
--- _ENV[1631]="GC_NEW_BUSTHREEACT_TASKQUERY"
--- _ENV[1632]="CG_NEW_BUSTHREEACT_GETTASKPRIZE"
--- _ENV[1633]="CG_NEW_BUSTHREEACT_TASKPOINTQUERY"
--- _ENV[1634]="GC_NEW_BUSTHREEACT_TASKPOINTQUERY"
--- _ENV[1635]="CG_NEW_BUSTHREEACT_GETTASKPOINTPRIZE"
--- _ENV[1636]="GC_NEW_BUSTHREEACT_DISQUERY"
--- _ENV[1637]="GC_NEW_BUSTHREEACT_DISQUERY"
--- _ENV[1638]="CG_NEW_BUSTHREEACT_DISBUY"
--- _ENV[1639]="CG_NEW_BUSTHREEACT_GRANDGIFT_QUERY"
--- _ENV[1640]="GC_NEW_BUSTHREEACT_GRANDGIFT_QUERY"
--- _ENV[1641]="CG_NEW_BUSTHREEACT_GRANDGIFT_GET"
--- _ENV[1642]="CG_NEW_BUSTHREEACT_DICEDO"
--- _ENV[1643]="GC_NEW_BUSTHREEACT_DICEDO"
+_ENV[1630]="CG_NEW_BUSTHREEACT_TASKQUERY"
+_ENV[1631]="GC_NEW_BUSTHREEACT_TASKQUERY"
+_ENV[1632]="CG_NEW_BUSTHREEACT_GETTASKPRIZE"
+_ENV[1633]="CG_NEW_BUSTHREEACT_TASKPOINTQUERY"
+_ENV[1634]="GC_NEW_BUSTHREEACT_TASKPOINTQUERY"
+_ENV[1635]="CG_NEW_BUSTHREEACT_GETTASKPOINTPRIZE"
+_ENV[1636]="CG_NEW_BUSTHREEACT_DISQUERY"
+_ENV[1637]="GC_NEW_BUSTHREEACT_DISQUERY"
+_ENV[1638]="CG_NEW_BUSTHREEACT_DISBUY"
+_ENV[1639]="CG_NEW_BUSTHREEACT_GRANDGIFT_QUERY"
+_ENV[1640]="GC_NEW_BUSTHREEACT_GRANDGIFT_QUERY"
+_ENV[1641]="CG_NEW_BUSTHREEACT_GRANDGIFT_GET"
+_ENV[1642]="CG_NEW_BUSTHREEACT_DICEDO"
+_ENV[1643]="GC_NEW_BUSTHREEACT_DICEDO"
 
 _ENV[1644]="CG_SHOP_CHOSE_ITEM"
 _ENV[1645]="CG_BUY_LIFTTIME_CARD"

+ 188 - 0
script/module/absAct/BusThreeActDice.lua

@@ -0,0 +1,188 @@
+--------------------------------
+-- 文件名       :   BusThreeActDice.lua
+-- 文件说明     :   新商业活动3-天选骰子
+-- 创建时间     :   2025/09/02
+-- 创建人       :   FC
+--------------------------------
+
+
+local tDiceConf = require("excel.BusThreeActivity").Dice
+local Util = require("common.Util")
+local Msg = require("core.Msg")
+local Grid = require("bag.Grid")
+local BagLogic = require("bag.BagLogic")
+local CommonDefine = require("common.CommonDefine")
+local AbsActLogic = require("absAct.AbsActLogic")
+local BuyLogic = require("topup.BuyLogic")
+local YunYingLogic = require("yunying.YunYingLogic")
+local BusActGrandGift = require("absAct.BusThreeActGrandGift")
+
+local BUSTHREEDICEABSID = 7404        -- 对应ABS活动ID
+-- 骰子类型
+local BUSDICE_TYPE_1 = 1              -- 数字全相同
+local BUSDICE_TYPE_2 = 2              -- 数字连续
+local BUSDICE_TYPE_3 = 3              -- 任意2个数字相同
+local BUSDICE_TYPE_4 = 4              -- 剩余情况
+
+local BUSDICE_GOODID = 1041          -- 物品ID
+
+local typeFuncMap = nil
+
+----------------------------------------- 内部处理开始 -------------------------------------
+local function BusThreeActDice_InitTypeFuncMap()
+    typeFuncMap = {
+        [BUSDICE_TYPE_1] = function (nPoint)
+            return nPoint.."|"..nPoint.."|"..nPoint
+        end,
+        [BUSDICE_TYPE_2] = function (nPoint)
+            local nRandNum = math.random(1, 6)
+            if nRandNum == 1 then
+                return nRandNum.."|"..(nRandNum+1).."|"..(nRandNum+2)
+            elseif nRandNum == 6 then
+                return (nRandNum-2).."|"..(nRandNum-1).."|"..nRandNum
+            else
+               return (nRandNum-1).."|"..nRandNum.."|"..(nRandNum+1)
+            end
+        end,
+        [BUSDICE_TYPE_3] = function (nPoint)
+            local nRandNum = math.random(1, 6)
+            local nOtherNum = nRandNum
+            local nDoLen = 0
+            while nOtherNum == nRandNum do
+                nOtherNum = math.random(1, 6)
+                nDoLen = nDoLen + 1
+                if nDoLen > 10 then
+                    break
+                end
+            end
+
+            if nRandNum == nOtherNum then
+                local nDifNum = math.random(1, 2)
+                nOtherNum = nDifNum == 1 and nRandNum - 1 or nRandNum + 1
+            end
+
+            local tPoint = {nRandNum, nRandNum, nOtherNum}
+            table.sort(tPoint)
+            return table.concat(tPoint, "|")
+        end,
+        [BUSDICE_TYPE_4] = function (nPoint)
+            local tPoint = {}
+            while #tPoint < 3 do
+                local nRandNum = math.random(1, 6)
+                local bExist = false
+                for _, v in ipairs(tPoint) do
+                    if v == nRandNum then
+                        bExist = true
+                        break
+                    end
+                end
+
+                if not bExist then
+                    table.insert(tPoint, nRandNum)
+                end
+            end
+
+            table.sort(tPoint)
+            return table.concat(tPoint, "|")
+        end,
+    }
+end
+
+-- 根据类型获取对应的随机点数
+local function BusThreeGrandGift_GetPoint(nType, nAppointPoint)
+    if not typeFuncMap then
+        BusThreeActDice_InitTypeFuncMap()
+    end
+
+    if not typeFuncMap or not typeFuncMap[nType] then
+        return false, nil
+    end
+
+    local func = typeFuncMap[nType]
+    return true, func(nAppointPoint)
+end
+
+local function BusThreeActDice_DiceDo(human, tMsgData, nNum)
+    local nAllWeight = 0
+    local tPrizeData = {}
+    for _, v in ipairs(tDiceConf) do
+        nAllWeight = nAllWeight + v.nWeight
+        table.insert(tPrizeData, {nWeight = nAllWeight, tPrize = v.Prize, nType = v.nType, nPoint = v.nPoint})
+    end
+
+    
+    local tItemList  = {}
+    tMsgData.tPrize[0] = nNum
+    for i = 1, nNum, 1 do
+        local tOneDiceData = tMsgData.tPrize[i]
+        local nRandWeight = math.random(1, nAllWeight)
+        local tChoseData = nil
+        for _, v in ipairs(tPrizeData) do
+            if nRandWeight <= v.nWeight then
+                tChoseData = v
+                break
+            end
+        end
+
+        if not tChoseData then
+            return false
+        end
+
+        local bRet = false
+        bRet, tOneDiceData.tPoint = BusThreeGrandGift_GetPoint(tChoseData.nType, tChoseData.nPoint)
+        if false == bRet then
+            print("[BusThreeActDice_DiceDo] 获取点数失败")
+            return false
+        end
+
+        tOneDiceData.titemData[0] = #tChoseData.tPrize
+        for j, v in ipairs(tChoseData.tPrize) do
+            Grid.makeItem(tOneDiceData.titemData[j], v[1], v[2])
+            if not tItemList[v[1]] then
+                tItemList[v[1]] = 0
+            end
+
+            tItemList[v[1]] = tItemList[v[1]] + v[2]
+        end
+
+        print("[BusThreeActDice_DiceDo] 第"..i.."次掷骰子结果: "..tOneDiceData.tPoint)
+    end
+
+    for nGoodID, nGoodNum in pairs(tItemList) do
+        BagLogic.addItem(human, nGoodID, nGoodNum, "BusThreeActDice")
+    end
+
+    return true
+end
+
+
+----------------------------------------- 客户端请求 -------------------------------------
+function BusThreeActDice_DO(human, nNum)
+    if 1 ~= nNum and 10 ~= nNum then
+        return
+    end
+
+    print("[BusThreeActDice_DO] 进行抽取 nNum = "..nNum)
+
+    local nGoodsNum = BagLogic.getItemCnt(human, BUSDICE_GOODID)
+    if nGoodsNum < nNum then
+        return
+    end
+
+    print("[BusThreeActDice_DO] 物品数量足够 nGoodsNum = "..nGoodsNum)
+
+    local tMsgData = Msg.gc.GC_NEW_BUSTHREEACT_DICEDO
+    local bRet = BusThreeActDice_DiceDo(human, tMsgData, nNum)
+    if not bRet then
+        print("[BusThreeActDice_DO] 进行抽取报错")
+        return
+    end
+
+    BagLogic.delItem(human, BUSDICE_GOODID, nNum, "BusThreeActDice")
+
+    BusActGrandGift.BusThreeGrandGift_NumChange(human, nNum)
+    print("[BusThreeActDice_DO] 物品扣除完成 nGoodsNum = "..nNum)
+    Msg.send(tMsgData, human.fd)
+    print("[BusThreeActDice_DO] 发送协议完成")
+end
+

+ 146 - 0
script/module/absAct/BusThreeActDiscountStore.lua

@@ -0,0 +1,146 @@
+--新商业化活动3—天选兑换
+--db
+--[=[
+    human.db.absAct[id] = {
+        buyRecord = {
+            [1] = 2, --key是道具在配置中的id, value是已经购买次数
+            [2] = 1,
+        }
+    }
+]=]--
+
+local Msg = require("core.Msg")
+local Grid = require("bag.Grid")
+local BagLogic = require("bag.BagLogic")
+local AbsActLogic = require("absAct.AbsActLogic")
+local Broadcast = require("broadcast.Broadcast")
+local Lang = require("common.Lang")
+local Config = require("excel.BusThreeActivity").DiscountStore
+
+local LOGTAG = "BusThreeDiscountStore" --日志标识
+
+local BUSTHREDISCOUNTSTOREABSID = 7403        -- 对应ABS活动ID
+
+local function CreateDB(human)
+    if not human.db.absAct[BUSTHREDISCOUNTSTOREABSID] then
+        human.db.absAct[BUSTHREDISCOUNTSTOREABSID] = {}
+    end
+
+    if not human.db.absAct[BUSTHREDISCOUNTSTOREABSID].buyRecord then
+        human.db.absAct[BUSTHREDISCOUNTSTOREABSID].buyRecord = {}
+    end
+
+    for index, v in ipairs(Config) do
+        human.db.absAct[BUSTHREDISCOUNTSTOREABSID].buyRecord[index] = 0
+    end
+end
+
+local function CheckAndCreateDB(human)
+    if not human.db.absAct[BUSTHREDISCOUNTSTOREABSID] or not human.db.absAct[BUSTHREDISCOUNTSTOREABSID].buyRecord then
+        CreateDB(human)
+    end
+end
+
+function isOpen(human, YYInfo, funcConfig)
+    local state, endTime, startTime = AbsActLogic.isStarted(human, funcConfig.funcID and funcConfig.funcID or BUSTHREDISCOUNTSTOREABSID)
+
+    return state, endTime, startTime
+end
+
+function isActive(human, YYInfo, funcConfig)
+    local state = isOpen(human, YYInfo, funcConfig)
+    return not state
+end
+
+-- function isRed(human, YYInfo, absActConfig)
+--     local state = AbsActLogic.isStarted(human, BUSTHREDISCOUNTSTOREABSID)
+--     if not state  then
+--         return false
+--     end
+
+--     CheckAndCreateDB(human)
+
+--     for nID, v in ipairs(Config) do
+        
+--         return true
+--     end
+
+--     return false
+-- end
+
+
+--查询
+function Query(human, id, isBuy)
+    CheckAndCreateDB(human)
+
+    local state = AbsActLogic.isStarted(human, BUSTHREDISCOUNTSTOREABSID)
+    if not state then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    local actData = human.db.absAct[BUSTHREDISCOUNTSTOREABSID]
+    if not actData then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    local buyRecord = actData.buyRecord
+    local msgRet = Msg.gc.GC_NEW_BUSTHREEACT_DISQUERY
+
+    local itemVec = msgRet.titemData
+    itemVec[0] = #Config
+
+    for k,v in ipairs(Config) do
+        local singleItem = itemVec[k]
+        singleItem.idx = k
+        singleItem.maxBuyCnt = v.maxBuyCnt
+        singleItem.nowBuyCnt = buyRecord and buyRecord[k] or 0
+        Grid.makeItem(singleItem.item, v.item[1], v.item[2])
+        Grid.makeItem(singleItem.currencyInfo, v.currencyInfo[1], v.currencyInfo[2])
+    end
+
+    Msg.send(msgRet, human.fd)
+end
+
+--购买商品
+function BuyItem(human, id, itemIdx, buyCnt)
+    local state = AbsActLogic.isStarted(human, id)
+    if not state then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    local actData = human.db.absAct[BUSTHREDISCOUNTSTOREABSID]
+    if not actData then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    local itemCfg = Config[itemIdx]
+    if not itemCfg or buyCnt <= 0 then
+        return Broadcast.sendErr(human, Lang.COMMON_ARGUMENT_ERROR)
+    end
+
+    local buyRecord = actData.buyRecord
+    if buyRecord and buyRecord[itemIdx] then
+        if buyRecord[itemIdx] + buyCnt > itemCfg.maxBuyCnt then
+            return Broadcast.sendErr(human, Lang.COMMON_BUY_NUM_NOT_ENOUGH)
+        end
+    end
+
+    local currencyInfo = itemCfg.currencyInfo
+    local cnt = currencyInfo[2] * buyCnt
+    if BagLogic.getItemCnt(human, currencyInfo[1]) < cnt then
+        return Broadcast.sendErr(human, Lang.COMMON_ITEM_NOT_ENOUGH)
+    end
+    BagLogic.delItem(human, currencyInfo[1], cnt, LOGTAG)
+
+    --更新数据
+    buyRecord = buyRecord or {}
+    buyRecord[itemIdx] = (buyRecord[itemIdx] or 0) + buyCnt
+    actData.buyRecord = buyRecord
+
+    --发放奖励
+    local itemInfo = itemCfg.item
+    BagLogic.addItemList(human, {{itemInfo[1], itemInfo[2] * buyCnt}}, LOGTAG)
+
+    --下发数据
+    Query(human, id, true)
+end

+ 272 - 0
script/module/absAct/BusThreeActGrandGift.lua

@@ -0,0 +1,272 @@
+--------------------------------
+-- 文件名       :   BusThreeActGrandGift.lua
+-- 文件说明     :   新商业活动3-天选豪礼
+-- 创建时间     :   2025/09/01
+-- 创建人       :   FC
+--------------------------------
+
+local tGrandGiftConf = require("excel.BusThreeActivity").GrandGift
+local Util = require("common.Util")
+local Msg = require("core.Msg")
+local Grid = require("bag.Grid")
+local BagLogic = require("bag.BagLogic")
+local CommonDefine = require("common.CommonDefine")
+local AbsActLogic = require("absAct.AbsActLogic")
+local BuyLogic = require("topup.BuyLogic")
+local YunYingLogic = require("yunying.YunYingLogic")
+local BusThreeActivityTask = require("absAct.BusThreeActTask")
+
+
+local BUSTHREEGRANDGIFTABSID = 7402        -- 对应ABS活动ID
+
+local BUSTHREEGRANDGIFT_PAY_NOGET = 0     -- 不可领取
+local BUSTHREEGRANDGIFT_PAY_BUY = 1       -- 已购买
+local BUSTHREEGRANDGIFT_PAY_HUOYUE = 2    -- 活跃度到达要求
+local BUSTHREEGRANDGIFT_PAY_CANGET = 3    -- 可以领取
+local BUSTHREEGRANDGIFT_PAY_GET = 4       -- 已领取
+
+----------------------------------------- 内部处理开始 -------------------------------------
+-- 创建DB
+local function BusThreeGrandGift_CreatDB(human)
+    if not human.db.absAct[BUSTHREEGRANDGIFTABSID] then
+        human.db.absAct[BUSTHREEGRANDGIFTABSID] = {}
+    end
+
+    human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo = {
+        nNum = 0,
+        tStatus = {}
+    }
+
+    local tStatus = human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo.tStatus
+    for nID, v in ipairs(tGrandGiftConf) do
+        tStatus[nID] = {
+            nFreeStatus = CommonDefine.COMMON_PRIZE_STATE_NOGET,
+            nPayStatus = BUSTHREEGRANDGIFT_PAY_NOGET
+        }
+    end
+end
+
+-- 重置DB
+local function BusThreeGrandGift_CheckAndResetDB(human)
+    if not human.db.absAct[BUSTHREEGRANDGIFTABSID] or nil == _G.next(human.db.absAct[BUSTHREEGRANDGIFTABSID]) 
+        or not human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo then
+        BusThreeGrandGift_CreatDB(human)
+    end
+end
+
+-- 获取当前远征次数
+local function BusThreeGrandGift_GetBuyNum(human)
+    return human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo.nNum
+end
+
+-- 设置购买次数
+local function BusThreeGrandGift_SetBuyNum(human, nAddNum)
+    human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo.nNum = human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo.nNum + nAddNum
+end
+
+-- 获取当前免费奖励状态
+local function BusThreeGrandGift_GetFreeStatus(human, nID)
+    return human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo.tStatus[nID].nFreeStatus
+end
+
+-- 设置免费奖励状态
+local function BusThreeGrandGift_SetFreeStatus(human, nID, nValue)
+    human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo.tStatus[nID].nFreeStatus = nValue
+end
+
+-- 获取当前付费奖励状态
+local function BusThreeGrandGift_GetPayStatus(human, nID)
+    return human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo.tStatus[nID].nPayStatus
+end
+
+-- 设置付费奖励状态
+local function BusThreeGrandGift_SetPayStatus(human, nID, nValue)
+    human.db.absAct[BUSTHREEGRANDGIFTABSID].tGiftInfo.tStatus[nID].nPayStatus = nValue
+end
+
+-----------------------------------客户端请求-----------------------------
+function BusThreeGrandGift_Query(human)
+    BusThreeGrandGift_CheckAndResetDB(human)
+
+    local tMsgData = Msg.gc.GC_NEW_BUSTHREEACT_GRANDGIFT_QUERY
+    tMsgData.tList[0] = 0
+    for nID, v in ipairs(tGrandGiftConf) do
+        tMsgData.tList[0] = tMsgData.tList[0] + 1
+        local tData = tMsgData.tList[tMsgData.tList[0]]
+        tData.nID = nID
+        tData.nFreeStatus = BusThreeGrandGift_GetFreeStatus(human, nID)
+        local nPayStatus = BusThreeGrandGift_GetPayStatus(human, nID)
+        tData.nPayStatus = CommonDefine.COMMON_PRIZE_STATE_NOGET
+        tData.bBuy = 0
+        if nPayStatus == BUSTHREEGRANDGIFT_PAY_CANGET then
+            tData.nPayStatus = CommonDefine.COMMON_PRIZE_STATE_CANGET
+        elseif BUSTHREEGRANDGIFT_PAY_GET == nPayStatus then
+            tData.nPayStatus = CommonDefine.COMMON_PRIZE_STATE_GET
+        end
+
+        if nPayStatus ~= BUSTHREEGRANDGIFT_PAY_NOGET and BUSTHREEGRANDGIFT_PAY_HUOYUE ~= nPayStatus then
+            tData.bBuy = 1
+        end
+
+        tData.nFinishNum = BusThreeGrandGift_GetBuyNum(human)
+        tData.nNeedNum = v.nNeedNum
+
+        -- 购买项
+        BuyLogic.fontBuyItem(human, tData.tBuyItem, v.nBuyID)
+
+        tData.tFreePrize[0] = #v.FreePrize
+        for i, tItem in ipairs(v.FreePrize) do
+            local nGoodsID = tItem[1]
+            local nGoodsNum = tItem[2]
+
+            Grid.makeItem(tData.tFreePrize[i], nGoodsID, nGoodsNum)
+        end
+
+        tData.tPayPrize[0] = #v.PayPrize
+        for i, tItem in ipairs(v.PayPrize) do
+            local nGoodsID = tItem[1]
+            local nGoodsNum = tItem[2]
+
+            Grid.makeItem(tData.tPayPrize[i], nGoodsID, nGoodsNum)
+        end
+    end
+
+    Msg.send(tMsgData, human.fd)
+end
+
+function BusThreeGrandGift_Get(human)
+    local tGoods = {}
+    for nID, v in ipairs(tGrandGiftConf) do
+        local nFreeStatus = BusThreeGrandGift_GetFreeStatus(human, nID)
+        if CommonDefine.COMMON_PRIZE_STATE_CANGET == nFreeStatus then
+            BusThreeGrandGift_SetFreeStatus(human, nID, CommonDefine.COMMON_PRIZE_STATE_GET)
+            for _, tItem in ipairs(v.FreePrize) do
+                local nGoodsID = tItem[1]
+                local nGoodsNum = tItem[2]
+
+                if not tGoods[nGoodsID] then
+                    tGoods[nGoodsID] = 0
+                end
+
+                tGoods[nGoodsID] = tGoods[nGoodsID] + nGoodsNum
+            end
+        end
+
+        local nPayStatus = BusThreeGrandGift_GetPayStatus(human, nID)
+        if BUSTHREEGRANDGIFT_PAY_CANGET == nPayStatus then
+            BusThreeGrandGift_SetPayStatus(human, nID, BUSTHREEGRANDGIFT_PAY_GET)
+            for _, tItem in ipairs(v.PayPrize) do
+                local nGoodsID = tItem[1]
+                local nGoodsNum = tItem[2]
+
+                if not tGoods[nGoodsID] then
+                    tGoods[nGoodsID] = 0
+                end
+
+                tGoods[nGoodsID] = tGoods[nGoodsID] + nGoodsNum
+            end
+        end
+    end
+
+    if nil ~= _G.next(tGoods) then
+        local tItem = {}
+        for nGoodID, nGoodNum in pairs(tGoods) do
+            table.insert(tItem, {nGoodID, nGoodNum})
+        end
+
+        BagLogic.addItemList(human, tItem, "BusThreeGrandGift")
+        BusThreeGrandGift_Query(human)
+
+        YunYingLogic.sendBanner(human)
+        -- BusOneActivityTask.BusOneTask_SendRed(human)
+    end
+end
+
+-----------------------------------外部调用-----------------------------
+function isOpen(human, YYInfo, funcConfig)
+    print("[BusThreeGrandGift_isOpen] 进入判断")
+    local state, endTime, startTime = AbsActLogic.isStarted(human, funcConfig and funcConfig.funcID or BUSTHREEGRANDGIFTABSID)
+    if not state then 
+        print("[BusThreeGrandGift_isOpen] 当前活动未开启")
+        return 
+    end
+    print("[BusThreeGrandGift_isOpen] 进入判断 endTime = "..endTime.." startTime = "..startTime)
+    return true, endTime, startTime
+end
+
+function isActive(human, YYInfo, funcConfig)
+    return not isOpen(human, YYInfo, funcConfig)
+end
+
+function isRed(human, YYInfo, absActConfig)
+    BusThreeGrandGift_CheckAndResetDB(human)
+
+    for nID, v in ipairs(tGrandGiftConf) do
+        local nFreeStatus = BusThreeGrandGift_GetFreeStatus(human, nID)
+        local nPayStatus = BusThreeGrandGift_GetPayStatus(human, nID)
+        if CommonDefine.COMMON_PRIZE_STATE_CANGET == nFreeStatus or
+            BUSTHREEGRANDGIFT_PAY_CANGET == nPayStatus then
+            return true
+        end
+    end
+
+    return false
+end
+
+function onCharge(human, price, funcID, buyID)
+    print("[BusThreeGrandGift_onCharge] 进入购买 buyID = "..buyID)
+
+    BusThreeGrandGift_CheckAndResetDB(human)
+
+    for nID, v in ipairs(tGrandGiftConf) do
+        if v.nBuyID == buyID then
+            local nPayStatus = BusThreeGrandGift_GetPayStatus(human, nID)
+            if BUSTHREEGRANDGIFT_PAY_NOGET == nPayStatus then
+                BusThreeGrandGift_SetPayStatus(human, nID, BUSTHREEGRANDGIFT_PAY_BUY)
+            elseif BUSTHREEGRANDGIFT_PAY_HUOYUE == nPayStatus then
+                BusThreeGrandGift_SetPayStatus(human, nID, BUSTHREEGRANDGIFT_PAY_CANGET)
+            end
+        end
+    end
+
+    print("[BusThreeGrandGift_onCharge] 发送协议完成")
+
+    BusThreeGrandGift_Query(human)
+    -- BusOneActivityTask.BusOneTask_SendRed(human)
+end
+
+function BusThreeGrandGift_NumChange(human, nNum)
+    if 0 >= nNum then
+        return
+    end
+
+    BusThreeGrandGift_CheckAndResetDB(human)
+    local nOldNum = BusThreeGrandGift_GetBuyNum(human)
+    BusThreeGrandGift_SetBuyNum(human, nNum)
+
+    local nNewNum = nOldNum + nNum
+    local bSend = false
+    for nID, v in ipairs(tGrandGiftConf) do
+        if nNewNum >= v.nNeedNum then
+            local nFreeStatus = BusThreeGrandGift_GetFreeStatus(human, nID)
+            local nPayStatus = BusThreeGrandGift_GetPayStatus(human, nID)
+            if nFreeStatus == CommonDefine.COMMON_PRIZE_STATE_NOGET then
+                BusThreeGrandGift_SetFreeStatus(human, nID, CommonDefine.COMMON_PRIZE_STATE_CANGET)
+                bSend = true
+            end
+
+            if BUSTHREEGRANDGIFT_PAY_NOGET == nPayStatus then
+                BusThreeGrandGift_SetPayStatus(human, nID, BUSTHREEGRANDGIFT_PAY_HUOYUE)
+                bSend = true
+            elseif BUSTHREEGRANDGIFT_PAY_BUY == nPayStatus then
+                BusThreeGrandGift_SetPayStatus(human, nID, BUSTHREEGRANDGIFT_PAY_CANGET)
+                bSend = true
+            end
+        end
+    end
+
+    if true == bSend then
+        YunYingLogic.sendBanner(human)
+        -- BusThreeActivityTask.BusOneTask_SendRed(human)
+    end
+end

+ 560 - 0
script/module/absAct/BusThreeActTask.lua

@@ -0,0 +1,560 @@
+--------------------------------
+-- 文件名       :   BusThreeActTask.lua
+-- 文件说明     :   新商业活动3-任务
+-- 创建时间     :   2025/09/02
+-- 创建人       :   FC
+--------------------------------
+
+local Util = require("common.Util")
+local Msg = require("core.Msg")
+local Grid = require("bag.Grid")
+local BagLogic = require("bag.BagLogic")
+local CommonDefine = require("common.CommonDefine")
+local BusThreeActConf = require("excel.BusThreeActivity")
+local ObjHuman = require("core.ObjHuman")
+local TriggerDefine = require("trigger.TriggerDefine")
+local TriggerLogic = require("trigger.TriggerLogic")
+local ServerCommerceManager = require("serverCommerce.ServerCommerceManager")
+local AbsActLogic = require("absAct.AbsActLogic")
+local Broadcast = require("broadcast.Broadcast")
+local Lang = require("common.Lang")
+
+local BUSTHREETASKABSID = 7401        -- 对应ABS活动ID
+
+----------------------------------------- 内部处理开始 -------------------------------------
+-- 配置
+local function BusThreeActTask_GetTaskCof()
+    return BusThreeActConf.Task
+end
+
+local function BusThreeActTask_GetTaskPointCof()
+    return BusThreeActConf.TaskPoint
+end
+
+-- 订阅事件
+local function BusThreeActTask_SubEvent(uuid, nEventType)
+    TriggerLogic.SubscribeEvent(nEventType, uuid, BusThreeActTask_EventCallBack)
+end
+
+-- 创建DB数据
+local function CreatDB(human)
+    human.db.absAct[BUSTHREETASKABSID].Task = {
+        nTaskPoint = 0,             -- 任务积分
+        TaskPrize = {},             -- 任务数据
+        TaskPointPrize = {},        -- 任务积分奖励
+    }
+
+    local tConf = BusThreeActTask_GetTaskCof()
+    local tEvnetType = {}
+    local tDBTask = human.db.absAct[BUSTHREETASKABSID].Task.TaskPrize
+    for nID, v in ipairs(tConf) do
+        if not tDBTask[v.nTaskType] then
+            tDBTask[v.nTaskType] = {
+                nFinishNum = 0,     -- 完成次数
+                taskStatus = {},    -- 任务状态
+            }
+        end
+
+        tDBTask[v.nTaskType].taskStatus[nID] = CommonDefine.COMMON_PRIZE_STATE_NOGET
+
+        if not tEvnetType[v.nTaskType] then
+            BusThreeActTask_SubEvent(human.db._id, v.nTaskType)
+            tEvnetType[v.nTaskType] = 1
+        end
+    end
+
+    tConf = BusThreeActTask_GetTaskPointCof()
+    local tDBTaskPointPrize = human.db.absAct[BUSTHREETASKABSID].Task.TaskPointPrize
+    for nID, v in pairs(tConf) do
+        if not tDBTaskPointPrize[nID] then
+            tDBTaskPointPrize[nID] = CommonDefine.COMMON_PRIZE_STATE_NOGET
+        end
+    end
+
+    print("[BusThreeActTask_CreatDB] 战区任务 初始化数据完成 name = "..human.db.name)
+    return true
+end
+
+local function CheckAndCreatDB(human)
+    if not human.db.absAct[BUSTHREETASKABSID] or nil == _G.next(human.db.absAct[BUSTHREETASKABSID]) 
+        or not human.db.absAct[BUSTHREETASKABSID].Task then
+            CreatDB(human)
+    end
+end
+
+-- 获取任务奖励DB数据
+local function BusThreeActTask_GetTaskDB(human)
+    if not human.db.absAct[BUSTHREETASKABSID].Task then
+        human.db.absAct[BUSTHREETASKABSID].Task = {}
+        CreatDB(human)
+    end
+
+    return human.db.absAct[BUSTHREETASKABSID].Task
+end
+
+-- 获取任务状态
+local function BusThreeActTask_GetTaskStatus(human, nID, nTaskType)
+    local tDBData = BusThreeActTask_GetTaskDB(human)
+
+    if not tDBData.TaskPrize or not tDBData.TaskPrize[nTaskType] or not tDBData.TaskPrize[nTaskType].taskStatus[nID] then
+        print("[BusThreeActTask_GetTaskStatus] 不存在对应的DB数据!!! 没有初始化吗?")
+        return CommonDefine.COMMON_PRIZE_STATE_NOGET
+    end
+
+    return tDBData.TaskPrize[nTaskType].taskStatus[nID]
+end
+
+-- 设置任务状态
+local function BusThreeActTask_SetTaskStatus(human, nID, nTaskType, nValue)
+    local tDBData = BusThreeActTask_GetTaskDB(human)
+
+    tDBData.TaskPrize[nTaskType].taskStatus[nID] = nValue
+end
+
+-- 获取任务完成次数
+local function BusThreeActTask_GetTaskFinishNum(human, nTaskType)
+    local tDBData = BusThreeActTask_GetTaskDB(human)
+    if not tDBData.TaskPrize[nTaskType] then
+        return -1
+    end
+
+    return tDBData.TaskPrize[nTaskType].nFinishNum
+end
+
+-- 增加任务完成次数
+local function BusThreeActTask_AddTaskFinishNum(human, nTaskType, nAddNum)
+    local tDBData = BusThreeActTask_GetTaskDB(human)
+    if not tDBData.TaskPrize[nTaskType] then
+        return
+    end
+
+    tDBData.TaskPrize[nTaskType].nFinishNum = tDBData.TaskPrize[nTaskType].nFinishNum + nAddNum
+end
+
+-- 获取任务积分
+local function BusThreeActTask_GetTaskPoint(human)
+    local tDBData = BusThreeActTask_GetTaskDB(human)
+    return tDBData.nTaskPoint
+end
+
+-- 增加任务积分
+local function BusThreeActTask_AddTaskPoint(human, nPoint)
+    local tDBData = BusThreeActTask_GetTaskDB(human)
+    tDBData.nTaskPoint = tDBData.nTaskPoint + nPoint
+end
+
+-- 获取任务积分奖励状态
+local function BusThreeActTask_GetTaskPointPrizeStatus(human, nID)
+    local tDBData = BusThreeActTask_GetTaskDB(human)
+    if not tDBData.TaskPointPrize or not tDBData.TaskPointPrize[nID] then
+        return CommonDefine.COMMON_PRIZE_STATE_NOGET
+    end
+
+    return tDBData.TaskPointPrize[nID]
+end
+
+-- 设置 任务积分奖励状态
+local function BusThreeActTask_SetTaskPointPrizeStatus(human, nID, nValue)
+    local tDBData = BusThreeActTask_GetTaskDB(human)
+    tDBData.TaskPointPrize[nID] = nValue
+end
+
+-- 检查任务是否完成
+local function BusThreeActTask_CheckTaskStatus(human, nTaskType)
+    local tConf = BusThreeActTask_GetTaskCof()
+    local nNowFinishNum = BusThreeActTask_GetTaskFinishNum(human, nTaskType)
+    print("[BusThreeActTask_CheckTaskStatus] nNowFinishNum = "..nNowFinishNum)
+    local nDay
+    for nID, v in ipairs(tConf) do
+        if v.nTaskType == nTaskType then
+            if nNowFinishNum >= v.nValue then
+                local nState = BusThreeActTask_GetTaskStatus(human, nID, nTaskType)
+                if CommonDefine.COMMON_PRIZE_STATE_NOGET == nState then
+                    BusThreeActTask_SetTaskStatus(human, nID, v.nTaskType, CommonDefine.COMMON_PRIZE_STATE_CANGET)
+                    -- BusThreeActTask_AddPoint(human, 1)
+                    if not nDay then
+                        nDay = v.nDay
+                    end
+                end
+            else
+                break
+            end
+        end
+    end
+end
+
+-- 检查任务点数奖励状态
+local function BusThreeActTask_CheckTaskPointStatus(human)
+    local nNowPoint = BusThreeActTask_GetTaskPoint(human)
+    local tConf = BusThreeActTask_GetTaskPointCof()
+
+    local bSendClient = false
+    for nID, v in ipairs(tConf) do
+        if nNowPoint >= v.nPoint then
+            local nState = BusThreeActTask_GetTaskPointPrizeStatus(human, nID)
+            if CommonDefine.COMMON_PRIZE_STATE_NOGET == nState then
+                bSendClient = true
+                BusThreeActTask_SetTaskPointPrizeStatus(human, nID, CommonDefine.COMMON_PRIZE_STATE_CANGET)
+            end
+        else
+            break
+        end
+    end
+
+    if true == bSendClient then
+        BusThreeActTask_QueryTaskPoint(human)
+    end
+end
+
+----------------------------------------回调处理---------------------------------------------------
+-- 事件回调通用处理
+local function BusThreeActTask_EvnentCommon(nEventType, uuid, nValue)
+    print("[BusThreeActTask_EvnentCommon] 事件回调通用处理 nEventType = "..nEventType.." uuid = "..uuid)
+    local human = ObjHuman.onlineUuid[uuid]
+    if not human then
+        print("[BusThreeActTask_EvnentCommon] 玩家不在线了? nEventType = "..nEventType)
+        return
+    end
+
+    print("[BusThreeActTask_EvnentCommon] nEventType = "..nEventType.." nValue = "..nValue.." name = "..human.db.name)
+
+    local nOldNum = BusThreeActTask_GetTaskFinishNum(human, nEventType)
+
+    print("[BusThreeActTask_EvnentCommon] 久的次数 nOldNum = "..nOldNum)
+
+    -- 增加完成次数
+    BusThreeActTask_AddTaskFinishNum(human, nEventType, nValue)
+
+    -- 检查任务状态
+    BusThreeActTask_CheckTaskStatus(human, nEventType)
+end
+
+-- 事件-获得英雄处理
+local function BusThreeActTask_EvnentGetHero(nEventType, uuid, nValue1, nValue2)
+    local human = ObjHuman.onlineUuid[uuid]
+    if not human then
+        return
+    end
+    
+    local nNum = nValue1
+    local nStar = nValue2
+
+    print("[BusThreeActTask_EvnentGetHero] nEventType = "..nEventType.." nNum = "..nNum.." nStar = "..nStar.." name = "..human.db.name)
+
+    local bCheck = false
+    local tConf = BusThreeActTask_GetTaskCof()
+    for nID, v in ipairs(tConf) do
+        if v.nTaskType == nEventType then
+            if not v.nTaskArgument or v.nTaskArgument == "" then
+                print("[BusThreeActTask_EvnentGetHero] 获得英雄但是没有获取到对应的配置参数要求")
+            else
+                --print("[BusThreeActTask_EvnentGetHero] 存在对应参数 nTaskArgument = "..v.nTaskArgument)
+                local tTaskArgument = Util.split(v.nTaskArgument , "|")
+                -- table.print_lua_table(tTaskArgument)
+                if 2 ~= #tTaskArgument then
+                    print("[BusThreeActTask_EvnentGetHero] 获取的任务 参数数量不正确")
+                else
+                    if nNum >= tonumber(tTaskArgument[1]) and nStar == tonumber(tTaskArgument[2]) then
+                        --print("BusThreeActTask_EvnentGetHero 条件满足")
+                        BusThreeActTask_AddTaskFinishNum(human, nEventType, 1)
+                        --local nNewNum = BusThreeActTask_GetTaskFinishNum(human, nEventType)
+                        --print("BusThreeActTask_EvnentGetHero 条件满足, 新的数量为 nNewNum = "..nNewNum)
+                        bCheck = true
+                    end
+                end
+            end
+        end
+    end
+
+    BusThreeActTask_CheckTaskStatus(human, nEventType)
+end
+
+-- 事件处理
+local tEventHandler = nil
+-- 起服处理
+function Init()
+    tEventHandler = {
+        [TriggerDefine.EVENT_TYPE_SWEEP] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.CHAT_TIMES] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.FRIEND_COMBAT] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.EVENT_TYPE_FINDSTAR] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.EVENT_TYPE_FATESUMMON] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.EVENT_TYPE_OPENBOX] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.EVENT_TYPE_CHAMPIONSNUM] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.EVENT_TYPE_GETHERO] = BusThreeActTask_EvnentGetHero,
+        [TriggerDefine.EVENT_TYPE_SHOPBUY] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.EVENT_TYPE_UNIONSKILLUP] = BusThreeActTask_EvnentCommon,
+        [TriggerDefine.DRAWCALL_SERNIOR_CNT] = BusThreeActTask_EvnentCommon,
+    }
+
+    print("[CommerceActTask - Init] tEventHandler 初始化完成")
+end
+
+----------------------------------------- 外部调用开始 -------------------------------------
+function BusThreeActTask_EventCallBack(nEventType, uuid, nValue1, nValue2)
+    if not tEventHandler then
+        Init()
+    end
+
+    if not tEventHandler or not tEventHandler[nEventType] then
+        print("[BusThreeActTask_EventCallBack] 不存在对应的处理函数 nEventType = "..nEventType)
+        return
+    end
+
+    print("[BusThreeActTask_EventCallBack] 收到事件触发回调 nEventType = "..nEventType)
+    pcall(tEventHandler[nEventType], nEventType, uuid, nValue1, nValue2)
+end
+
+function BusThreeActTask_AddPoint(human, nAddPoint)
+    -- 增加积分
+    BusThreeActTask_AddTaskPoint(human, nAddPoint)
+
+    -- 检查积分奖励状态
+    BusThreeActTask_CheckTaskPointStatus(human)
+end
+
+----------------------------------------- 客户端请求 -------------------------------------
+-- 请求战区集结任务信息
+function BusThreeActTask_QueryTask(human, nDay)
+    local state, nEndTime, nOpenTime = AbsActLogic.isStarted(human, BUSTHREETASKABSID)
+    if not state then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    print("[BusThreeActTask_QueryTask] 进入查询任务信息 nDay = "..nDay.." name = "..human.db.name)
+
+    CheckAndCreatDB(human)
+
+    local tConf = BusThreeActTask_GetTaskCof()
+
+    local nDiffDay = Util.diffDay(nOpenTime) + 1
+    local tMsgData = Msg.gc.GC_NEW_BUSTHREEACT_TASKQUERY
+    tMsgData.nDay = nDay
+    tMsgData.nNowDay = nDiffDay
+    tMsgData.nNowPoint = BusThreeActTask_GetTaskPoint(human)
+    tMsgData.leftTime = nEndTime - os.time()
+
+    print("[BusThreeActTask_QueryTask] nDay = "..nDay.." nDiffDay = "..nDiffDay.." name = "..human.db.name)
+
+    local tDay = {}
+    local tRed = tMsgData.tRed
+    tRed[0] = 0
+    local tListData = tMsgData.list
+    tListData[0] = 0
+    for nID, v in ipairs(tConf) do
+        if v.nDay == nDay then
+            tListData[0] = tListData[0] + 1
+            local tNode = tListData[tListData[0]]
+            tNode.nID = nID
+            tNode.nState = BusThreeActTask_GetTaskStatus(human, nID, v.nTaskType)
+            tNode.nDay = v.nDay
+            tNode.nValue = v.nValue
+            -- tNode.nPoint = v.nPoint
+            tNode.Desc = v.szDes
+            tNode.nFinish = BusThreeActTask_GetTaskFinishNum(human, v.nTaskType)
+            tNode.item[0] = #v.Prize
+
+            for i, tItemData in ipairs(v.Prize) do
+                Grid.makeItem(tNode.item[i], tItemData[1], tItemData[2])
+            end
+        end
+
+        if not tDay[v.nDay] then
+            tDay[v.nDay] = 1
+            tRed[0] = tRed[0] + 1
+            tRed[v.nDay] = 0
+        end
+
+        if tRed[v.nDay] == 0 and v.nDay <= nDiffDay then
+            local nState = BusThreeActTask_GetTaskStatus(human, nID, v.nTaskType)
+            if nState == CommonDefine.COMMON_PRIZE_STATE_CANGET then
+                tRed[v.nDay] = 1
+            end
+        end
+    end
+
+    Msg.send(tMsgData, human.fd)
+    print("[BusThreeActTask_QueryTask] 发送任务信息完成 name = "..human.db.name)
+end
+
+-- 请求领取任务奖励
+function BusThreeActTask_GetTaskPrize(human, nDay)
+    local tConf = BusThreeActTask_GetTaskCof()
+    local tGoods = {}
+
+    local nFinishNum = 0
+    for nID, v in ipairs(tConf) do
+        if v.nDay == nDay then
+            local nState = BusThreeActTask_GetTaskStatus(human, nID, v.nTaskType)
+            if CommonDefine.COMMON_PRIZE_STATE_CANGET == nState then
+                for i, tItemData in ipairs(v.Prize) do
+                    if not tGoods[tItemData[1]] then
+                        tGoods[tItemData[1]] = 0
+                    end
+
+                    tGoods[tItemData[1]] = tGoods[tItemData[1]] + tItemData[2]
+                end
+
+                BusThreeActTask_SetTaskStatus(human, nID, v.nTaskType, CommonDefine.COMMON_PRIZE_STATE_GET)
+                nFinishNum = nFinishNum + 1
+            end
+        end
+    end
+
+    if nil ~= _G.next(tGoods) then
+        local tItem = {}
+        for nID, nNum in pairs(tGoods) do
+            table.insert(tItem, {nID, nNum})
+        end
+
+        BagLogic.addItemList(human, tItem, "BusThreeTask")
+
+        BusThreeActTask_AddPoint(human, nFinishNum)
+
+        BusThreeActTask_QueryTask(human, nDay)
+     
+        BusThreeActTask_QueryTaskPoint(human)
+    end
+end
+
+-- 请求任务积分信息
+function BusThreeActTask_QueryTaskPoint(human)
+    print("[BusThreeActTask_QueryTaskPoint] 进入查询任务积分信息 name = "..human.db.name)
+    local tConf = BusThreeActTask_GetTaskPointCof()
+
+    local tMsgData = Msg.gc.GC_NEW_BUSTHREEACT_TASKPOINTQUERY
+    tMsgData.nNowPoint = BusThreeActTask_GetTaskPoint(human)
+
+    CheckAndCreatDB(human)
+
+    local tListData = tMsgData.listPoint
+    tListData[0] = 0
+    for nID, v in ipairs(tConf) do
+        tListData[0] = tListData[0] + 1
+        local tNode = tListData[tListData[0]]
+        tNode.nID = nID
+        tNode.nNeedPoint = v.nPoint
+        tNode.nState = BusThreeActTask_GetTaskPointPrizeStatus(human, nID)
+        tNode.item[0] = #v.Prize
+
+        for i, tItemData in ipairs(v.Prize) do
+            Grid.makeItem(tNode.item[i], tItemData[1], tItemData[2])
+        end
+    end
+
+    Msg.send(tMsgData, human.fd)
+end
+
+-- 领取任务积分奖励
+function BusThreeActTask_GetTaskPointPrize(human)
+    local tConf = BusThreeActTask_GetTaskPointCof()
+
+    local tGoods = {}
+    for nID, v in ipairs(tConf) do
+        local nState = BusThreeActTask_GetTaskPointPrizeStatus(human, nID)
+        if CommonDefine.COMMON_PRIZE_STATE_CANGET == nState then
+            for i, tItemData in ipairs(v.Prize) do
+                if not tGoods[tItemData[1]] then
+                    tGoods[tItemData[1]] = 0
+                end
+
+                tGoods[tItemData[1]] = tGoods[tItemData[1]] + tItemData[2]
+            end
+
+            BusThreeActTask_SetTaskPointPrizeStatus(human, nID, CommonDefine.COMMON_PRIZE_STATE_GET)
+        end
+    end
+
+    if nil ~= _G.next(tGoods) then
+        local tItem = {}
+        for nID, nNum in pairs(tGoods) do
+            table.insert(tItem, {nID, nNum})
+        end
+
+        BagLogic.addItemList(human, tItem, "BusThreeTask")
+        BusThreeActTask_QueryTaskPoint(human)
+    end
+end
+
+function isRed(human)
+    local tConf = BusThreeActTask_GetTaskCof()
+    local state, nEndTime, nOpenTime = AbsActLogic.isStarted(human, BUSTHREETASKABSID)
+    if not state then
+        return Broadcast.sendErr(human, Lang.YUNYING_ERR_TIME)
+    end
+
+    CheckAndCreatDB(human)
+    
+    if 0 >= nOpenTime then
+        print("[BusThreeActTask_isRed] 不正确的活动开启时间")
+        return false
+    end
+
+    local nDiffDay = Util.diffDay(nOpenTime) + 1
+    for nID, v in ipairs(tConf) do
+        if v.nDay <= nDiffDay then
+            local nState = BusThreeActTask_GetTaskStatus(human, nID, v.nTaskType)
+            if CommonDefine.COMMON_PRIZE_STATE_CANGET == nState then
+                return true
+            end
+        end
+    end
+
+    tConf = BusThreeActTask_GetTaskPointCof()
+    for nID, v in ipairs(tConf) do
+        local nState = BusThreeActTask_GetTaskPointPrizeStatus(human, nID)
+        if CommonDefine.COMMON_PRIZE_STATE_CANGET == nState then
+            return true
+        end
+    end
+
+    return false
+end
+
+-- 订阅任务数据
+function BusThreeActTask_HumanSubEvent(human)
+    local tConf = BusThreeActTask_GetTaskCof()
+    local tTaskType = {}
+
+    for nID, v in ipairs(tConf) do
+        if not tTaskType[v.nTaskType] then
+            local nState = BusThreeActTask_GetTaskStatus(human, nID, v.nTaskType)
+            -- 没有完成才订阅
+            if nState == CommonDefine.COMMON_PRIZE_STATE_NOGET then
+                tTaskType[v.nTaskType] = 1
+            end
+        end
+    end
+
+    -- 订阅事件
+    for nTaskType, v in pairs(tTaskType) do
+        BusThreeActTask_SubEvent(human.db._id, nTaskType)
+        print("[BusThreeActTask_SubEvent] 玩家订阅了事件 nTaskType = "..nTaskType)
+    end
+end
+
+function onLogin(human)
+    local state, nEndTime, nOpenTime = AbsActLogic.isStarted(human, BUSTHREETASKABSID)
+    if not state then
+        return
+    end
+
+    BusThreeActTask_HumanSubEvent(human)
+    print("[BusThreeActTask_onLogin] 玩家登录订阅事件完成 name = "..human.db.name)
+end
+
+
+function isOpen(human, YYInfo, funcConfig)
+    print("[BusThreeActTask__isOpen] 进入判断")
+    local state, endTime, startTime = AbsActLogic.isStarted(human, funcConfig and funcConfig.funcID or BUSTHREETASKABSID)
+    if not state then 
+        print("[BusThreeActTask_isOpen] 当前活动未开启")
+        return 
+    end
+    print("[BusThreeActTask__isOpen] 进入判断 endTime = "..endTime.." startTime = "..startTime)
+    return true, endTime, startTime
+end
+
+function isActive(human, YYInfo, funcConfig)
+    return not isOpen(human, YYInfo, funcConfig)
+end

+ 46 - 1
script/module/absAct/Handler.lua

@@ -42,7 +42,10 @@ local CycleSevenDayTask = require("absAct.CycleSevenDayTask")
 local CycleHeroSendGift = require("absAct.CycleHeroSendGift")
 local CycleBreakThrough = require("absAct.CycleBreakThrough")
 local CycleMakeFood = require("absAct.CycleMakeFood")
-
+local BusThreeActGrandGift = require("absAct.BusThreeActGrandGift")
+local BusThreeActDisStore = require("absAct.BusThreeActDiscountStore")
+local BusThreeActTask = require("absAct.BusThreeActTask")
+local BusThreeActDice = require("absAct.BusThreeActDice")
 
 
 function CG_ABS_ACT_DETAIL_QUERY(human, msg)
@@ -404,4 +407,46 @@ end
 
 function CG_CYCLMAKEFOOD_GET_5STARfOODLIST(human, msg)
     CycleMakeFood.Get5StarFoodArray(human, msg.actId)
+end
+
+-----------------------------------------------------新商业化活动3 — 天选豪礼--------------------------------------------------
+function CG_NEW_BUSTHREEACT_GRANDGIFT_QUERY(human, msg)
+    BusThreeActGrandGift.BusThreeGrandGift_Query(human)
+end
+
+function CG_NEW_BUSTHREEACT_GRANDGIFT_GET(human, msg)
+    BusThreeActGrandGift.BusThreeGrandGift_Get(human)
+end
+
+-----------------------------------------------------新商业化活动3 — 特价商店--------------------------------------------------
+function CG_NEW_BUSTHREEACT_DISQUERY(human, msg)
+    BusThreeActDisStore.Query(human)
+end
+
+function CG_NEW_BUSTHREEACT_DISBUY(human, msg)
+    BusThreeActDisStore.BuyItem(human, msg.id, msg.idx, msg.buyCnt)
+end
+
+-----------------------------------------------------新商业化活动3 — 任务 --------------------------------------------------
+function CG_NEW_BUSTHREEACT_TASKQUERY(human, msg)
+    print("[CG_NEW_BUSTHREEACT_TASKQUERY] 玩家请求任务信息 name = "..human.db.name)
+    BusThreeActTask.BusThreeActTask_QueryTask(human, msg.nDay)
+end
+
+function CG_NEW_BUSTHREEACT_GETTASKPRIZE(human, msg)
+    BusThreeActTask.BusThreeActTask_GetTaskPrize(human, msg.nDay)
+end
+
+function CG_NEW_BUSTHREEACT_TASKPOINTQUERY(human, msg)
+    print("[CG_NEW_BUSTHREEACT_TASKPOINTQUERY] 玩家请求任务积分信息 name = "..human.db.name)
+    BusThreeActTask.BusThreeActTask_QueryTaskPoint(human)
+end
+
+function CG_NEW_BUSTHREEACT_GETTASKPOINTPRIZE(human, msg)
+    BusThreeActTask.BusThreeActTask_GetTaskPointPrize(human)
+end
+
+-----------------------------------------------------新商业化活动3 — 天选骰子 --------------------------------------------------
+function CG_NEW_BUSTHREEACT_DICEDO(human, msg)
+    BusThreeActDice.BusThreeActDice_DO(human, msg.nNum)
 end

+ 99 - 1
script/module/absAct/Proto.lua

@@ -1439,4 +1439,102 @@ GC_CYCLMAKEFOOD_GET_5STARfOODLIST = {
     {"isEnd",                       1,      "byte"},            -- 分段标识,0-没有发完,1-发完
 }
 
--------------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------
+
+---------------------新商业活动3-七日挑战-------------------
+TaskInfo = {
+    {"nID",             1,      "int"},         -- 任务编号
+    {"nState",          1,      "byte"},        -- 0 不可领取 1 - 可领取 2- 已领取
+    {"nDay",            1,      "byte"},        -- 天数
+    {"nValue",          1,      "int"},         -- 任务需要完成次数
+    -- {"nPoint",          1,      "byte"},        -- 完成获得积分
+    {"Desc",            1,      "string"},      -- 任务描述
+    {"nFinish",         1,      "int"},         -- 当前完成次数
+    {"item",            5,      ItemData},      -- 奖励信息
+}
+
+TaskPointInfo = {
+    {"nID",             1,      "int"},         -- 积分奖励ID
+    {"nNeedPoint",      1,      "int"},         -- 需要积分
+    {"nState",          1,      "byte"},        -- 0 不可领取 1 - 可领取 2- 已领取
+    {"item",            5,      ItemData},      -- 奖励信息
+}
+
+-- 请求结任务信息
+CG_NEW_BUSTHREEACT_TASKQUERY = {
+    {"nDay",            1,      "int"},     
+}
+
+-- 任务信息回复协议
+GC_NEW_BUSTHREEACT_TASKQUERY = 
+{
+    {"nDay",        1,    "int"},           -- 天数
+    {"nNowPoint",   1,    "int"},           -- 当前积分
+    {"nNowDay",     1,    "int"},           -- 当前是第几天
+    {"list",        15,   TaskInfo},        -- 奖励信息
+    {"tRed",        8,     "byte"},         -- 天数红点 0 没有 1有
+}
+
+-- 请求领取任务奖励 
+CG_NEW_BUSTHREEACT_GETTASKPRIZE = 
+{
+   {"nDay",         1,     "int"},          -- 天数
+}
+
+-- 请求任务积分信息
+CG_NEW_BUSTHREEACT_TASKPOINTQUERY = {
+}
+
+-- 请求任务积分信息回包
+GC_NEW_BUSTHREEACT_TASKPOINTQUERY = 
+{
+    {"nNowPoint",   1,      "int"},         -- 当前积分
+    {"listPoint",   8,    TaskPointInfo}    -- 积分信息
+}
+
+-- 领取任务积分奖励
+CG_NEW_BUSTHREEACT_GETTASKPOINTPRIZE = {}
+
+---------------------新商业活动3-天选兑换-------------------
+-- 查询商品数据
+CG_NEW_BUSTHREEACT_DISQUERY = {}
+
+--查询返回协议
+GC_NEW_BUSTHREEACT_DISQUERY = {
+    {"titemData",                         20,       ITEM_INFO},         --所有商品数据
+}
+
+--购买请求协议
+CG_NEW_BUSTHREEACT_DISBUY = {
+    {"id",			                    1,      "int"},               -- 活动ID
+    {"idx",                             1,       "byte"},             -- 商品索引
+    {"buyCnt",                          1,       "int"},              --购买的份数
+}
+
+---------------------新商业活动3-天选豪礼-------------------
+-- 请求天选豪礼
+CG_NEW_BUSTHREEACT_GRANDGIFT_QUERY = {}
+
+
+-- 回复天选豪礼
+GC_NEW_BUSTHREEACT_GRANDGIFT_QUERY = {
+    {"tList",       20,     BUSONEACTYUANZHENG}
+}
+
+-- 请求领取天选豪礼
+CG_NEW_BUSTHREEACT_GRANDGIFT_GET = {}
+
+---------------------新商业活动3-天选骰子-------------------
+DICEPRIZE = {
+    {"tPoint",      1,      "string"},    -- 1|2|3
+    {"titemData",   5,      ItemData},  -- 对应的奖励配置
+}
+-- 抽取
+CG_NEW_BUSTHREEACT_DICEDO = {
+    {"nNum",        1,      "byte"},    -- 次数
+}
+
+-- 奖励回复
+GC_NEW_BUSTHREEACT_DICEDO = {
+    {"tPrize",      10,     DICEPRIZE},     -- 奖励配置
+}

+ 1 - 1
script/module/yunying/CycleActivity.lua

@@ -116,10 +116,10 @@ local function CycleActivity_GetNextActivityID(human)
         if v == nNowActivityID then
             if nID == nLen then
                 nChoseID = 1
-                break
             else
                 nChoseID = nID + 1
             end
+            break
         end
     end