Browse Source

高抽增加100抽功能

gitxsm 3 weeks ago
parent
commit
0a723099d3

+ 1 - 0
script/common/ProtoID.lua

@@ -1736,6 +1736,7 @@ _ENV[1776]="GC_ZHUANPAN_ONCE_REWARD_QUERY"
 _ENV[1777]="CG_ZHUANPAN_ONCE_REWARD_GET"
 _ENV[1778]="CG_ALL_HERO_BOOK_QUERY"
 _ENV[1779]="GC_ALL_HERO_BOOK_QUERY"
+_ENV[1780]="GC_DRAWCARD_OP2"
 _ENV[1781]="CG_SERVEERCOMMERCE_ACT_BATTLEGROUND_MAINPAGE_QUERY"
 _ENV[1782]="GC_SERVEERCOMMERCE_ACT_BATTLEGROUND_MAINPAGE_QUERY"
 _ENV[1783]="CG_SERVEERCOMMERCE_ACT_BATTLEGROUND_MATCHLIST_QUERY"

+ 125 - 23
script/module/drawCard/DrawCardLogic.lua

@@ -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

+ 8 - 2
script/module/drawCard/Proto.lua

@@ -8,7 +8,7 @@ DrawCardNet = {
 	{"leftFreeTime",1,		"int"},	   -- 免费倒计时
 	{"leftFreeCnt",	1,		"int"},	   -- 剩余免费次数
 	{"items",		3,		ItemData}, -- {1次消耗道具,10次消耗道具}
-	{"zuanshi",		3,		"short"},  -- {1次消耗钻石,10次消耗钻石}0为不能用钻石
+	{"zuanshi",		3,		"int"},  -- {1次消耗钻石,10次消耗钻石}0为不能用钻石
 	{"isFirst",		1,		"byte"},   -- 是否首次十连
 	{"canBuy",		1,		"byte"},   -- 可否购买
 }
@@ -27,7 +27,7 @@ GC_DRAWCARD_QUERY = {
 
 CG_DRAWCARD_OP = {
 	{"id",				1,		"byte"}, --1 基础召唤 2 高级召唤 3 友情召唤 0 积分召唤
-	{"op",				1,		"byte"}, --1 1次 2 10次
+	{"op",				1,		"byte"}, --1 1次 2 10次, 3-100次
     {"skip",		    1,		"byte"}, --是否跳过
     {"isAct",           1,      "int"}, --是否选取up活动
 }
@@ -50,6 +50,12 @@ GC_DRAWCARD_OP = {
 	{"nHighCnt",		1,		"int"},		-- 高级抽卡次数
 }
 
+GC_DRAWCARD_OP2 = {
+	{"heros",			30,		HeroNiceNet},	-- 召唤获得英雄
+    {"items",			30,		ItemData}, 		-- 自动分解获得道具
+	{"isEnd",			1,		"byte"},		-- 是否发完, 0-没有, 1-发完
+}
+
 CG_DRAWCARD_SKIP_SET = {
 	{"skip",		    1,		"byte"},   -- 是否跳过
 }

+ 3 - 0
script/module/vip/VipLogic.lua

@@ -45,6 +45,9 @@ VIP_POWER19 = 19	-- o
 -- VIP_POWER20 = 21	-- o激活专属背景
 VIP_POWER21 = 21	-- o抽卡 卷轴折扣特权
 VIP_POWER22 = 22    -- o抽卡 钻石特权
+
+VIP_POWER23 = 23	-- 100抽卡 卷轴折扣特权
+VIP_POWER24 = 24    -- 100抽卡 钻石特权
 -- 礼包状态
 local LIBAO_STATE_CANT = 0 		-- 不可购买
 local LIBAO_STATE_CAN = 1 		-- 可购买