|
|
@@ -77,6 +77,7 @@ DRAWCARD_ID11 = 11 -- 新英雄活动40抽必出
|
|
|
|
|
|
DRAWCARD_OP_1 = 1 -- 召唤1次
|
|
|
DRAWCARD_OP_2 = 2 -- 召唤10次
|
|
|
+DRAWCARD_OP_3 = 3 -- 召唤100次
|
|
|
|
|
|
DRAWCARD_JIFEN_NEED_VIPLV = 3
|
|
|
DRAWCARD_JIFEN_SHOW_ITEM = 801005
|
|
|
@@ -299,17 +300,43 @@ function fontDrawCardNet(net, id, human)
|
|
|
Grid.makeItem(net.items[net.items[0]], config.item2[1], finalItemCnt )
|
|
|
end
|
|
|
|
|
|
+ vipArg = 100
|
|
|
+ itemCnt, finalItemCnt = 0, 0
|
|
|
+ if config.item3[1] and config.item3[2] then
|
|
|
+ if id == DRAWCARD_ID2 then -- 目前只有高抽和精英两种模式有100抽
|
|
|
+ vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER23)
|
|
|
+ end
|
|
|
+
|
|
|
+ net.items[0] = net.items[0] + 1
|
|
|
+ itemCnt = math.floor(config.item3[2] * vipArg / 100 )
|
|
|
+ finalItemCnt = itemCnt
|
|
|
+ if id == DRAWCARD_ID8 then
|
|
|
+ local talisman_jyzh_lotter100 = getTalismanAdd(human)
|
|
|
+ finalItemCnt = math.floor(finalItemCnt * talisman_jyzh_lotter100)
|
|
|
+ end
|
|
|
+ Grid.makeItem(net.items[net.items[0]], config.item3[1], finalItemCnt)
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
vipArg = 0
|
|
|
if id == DRAWCARD_ID2 then
|
|
|
vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER22)
|
|
|
end
|
|
|
|
|
|
- net.zuanshi[0] = 2
|
|
|
+ net.zuanshi[0] = 3
|
|
|
net.zuanshi[1] = config.zuanshi1
|
|
|
net.zuanshi[2] = config.zuanshi2 + vipArg
|
|
|
+ net.zuanshi[3] = config.zuanshi3 or 0
|
|
|
+
|
|
|
+ vipArg = 0
|
|
|
+ if id == DRAWCARD_ID2 and net.zuanshi[3] > 0 then -- 目前只有高抽和精英两种模式有100抽
|
|
|
+ vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER24)
|
|
|
+ net.zuanshi[3] = net.zuanshi[3] + vipArg
|
|
|
+ end
|
|
|
|
|
|
if id == DRAWCARD_ID8 then
|
|
|
net.zuanshi[2] = math.floor((net.zuanshi[2] / itemCnt) * finalItemCnt)
|
|
|
+ net.zuanshi[3] = math.floor((net.zuanshi[3] / itemCnt) * finalItemCnt)
|
|
|
end
|
|
|
|
|
|
net.isFirst = (getDraw2Cnt(human, id) < 1) and 1 or 0
|
|
|
@@ -341,6 +368,62 @@ function query(human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
|
|
|
|
+
|
|
|
+local function sendHeroData(human, heroList, items, heroNewList, heroIndexList)
|
|
|
+ heroList = heroList or {}
|
|
|
+ local itemArr = {}
|
|
|
+ for itemId, itemNum in pairs(items or {}) do
|
|
|
+ itemArr[#itemArr+1] = {itemId, itemNum}
|
|
|
+ end
|
|
|
+
|
|
|
+ local len = 0
|
|
|
+ local msgMaxLen = 30
|
|
|
+ local maxLen = math.max(#heroList, #itemArr)
|
|
|
+
|
|
|
+ local msgRet = Msg.gc.GC_DRAWCARD_OP2
|
|
|
+ msgRet.heros[0] = 0
|
|
|
+ msgRet.items[0] = 0
|
|
|
+ msgRet.isEnd = 0
|
|
|
+
|
|
|
+ for i=1, math.max(#heroList, #itemArr) do
|
|
|
+ len = len + 1
|
|
|
+ local heroID = heroList[i]
|
|
|
+ if heroID then
|
|
|
+ msgRet.heros[0] = len
|
|
|
+ local isNew = heroNewList and heroNewList[i]
|
|
|
+ local index = heroIndexList and heroIndexList[i]
|
|
|
+ HeroGrid.makeHeroNice(msgRet.heros[len], heroID, nil, isNew, index, human)
|
|
|
+ end
|
|
|
+
|
|
|
+ local itemInfo = itemArr[i]
|
|
|
+ if itemInfo then
|
|
|
+ msgRet.items[0] = len
|
|
|
+ Grid.makeItem(msgRet.items[len], itemInfo[1], itemInfo[2])
|
|
|
+ end
|
|
|
+
|
|
|
+ if len >= msgMaxLen then
|
|
|
+ maxLen = maxLen - len
|
|
|
+ if maxLen <= 0 then
|
|
|
+ msgRet.isEnd = 1
|
|
|
+ return Msg.send(msgRet, human.fd)
|
|
|
+ end
|
|
|
+
|
|
|
+ Msg.send(msgRet, human.fd)
|
|
|
+
|
|
|
+ len = 0
|
|
|
+ msgRet.heros[0] = len
|
|
|
+ msgRet.items[0] = len
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ if len > 0 then
|
|
|
+ msgRet.isEnd = 1
|
|
|
+ Msg.send(msgRet, human.fd)
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
-- 抽奖结果
|
|
|
function sendDrawOp(human, id, op, heroList, items, heroNewList, heroIndexList,isAct)
|
|
|
local msgRet = Msg.gc.GC_DRAWCARD_OP
|
|
|
@@ -353,23 +436,32 @@ function sendDrawOp(human, id, op, heroList, items, heroNewList, heroIndexList,i
|
|
|
dataNet.jifen = getJifen(human)
|
|
|
dataNet.id = id
|
|
|
dataNet.op = op
|
|
|
- dataNet.heros[0] = heroList and #heroList or 0
|
|
|
- for i = 1, dataNet.heros[0] do
|
|
|
- local heroID = heroList[i]
|
|
|
- local isNew = heroNewList and heroNewList[i]
|
|
|
- local index = heroIndexList and heroIndexList[i]
|
|
|
- HeroGrid.makeHeroNice(dataNet.heros[i], heroID, nil, isNew, index, human)
|
|
|
- end
|
|
|
- dataNet.items[0] = 0
|
|
|
- if items and type(items) == "table" then
|
|
|
- for itemID, itemCnt in pairs(items) do
|
|
|
- dataNet.items[0] = dataNet.items[0] + 1
|
|
|
- Grid.makeItem(dataNet.items[dataNet.items[0]], itemID, itemCnt)
|
|
|
+ if op == DRAWCARD_OP_3 then
|
|
|
+ dataNet.heros[0] = 0
|
|
|
+ dataNet.items[0] = 0
|
|
|
+ else
|
|
|
+ dataNet.heros[0] = heroList and #heroList or 0
|
|
|
+ for i = 1, dataNet.heros[0] do
|
|
|
+ local heroID = heroList[i]
|
|
|
+ local isNew = heroNewList and heroNewList[i]
|
|
|
+ local index = heroIndexList and heroIndexList[i]
|
|
|
+ HeroGrid.makeHeroNice(dataNet.heros[i], heroID, nil, isNew, index, human)
|
|
|
+ end
|
|
|
+ dataNet.items[0] = 0
|
|
|
+ if items and type(items) == "table" then
|
|
|
+ for itemID, itemCnt in pairs(items) do
|
|
|
+ dataNet.items[0] = dataNet.items[0] + 1
|
|
|
+ Grid.makeItem(dataNet.items[dataNet.items[0]], itemID, itemCnt)
|
|
|
+ end
|
|
|
end
|
|
|
end
|
|
|
|
|
|
fontDrawCardNet(msgRet.drawData, id, human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
|
+
|
|
|
+ if op == DRAWCARD_OP_3 then
|
|
|
+ sendHeroData(human, heroList, items, heroNewList, heroIndexList)
|
|
|
+ end
|
|
|
end
|
|
|
|
|
|
-- 积分召唤
|
|
|
@@ -410,8 +502,8 @@ function checkUseItem(human, id, op, config,isAct)
|
|
|
local itemCnt = item[2]
|
|
|
local finalItemCnt = itemCnt
|
|
|
|
|
|
- --精英召唤10连抽的处理
|
|
|
- if id == DRAWCARD_ID8 and op == DRAWCARD_OP_2 then
|
|
|
+ --精英召唤10, 100连抽的处理
|
|
|
+ if id == DRAWCARD_ID8 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) then
|
|
|
--秘宝对精英召唤10连的增益
|
|
|
local talisman_jyzh_lotter10 = getTalismanAdd(human)
|
|
|
finalItemCnt = math.floor(finalItemCnt * talisman_jyzh_lotter10)
|
|
|
@@ -422,9 +514,13 @@ function checkUseItem(human, id, op, config,isAct)
|
|
|
end
|
|
|
|
|
|
|
|
|
- if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 then
|
|
|
+ if id == DRAWCARD_ID2 then
|
|
|
local vipArg = 100
|
|
|
- vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER21)
|
|
|
+ if op == DRAWCARD_OP_2 then
|
|
|
+ vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER21)
|
|
|
+ elseif op == DRAWCARD_OP_3 then
|
|
|
+ vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER23)
|
|
|
+ end
|
|
|
print(" checkUseItem vipArg ", vipArg, " , old : " ,itemCnt , " , new : ", math.floor(itemCnt * vipArg / 100 ) )
|
|
|
finalItemCnt = math.floor(itemCnt * vipArg / 100 )
|
|
|
end
|
|
|
@@ -485,8 +581,12 @@ function checkUseItem(human, id, op, config,isAct)
|
|
|
local haveCnt = BagLogic.getItemCnt(human, itemID)
|
|
|
|
|
|
local vipArg = 0
|
|
|
- if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 then
|
|
|
- vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER22)
|
|
|
+ if id == DRAWCARD_ID2 then
|
|
|
+ if op == DRAWCARD_OP_2 then
|
|
|
+ vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER22)
|
|
|
+ elseif op == DRAWCARD_OP_3 then
|
|
|
+ vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER24)
|
|
|
+ end
|
|
|
end
|
|
|
zuanshi = zuanshi + vipArg
|
|
|
if haveCnt > 0 then
|
|
|
@@ -495,7 +595,7 @@ function checkUseItem(human, id, op, config,isAct)
|
|
|
end
|
|
|
|
|
|
if not ObjHuman.checkRMB(human, zuanshi) then
|
|
|
- return
|
|
|
+ return Broadcast.sendErr(human, Lang.COMMON_NO_ZUANSHI)
|
|
|
end
|
|
|
if haveCnt > 0 then
|
|
|
BagLogic.delItem(human, itemID, haveCnt, "draw_card")
|
|
|
@@ -618,6 +718,8 @@ local function draw(human, id, op, actConfig, skip,isAct)
|
|
|
heroCnt = 1
|
|
|
elseif op == DRAWCARD_OP_2 then
|
|
|
heroCnt = 10
|
|
|
+ elseif op == DRAWCARD_OP_3 then
|
|
|
+ heroCnt = 100
|
|
|
else
|
|
|
return
|
|
|
end
|
|
|
@@ -663,14 +765,14 @@ local function draw(human, id, op, actConfig, skip,isAct)
|
|
|
for i = 1, heroCnt do
|
|
|
config = DrawCardExcel[id]
|
|
|
-- if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 and i == randomMin and getDraw2Cnt(human, id) > 3 then
|
|
|
- if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 and i == randomMin then
|
|
|
+ if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and i == randomMin then
|
|
|
config = DrawCardExcel[DRAWCARD_ID5]
|
|
|
elseif id == DRAWCARD_ID2 and op == DRAWCARD_OP_1 then
|
|
|
config = DrawCardExcel[DRAWCARD_ID6]
|
|
|
end
|
|
|
|
|
|
|
|
|
- if id == DRAWCARD_ID8 and op == DRAWCARD_OP_2 and i == randomMin then
|
|
|
+ if id == DRAWCARD_ID8 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and i == randomMin then
|
|
|
config = DrawCardExcel[DRAWCARD_ID10]
|
|
|
end
|
|
|
|
|
|
@@ -680,7 +782,7 @@ local function draw(human, id, op, actConfig, skip,isAct)
|
|
|
end
|
|
|
|
|
|
-- 高级召唤前5次10连每轮必出SSR
|
|
|
- if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 and getDraw2Cnt(human, id) < DRAWCARD_ID2_CNT and i ~= randomMin and tag == 0 then
|
|
|
+ if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and getDraw2Cnt(human, id) < DRAWCARD_ID2_CNT and i ~= randomMin and tag == 0 then
|
|
|
config = DrawCardExcel[DRAWCARD_ID7]
|
|
|
tag = 1
|
|
|
end
|