|
|
@@ -41,7 +41,7 @@ function isActive(human, YYInfo, funcConfig)
|
|
|
end
|
|
|
|
|
|
|
|
|
--- 初始化数据库
|
|
|
+-- 锟斤拷始锟斤拷锟斤拷锟捷匡拷
|
|
|
function initDB(human,id)
|
|
|
local absAct = human.db.absAct[id]
|
|
|
absAct.drum = absAct.drum or {}
|
|
|
@@ -51,9 +51,9 @@ function initDB(human,id)
|
|
|
absAct.buling = absAct.buling or 0
|
|
|
end
|
|
|
|
|
|
--- 发送数据
|
|
|
+-- 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
function getAndSendMsg(human,id,actID)
|
|
|
- -- 判断活动是否开启
|
|
|
+ -- 锟叫断活动锟角凤拷锟斤拷
|
|
|
local state, endTime, starTime = AbsActLogic.isStarted(human, id)
|
|
|
if not state then return end
|
|
|
|
|
|
@@ -67,9 +67,9 @@ function getAndSendMsg(human,id,actID)
|
|
|
initDB(human,id)
|
|
|
|
|
|
local nowDay = Util.diffDay(starTime) + 1
|
|
|
- -- 构造数据
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
local msgRet = Msg.gc.GC_ABS_ND_TASK_QUERY
|
|
|
- -- 鼓数据
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷
|
|
|
local taskConfig = AbsActExcel.drum
|
|
|
local len = #taskConfig
|
|
|
local count = 0
|
|
|
@@ -94,7 +94,7 @@ function getAndSendMsg(human,id,actID)
|
|
|
end
|
|
|
end
|
|
|
msgRet.drumList[0] = count
|
|
|
- -- 炮数据
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷
|
|
|
taskConfig = AbsActExcel.blasting
|
|
|
len = #taskConfig
|
|
|
for i = 1,len do
|
|
|
@@ -106,14 +106,15 @@ function getAndSendMsg(human,id,actID)
|
|
|
net.needCnt = v.needCnt
|
|
|
net.nowCnt = absAct.blasting[i] and absAct.blasting[i].cnt or 0
|
|
|
net.state = absAct.blasting[i] and absAct.blasting[i].state or 0
|
|
|
- for j = 1,#v.item[nowDay] do
|
|
|
+ local itemLen = type(v.item[nowDay]) == "table" and #v.item[nowDay] or 0
|
|
|
+ for j = 1,itemLen do
|
|
|
Grid.makeItem(net.item[j],v.item[nowDay][j][1],v.item[nowDay][j][2])
|
|
|
end
|
|
|
- net.item[0] = #v.item[nowDay]
|
|
|
+ net.item[0] = itemLen --#v.item[nowDay]
|
|
|
net.panelID = v.panelID or 0
|
|
|
end
|
|
|
msgRet.blastingList[0] = len
|
|
|
- -- 宝箱数据
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
taskConfig = AbsActExcel.blastingBox
|
|
|
len = #taskConfig
|
|
|
for i = 1,len do
|
|
|
@@ -132,10 +133,10 @@ function getAndSendMsg(human,id,actID)
|
|
|
Msg.send(msgRet,human.fd)
|
|
|
end
|
|
|
|
|
|
--- 领取物品
|
|
|
--- type 1鼓,2炮,3箱
|
|
|
+-- 锟斤拷取锟斤拷品
|
|
|
+-- type 1锟斤拷,2锟斤拷,3锟斤拷
|
|
|
function get(human,index,type,id)
|
|
|
- -- 判断活动是否开起
|
|
|
+ -- 锟叫断活动锟角凤拷锟斤拷
|
|
|
local state, endTime, starTime = AbsActLogic.isStarted(human, id)
|
|
|
if not state then return end
|
|
|
|
|
|
@@ -151,7 +152,7 @@ function get(human,index,type,id)
|
|
|
local nowDay = Util.diffDay(starTime) + 1
|
|
|
local item = nil
|
|
|
|
|
|
- -- 选择对应类型
|
|
|
+ -- 选锟斤拷锟接︼拷锟斤拷锟�
|
|
|
local config = nil
|
|
|
local state = nil
|
|
|
if type == 1 then
|
|
|
@@ -165,24 +166,24 @@ function get(human,index,type,id)
|
|
|
state = absAct.box[index] or 0
|
|
|
end
|
|
|
|
|
|
- -- 传入参数错误
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�
|
|
|
if not config then
|
|
|
return
|
|
|
end
|
|
|
|
|
|
- -- 状态不为可领取
|
|
|
+ -- 状态锟斤拷为锟斤拷锟斤拷取
|
|
|
if state ~= 1 then
|
|
|
return
|
|
|
end
|
|
|
|
|
|
- -- 改变状态
|
|
|
+ -- 锟侥憋拷状态
|
|
|
if type == 1 then
|
|
|
item = config.item
|
|
|
absAct.drum[index].state = 2
|
|
|
elseif type == 2 then
|
|
|
item = config.item[nowDay]
|
|
|
absAct.blasting[index].state = 2
|
|
|
- -- 放炮一次,增加累计次数,并判断是否达到宝箱领取数值
|
|
|
+ -- 锟斤拷锟斤拷一锟斤拷,锟斤拷锟斤拷锟桔计达拷锟斤拷锟斤拷锟斤拷锟叫讹拷锟角凤拷锏斤拷锟斤拷锟斤拷锟饺★拷锟街�
|
|
|
absAct.blastingCnt = absAct.blastingCnt + 1
|
|
|
for i = 1,#AbsActExcel.blastingBox do
|
|
|
if absAct.blastingCnt - 1 < AbsActExcel.blastingBox[i].needCnt and absAct.blastingCnt == AbsActExcel.blastingBox[i].needCnt then
|
|
|
@@ -204,99 +205,100 @@ function get(human,index,type,id)
|
|
|
YunYingLogic.sendGroupUpdate(YYInfo[id], human, absConfig.panelID)
|
|
|
end
|
|
|
|
|
|
--- 每日任务活跃度
|
|
|
+-- 每锟斤拷锟斤拷锟斤拷锟皆撅拷锟�
|
|
|
function onDailyTask(human,funcID, parameter)
|
|
|
drumTaskCallBack(human,funcID,1,parameter)
|
|
|
end
|
|
|
|
|
|
--- 召唤
|
|
|
+-- 锟劫伙拷
|
|
|
function onDrawCard(human,funcID, parameter)
|
|
|
drumTaskCallBack(human,funcID,2,parameter)
|
|
|
end
|
|
|
|
|
|
--- 恶魔之塔
|
|
|
+-- 锟斤拷魔之锟斤拷
|
|
|
function onHuangjingTower(human,funcID, parameter)
|
|
|
drumTaskCallBack(human,funcID,3,parameter)
|
|
|
end
|
|
|
|
|
|
--- 充值
|
|
|
+-- 锟斤拷值
|
|
|
function onCharge(human, parameter,funcID)
|
|
|
- drumTaskCallBack(human,funcID,4,parameter)
|
|
|
+ -- 涓存椂澶勭悊
|
|
|
+ --drumTaskCallBack(human,funcID,4,parameter)
|
|
|
end
|
|
|
|
|
|
--- 勇者试炼
|
|
|
+-- 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
function onDrill(human,funcID, parameter)
|
|
|
drumTaskCallBack(human,funcID,5,parameter)
|
|
|
end
|
|
|
|
|
|
--- 女巫森林
|
|
|
+-- 女锟斤拷森锟斤拷
|
|
|
function onCopyChallenge(human,funcID, parameter)
|
|
|
drumTaskCallBack(human,funcID,6,parameter)
|
|
|
end
|
|
|
|
|
|
--- 冠军联赛
|
|
|
+-- 锟节撅拷锟斤拷锟斤拷
|
|
|
function onJjcFight(human,funcID, parameter)
|
|
|
drumTaskCallBack(human,funcID,7,parameter)
|
|
|
end
|
|
|
|
|
|
--- 随机商店购买
|
|
|
+-- 锟斤拷锟斤拷痰旯猴拷锟�
|
|
|
function onShopBuy(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,8,parameter)
|
|
|
end
|
|
|
|
|
|
--- 冒险扫荡
|
|
|
+-- 冒锟斤拷扫锟斤拷
|
|
|
function onMopup(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,9,parameter)
|
|
|
end
|
|
|
|
|
|
--- 冰龙巢穴
|
|
|
+-- 锟斤拷锟斤拷锟斤拷穴
|
|
|
function onBinglong(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,10,parameter)
|
|
|
end
|
|
|
|
|
|
--- 点金
|
|
|
+-- 锟斤拷锟�
|
|
|
function onExchangeJinbi(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,11,parameter)
|
|
|
end
|
|
|
|
|
|
--- 悬赏
|
|
|
+-- 锟斤拷锟斤拷
|
|
|
function onBarTaskgetDo(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,12,parameter)
|
|
|
end
|
|
|
|
|
|
--- 捐赠
|
|
|
+-- 锟斤拷锟斤拷
|
|
|
function onUnionDonate(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,13,parameter)
|
|
|
end
|
|
|
|
|
|
--- 公会副本
|
|
|
+-- 锟斤拷锟结副锟斤拷
|
|
|
function onUnionEctypeFight(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,14,parameter)
|
|
|
end
|
|
|
|
|
|
--- 占卜
|
|
|
+-- 占锟斤拷
|
|
|
function onZhanBuBuyCard(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,15,parameter)
|
|
|
end
|
|
|
|
|
|
--- 消耗钻石
|
|
|
+-- 锟斤拷锟斤拷锟斤拷石
|
|
|
function onDecZuanshi(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,16,parameter)
|
|
|
end
|
|
|
|
|
|
--- 绝望深渊
|
|
|
+-- 锟斤拷锟斤拷锟斤拷渊
|
|
|
function onLianyu(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,17,parameter)
|
|
|
end
|
|
|
|
|
|
--- 合成符文
|
|
|
+-- 锟较成凤拷锟斤拷
|
|
|
function onFuwenHecheng(human,funcID,parameter)
|
|
|
drumTaskCallBack(human,funcID,18,parameter)
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--- 回调
|
|
|
+-- 锟截碉拷
|
|
|
function drumTaskCallBack(human,id,type,cnt)
|
|
|
AbsActLogic.checkAbsActClean(human, id)
|
|
|
initDB(human,id)
|
|
|
@@ -307,7 +309,7 @@ function drumTaskCallBack(human,id,type,cnt)
|
|
|
if not absConfig then return end
|
|
|
|
|
|
local nowDay = Util.diffDay(starTime) + 1
|
|
|
- -- 完成任务,增加任务次数
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
local taskConfig = AbsActExcel.drum
|
|
|
for k = 1,#taskConfig do
|
|
|
if taskConfig[k].type == type and taskConfig[k].day == nowDay then
|
|
|
@@ -320,10 +322,10 @@ function drumTaskCallBack(human,id,type,cnt)
|
|
|
human.db.absAct[id].drum[taskID].cnt = human.db.absAct[id].drum[taskID].cnt - cnt
|
|
|
end
|
|
|
local config = AbsActExcel.drum[taskID]
|
|
|
- -- 鼓任务达成
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
if human.db.absAct[id].drum[taskID].cnt >= config.needCnt and human.db.absAct[id].drum[taskID].state == 0 then
|
|
|
human.db.absAct[id].drum[taskID].state = 1
|
|
|
- -- 判断是否达成炮任务
|
|
|
+ -- 锟叫讹拷锟角凤拷锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
for i = 1,#config.blasting do
|
|
|
local blastingID = config.blasting[i]
|
|
|
local blastingConfig = AbsActExcel.blasting[blastingID]
|
|
|
@@ -343,7 +345,7 @@ function drumTaskCallBack(human,id,type,cnt)
|
|
|
YunYingLogic.sendGroupUpdate(YYInfo[id], human, absConfig.panelID)
|
|
|
end
|
|
|
|
|
|
--- 每日重置鼓,炮状态
|
|
|
+-- 每锟斤拷锟斤拷锟矫鼓o拷锟斤拷状态
|
|
|
function updateDaily(human,id)
|
|
|
local state, endTime, starTime = AbsActLogic.isStarted(human, id)
|
|
|
if not state then return end
|
|
|
@@ -390,9 +392,9 @@ function isRed(human, YYInfo, funcConfig)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
--- 购买补领
|
|
|
+-- 锟斤拷锟斤拷锟斤拷
|
|
|
function buling(human,funcID,conf)
|
|
|
- -- 将达标次数设为30次
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷为30锟斤拷
|
|
|
AbsActLogic.checkAbsActClean(human, funcID)
|
|
|
initDB(human,funcID)
|
|
|
local absConfig = AbsActExcel.absActivity[funcID]
|