|
|
@@ -34,6 +34,23 @@ local FINISH_TASK_COST_ID = ItemDefine.ITEM_ZUANSHI_ID
|
|
|
--完成任务消耗道具数量
|
|
|
local FINISH_TASK_COST_CNT = 500
|
|
|
|
|
|
+local function getChannelId(human)
|
|
|
+ return human.db.phpChanelID or human.phpChanelID
|
|
|
+end
|
|
|
+
|
|
|
+local function isXiaoQiChannel(human)
|
|
|
+ local channelID = getChannelId(human)
|
|
|
+ return channelID == CommonDefine.CHANNEL_TAG_XIAOQI
|
|
|
+ or channelID == tostring(CommonDefine.CHANNEL_TAG_XIAOQI)
|
|
|
+end
|
|
|
+
|
|
|
+local function getConfig(human)
|
|
|
+ if isXiaoQiChannel(human) then
|
|
|
+ return AbsActExcel.AbsExcellentGiftLogic1
|
|
|
+ end
|
|
|
+ return AbsActExcel.AbsExcellentGiftLogic
|
|
|
+end
|
|
|
+
|
|
|
|
|
|
local BATTLE_MOP_UP = 1 --冒险闯关扫荡
|
|
|
local LOSTTEMPLE_PASS = 2 --失落神庙通关
|
|
|
@@ -110,10 +127,10 @@ end
|
|
|
-- end
|
|
|
|
|
|
--获取任务ID
|
|
|
-local function getTaskIdVec(triggerId, buyId)
|
|
|
+local function getTaskIdVec(human, triggerId, buyId)
|
|
|
local ids = {}
|
|
|
local len = 0
|
|
|
- local config = AbsActExcel.AbsExcellentGiftLogic
|
|
|
+ local config = getConfig(human)
|
|
|
for id, cfg in ipairs(config) do
|
|
|
if triggerId and cfg.taskId == triggerId then
|
|
|
len = len + 1
|
|
|
@@ -129,7 +146,7 @@ local function getTaskIdVec(triggerId, buyId)
|
|
|
end
|
|
|
|
|
|
--是否完成任务, 0-未完成, 1-可领取,2-已领取
|
|
|
-local function getTaskState(taskId, taskData)
|
|
|
+local function getTaskState(human, taskId, taskData)
|
|
|
if not taskData then
|
|
|
return CommonDefine.COMMON_PRIZE_STATE_NOGET
|
|
|
end
|
|
|
@@ -138,7 +155,7 @@ local function getTaskState(taskId, taskData)
|
|
|
return CommonDefine.COMMON_PRIZE_STATE_GET
|
|
|
end
|
|
|
|
|
|
- local config = AbsActExcel.AbsExcellentGiftLogic
|
|
|
+ local config = getConfig(human)
|
|
|
local singleCfg = config[taskId]
|
|
|
local triggerId = singleCfg.taskId
|
|
|
local triggerVal = singleCfg.taskVal
|
|
|
@@ -163,12 +180,12 @@ local function getTaskState(taskId, taskData)
|
|
|
end
|
|
|
|
|
|
--红点检查
|
|
|
-local function redDotCheck(recordData)
|
|
|
+local function redDotCheck(human, recordData)
|
|
|
local redDotPageTb = {}
|
|
|
local taskState = 0
|
|
|
- local config = AbsActExcel.AbsExcellentGiftLogic
|
|
|
+ local config = getConfig(human)
|
|
|
for taskId, data in pairs(recordData) do
|
|
|
- taskState = getTaskState(taskId, data)
|
|
|
+ taskState = getTaskState(human, taskId, data)
|
|
|
if taskState == CommonDefine.COMMON_PRIZE_STATE_CANGET then
|
|
|
local taskCfg = config[taskId]
|
|
|
redDotPageTb[taskCfg.page] = '1'
|
|
|
@@ -212,8 +229,8 @@ function onCharge(human, price, funcID, buyID)
|
|
|
actData.recordData = actData.recordData or {}
|
|
|
local recordData = actData.recordData
|
|
|
|
|
|
- local ids = getTaskIdVec(nil, buyID)
|
|
|
- local config = AbsActExcel.AbsExcellentGiftLogic
|
|
|
+ local ids = getTaskIdVec(human, nil, buyID)
|
|
|
+ local config = getConfig(human)
|
|
|
|
|
|
for _, id in ipairs(ids) do
|
|
|
if not recordData[id] or not recordData[id].isGet then
|
|
|
@@ -225,7 +242,7 @@ function onCharge(human, price, funcID, buyID)
|
|
|
|
|
|
isChange = true
|
|
|
if taskState ~= CommonDefine.COMMON_PRIZE_STATE_CANGET then
|
|
|
- taskState = getTaskState(id, recordData[id])
|
|
|
+ taskState = getTaskState(human, id, recordData[id])
|
|
|
end
|
|
|
end
|
|
|
end
|
|
|
@@ -255,7 +272,7 @@ function TriggerCbFunc(human, triggerTag, val, isAdd)
|
|
|
local actData = human.db.absAct[ACTID]
|
|
|
actData.recordData = actData.recordData or {}
|
|
|
local recordData = actData.recordData
|
|
|
- local ids = getTaskIdVec(triggerTag)
|
|
|
+ local ids = getTaskIdVec(human, triggerTag)
|
|
|
|
|
|
for _, id in ipairs(ids) do
|
|
|
if not recordData[id] or not recordData[id].isGet then
|
|
|
@@ -269,7 +286,7 @@ function TriggerCbFunc(human, triggerTag, val, isAdd)
|
|
|
|
|
|
--isChange = true
|
|
|
if taskState ~= CommonDefine.COMMON_PRIZE_STATE_CANGET then
|
|
|
- taskState = getTaskState(id, recordData[id])
|
|
|
+ taskState = getTaskState(human, id, recordData[id])
|
|
|
end
|
|
|
end
|
|
|
end
|
|
|
@@ -299,7 +316,7 @@ function isRed(human, YYInfo, funcConfig)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
- if not redDotCheck(recordData) then
|
|
|
+ if not redDotCheck(human, recordData) then
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
@@ -335,7 +352,7 @@ function Query(human, id, page)
|
|
|
|
|
|
actData.recordData = actData.recordData or {}
|
|
|
local recordData = actData.recordData
|
|
|
- local config = AbsActExcel.AbsExcellentGiftLogic
|
|
|
+ local config = getConfig(human)
|
|
|
local msgRet = Msg.gc.GC_EXCELLENTGIFT_QUERY
|
|
|
local len = 0
|
|
|
local taskList = msgRet.taskList
|
|
|
@@ -344,7 +361,7 @@ function Query(human, id, page)
|
|
|
if v.page == page then
|
|
|
len = len + 1
|
|
|
local taskData = recordData[taskId]
|
|
|
- taskList[len].state = getTaskState(taskId, taskData)
|
|
|
+ taskList[len].state = getTaskState(human, taskId, taskData)
|
|
|
taskList[len].idx = len
|
|
|
taskList[len].taskDesc = v.taskDes
|
|
|
|
|
|
@@ -372,7 +389,7 @@ function Query(human, id, page)
|
|
|
--红点
|
|
|
local redDotList = msgRet.redDotList
|
|
|
redDotList[0] = 0
|
|
|
- local redDotPageTb = redDotCheck(recordData)
|
|
|
+ local redDotPageTb = redDotCheck(human, recordData)
|
|
|
if redDotPageTb then
|
|
|
len = 0
|
|
|
for redPage in pairs(redDotPageTb) do
|
|
|
@@ -403,7 +420,7 @@ function GetReward(human, id, taskIdx, page)
|
|
|
local len = 0
|
|
|
local taskIdList = {}
|
|
|
local recordData = actData.recordData
|
|
|
- local config = AbsActExcel.AbsExcellentGiftLogic
|
|
|
+ local config = getConfig(human)
|
|
|
|
|
|
-- for k, v in ipairs(config) do
|
|
|
-- if v.page == page then
|
|
|
@@ -417,7 +434,7 @@ function GetReward(human, id, taskIdx, page)
|
|
|
|
|
|
for k, v in ipairs(config) do
|
|
|
if v.page == page then
|
|
|
- if getTaskState(k, recordData and recordData[k]) == CommonDefine.COMMON_PRIZE_STATE_CANGET then
|
|
|
+ if getTaskState(human, k, recordData and recordData[k]) == CommonDefine.COMMON_PRIZE_STATE_CANGET then
|
|
|
len = len + 1
|
|
|
taskIdList[len] = k
|
|
|
end
|
|
|
@@ -447,7 +464,7 @@ function GetReward(human, id, taskIdx, page)
|
|
|
Query(human, id, page)
|
|
|
|
|
|
--红点
|
|
|
- if not redDotCheck(recordData) then
|
|
|
+ if not redDotCheck(human, recordData) then
|
|
|
YunYingLogic.sendBanner(human)
|
|
|
local otherConfig = AbsActExcel.absActivity[ACTID]
|
|
|
YunYingLogic.sendGroupUpdate(YYInfo[ACTID], human, otherConfig.panelID)
|
|
|
@@ -471,7 +488,7 @@ function FinishTaskByDiamond(human, id, taskIdx, page)
|
|
|
local len = 0
|
|
|
local taskId = 0
|
|
|
local taskCfg = nil
|
|
|
- local config = AbsActExcel.AbsExcellentGiftLogic
|
|
|
+ local config = getConfig(human)
|
|
|
for k, v in ipairs(config) do
|
|
|
if v.page == page then
|
|
|
len = len + 1
|
|
|
@@ -491,7 +508,7 @@ function FinishTaskByDiamond(human, id, taskIdx, page)
|
|
|
return Broadcast.sendErr(human, Lang.FRIEND_HEART_GET_HAD)
|
|
|
end
|
|
|
|
|
|
- if getTaskState(taskId, recordData and recordData[taskId]) == CommonDefine.COMMON_PRIZE_STATE_CANGET then
|
|
|
+ if getTaskState(human, taskId, recordData and recordData[taskId]) == CommonDefine.COMMON_PRIZE_STATE_CANGET then
|
|
|
return Broadcast.sendErr(human, Lang.COMMON_FINISH)
|
|
|
end
|
|
|
|