瀏覽代碼

主线二队

gitxsm 10 月之前
父節點
當前提交
02ce2cdb24

+ 6 - 1
script/common/Lang.lua

@@ -783,4 +783,9 @@ BATTLE_GET_MOPUPNUM = [[你获得{1}次主线扫荡次数]]
 HEROPUB_STAR_NOT_ENOUGH = [[星级不足]]
 
 JJCNEWLADDERNOFIGHT = [[当前挑战角色正在战斗中稍后重试]]
-JJCNEWLADDERNOOPEN = [[当前不在活动时间]]
+JJCNEWLADDERNOOPEN = [[当前不在活动时间]]
+
+HELP_HERO_NOT_ACTIVATE = [[援军未激活]]
+POS_ERROR = [[位置错误]]
+HERO_SAME = [[已有相同英雄上阵]]
+NO_HERO = [[没有符合的英雄]]

+ 1 - 1
script/module/bag/BagLogic.lua

@@ -115,7 +115,7 @@ function addItem(human, id, cnt, logType, noSend, otherData)
 		sendChange(human, id, oldCnt < 1)
 		print("send charge 下发逻辑")
 	end	
-	Log.write(Log.LOGID_OSS_ITEM, human.db._id, human.db.account, human.db.name, human.db.lv, 
+	Log.write(Log.LOGID_OSS_ITEM, human.db._id, human.db.account, human.db.name, human.db.lv,
 		LogDefine.DEFINE[logType] + LogDefine.TYPE["item"] , id, cnt, newCnt)
 		
     -- 如果道具为公会贡献,记录到当日累计贡献中

+ 315 - 69
script/module/battle/BattleLogic.lua

@@ -72,6 +72,8 @@ local CombatImpl = require("combat.CombatImpl")
 local battleRougeCfg = require("excel.battleRouge").Sheet1
 local WeekTaskLogic = require("dailyTask.WeekTaskLogic")
 local TreasureChestLogic = require("treasurechest.TreasureChestLogic")
+-- local RoleStorageBox = require("roleSystem.RoleStorageBox")
+
 
 BATTLE_HANG_EXP_OUT_PERIOD = 60 -- 经验产出时间间隔
 BATTLE_HANG_ITEM_OUT_PERIOD = 300 -- 战利品道具产出时间间隔
@@ -154,27 +156,25 @@ local function fontBattleSkillNet(skillNet, skillID)
     return true
 end
 
--- 
+
+-- 处理策划修改开放不同模式条件的函数
 local function initBattleSpeData(human)
     human.db.battleSpeData = {
         [EliteDefine.COPY_ELITE_NORMAL] = true
     }
 end
 
--- 
+-- 处理策划修改开放不同模式条件的函数
 local function getBattleSpeData(human)
     return human.db.battleSpeData
 end
 
-
+-- 处理策划修改开放不同模式条件的函数
 local function updateBattleSpeData(human, modeType, state)
     human.db.battleSpeData[modeType] = state
 end
 
 
-
-
-
 -- 获取当前战役类型
 local function BattleLogic_GetBattleType(human)
     if not human then
@@ -275,6 +275,18 @@ local function BattleLogic_SetBattleBattleID(human, nValue)
     return true
 end
 
+-- 设置 某个模式 战役即将战斗id
+local function setBattleBattleIDByType(human, nBattleType, nValue)
+    if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
+        human.db.battleID = nValue
+    elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
+        human.db.battleID_elite = nValue
+    elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
+        human.db.battleID_hard = nValue
+    end
+end
+
+
 -- 获取当前战役 已通关关卡/挂机关卡
 local function BattleLogic_GetBattleGuaJiID(human)
     if not human then
@@ -354,6 +366,145 @@ local function BattleLogic_SetBattleGuaJiID(human, nValue)
     return true
 end
 
+-- 设置某个模式 已通关关卡/挂机关卡
+local function setBattleGuaJiIDByType(human, nBattleType, nValue)
+    if not human or 0 > nValue then
+        return false
+    end
+
+    if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
+        human.db.guajiID = nValue
+    elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
+        human.db.guajiID_elite = nValue
+    elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
+        human.db.guajiID_hard = nValue
+    end
+end
+
+
+-- 获取配置信息
+local function BattleLogic_GetBattleConfig(human)
+    if not human then
+        Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleConfig 参数不正确")
+        return nil
+    end
+
+    local nBattleType = BattleLogic_GetBattleType(human)
+    if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
+        Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleConfig 获取到的战斗类型不正确 id = "
+                    ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
+        return nil
+    end
+
+    if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
+        return BattleExcel
+    elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
+        return BattleExcel_Elite
+    elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
+        return BattleExcel_Hard
+    else
+        Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiID 未处理的战斗类型 id = "
+        ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
+        return nil
+    end
+end
+
+-- 获取某个闯关模式的配置
+local function getBattleCfgByType(nBattleType)
+        if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
+        return BattleExcel
+    elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
+        return BattleExcel_Elite
+    elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
+        return BattleExcel_Hard
+    end
+end
+
+
+------------------------------------------------多队伍挑战相关------------------------------------
+
+-- 是否开启多队伍挑战
+local function isOpenOtherTeam(human)
+    local nowBattleID = BattleLogic_GetBattleBattleID(human)
+    if nowBattleID >= EliteDefine.OPEN_OTHER_TEAM_LEVEL then
+        return true
+    end
+
+    return false
+end
+
+-- 更新当前模式的出战队伍记录
+local function updateTeamRecord(human, teamIdx)
+    human.teamRecord = human.teamRecord or {}
+
+    local teamRecord = human.teamRecord
+    local nBattleType = BattleLogic_GetBattleType(human)
+    teamRecord[nBattleType] = teamRecord[nBattleType] or {}
+
+    teamRecord[nBattleType][teamIdx] = 1
+end
+
+-- 重置当前模式的出战队伍记录
+local function resetTeamRecord(human)
+    if not human.teamRecord then
+        return
+    end
+
+    local nBattleType = BattleLogic_GetBattleType(human)
+    human.teamRecord[nBattleType] = nil
+end
+
+
+-- 当前应该是第几支队伍出战。 目前闯关最多有三支队伍
+local function getTeamIdx(human)
+    local teamIdx = 1
+
+    if not isOpenOtherTeam(human) then
+        return teamIdx
+    end
+
+    local nBattleType = BattleLogic_GetBattleType(human)
+
+    local teamRecord = human.teamRecord
+    if teamRecord and teamRecord[nBattleType] then
+        teamIdx = #teamRecord[nBattleType] + 1
+    end
+
+    print("====================getTeamIdx=====================", teamIdx)
+
+    return teamIdx
+end
+
+-- 获取当前出战阵容类型
+local function getCombatTypeByTeamIdx(teamIdx)
+    if teamIdx == 1 then
+        return CombatDefine.COMBAT_TYPE1
+    elseif teamIdx == 2 then
+        return CombatDefine.COMBAT_TYPE30
+    else
+        -- assert(false, "错误类型")
+
+        return CombatDefine.COMBAT_TYPE1
+    end
+end
+
+-- 获取当前模式下当前关卡需要的队伍数量
+local function getLevelTeamCnt(human)
+    local teamCnt = 1
+    local nowBattleID = BattleLogic_GetBattleBattleID(human)
+    if nowBattleID >= EliteDefine.OPEN_OTHER_TEAM_LEVEL then
+        local cfg = BattleLogic_GetBattleConfig(human)
+        local singleCfg = cfg.node[nowBattleID]
+        teamCnt = #singleCfg.monsterOutID
+    end
+
+    return teamCnt
+end
+
+-----------------------------------------------------------------------------------------------------
+
+
+
 
 -----------------------------------------------------肉鸽玩法-----------------------------------------------------
 
@@ -810,32 +961,6 @@ local function BattleLogic_InitAllBattleOut(human, now)
     return true
 end
 
--- 获取配置信息
-local function BattleLogic_GetBattleConfig(human)
-    if not human then
-        Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleConfig 参数不正确")
-        return nil
-    end
-
-    local nBattleType = BattleLogic_GetBattleType(human)
-    if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
-        Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleConfig 获取到的战斗类型不正确 id = "
-                    ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
-        return nil
-    end
-
-    if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
-        return BattleExcel
-    elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
-        return BattleExcel_Elite
-    elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
-        return BattleExcel_Hard
-    else
-        Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiID 未处理的战斗类型 id = "
-        ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
-        return nil
-    end
-end
 
 -- 根据战斗类型获取配置
 local function BattleLogic_GetBattleConfigByType(nBattleType)
@@ -981,7 +1106,6 @@ local function BattleLogic_SetBattleAdopt(human, nBattleType, nValue)
         return
     end
 
-    print("[BattleLogic_SetBattleAdopt] 玩家通过战役 nBattleType = "..nBattleType.." nValue = "..nValue)
     if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
         human.db.battleadopt = nValue
     elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
@@ -1123,6 +1247,21 @@ local function isOpenModeByOldCond(human, nSelectDiff)
     return nChoseBattleID > EliteDefine.COPY_ELITE_LEVEL_OLD and true or false
 end
 
+-- 修正三个模式中已经通关的模式的battleID, GuajiaID
+local function restoreReallyBattleID(human)
+    for i=EliteDefine.COPY_ELITE_NORMAL, EliteDefine.COPY_ELITE_DIFFICULTY do
+        local tag = BattleLogic_GetBattleAdopt(human, i)
+        local nowBattleID = BattleLogic_GetBattleIDByType(human, i)
+        local battleCfg = getBattleCfgByType(i)
+        if tag == 1 and #battleCfg.node > nowBattleID then
+            setBattleGuaJiIDByType(human, i, nowBattleID)
+
+            setBattleBattleIDByType(human, i, nowBattleID+1)
+        end
+    end
+end
+
+
 
 
 function onLogin(human)
@@ -1170,6 +1309,8 @@ function onLogin(human)
     end
 
 
+    restoreReallyBattleID(human)
+
 
     if human.db.lv >= BATTLE_LOGIN_LEV_TIPS then
         return
@@ -1387,7 +1528,11 @@ function hangFightQuery(human)
     -- local battleID = human.db.battleID > #BattleExcel.node and #BattleExcel.node or human.db.battleID
     local battleID = nBattleID > #tBattleExcel.node and #tBattleExcel.node or nBattleID
     local nowNodeConfig = tBattleExcel.node[battleID]
-    local monsterOutID = nowNodeConfig.monsterOutID
+    -- local monsterOutID = nowNodeConfig.monsterOutID
+    
+    local teamIdx = getTeamIdx(human)
+    local monsterOutID = nowNodeConfig.monsterOutID[teamIdx]
+
     local monsterOutConfig = MonsterExcel.monsterOut[monsterOutID]
     local msgRet = Msg.gc.GC_BATTLE_HANG_FIGHT
     local len = 0
@@ -1667,8 +1812,9 @@ function query(human)
         nNowGuaJiID = configNode
         BattleLogic_SetBattleGuaJiID(human, nNowGuaJiID)
     end
-    
+
     local nBattleAdopt = BattleLogic_GetBattleAdopt(human, nBattleType)
+
     if nBattleAdopt == 1 then
         print("[query] nNowBattleID 为最大值 nNowBattleID = "
                 ..nNowBattleID.." nNowGuaJiID = "..nNowGuaJiID.." nBattleType = "..nBattleType)
@@ -1804,7 +1950,11 @@ function query(human)
         msgRet.canMopup = 1
     end
 
-    local monsterOutId = nowNodeConfig.monsterOutID
+    -- local monsterOutId = nowNodeConfig.monsterOutID
+
+    local teamIdx = getTeamIdx(human)
+    local monsterOutId = nowNodeConfig.monsterOutID[teamIdx]
+
     if not monsterOutId then
         print("[BattleLogic query] monsterOutId 为空")
         return
@@ -2266,7 +2416,6 @@ function calcBattleExpOut(human, now)
 
     -- tBattleOut.qingbao = tBattleOut.qingbao + math.ceil(tBattleOut.qingbao * talismanAdd_qb)
     -- tBattleOut.greenExp = tBattleOut.greenExp + math.ceil(tBattleOut.greenExp * talismanAdd_hero_exp)
-
 end
 
 -- 根据时间计算道具产出
@@ -2508,7 +2657,11 @@ local function hangExpGet(human,isDiamond)
     for i = 1, #items do
         local tempID = items[i].id
         local tempCnt = items[i].cnt
+
+        -- tempCnt = RoleStorageBox.GetFinalItemCnt(human, tempID, tempCnt, "battle")
+
         BagLogic.addItem(human, tempID, tempCnt, "battle")
+
     end
 
     -- 给装备
@@ -2709,11 +2862,16 @@ function fight(human)
 
 
     local config = tBattleConfig.node[battleID]
-    local mapConfig = tBattleConfig.map[config.mapID]
-    local monsterOutID = config.monsterOutID
-    local mapID = mapConfig.bg
-    CombatLogic.combatBegin(human, config.sceneID, monsterOutID, CombatDefine.COMBAT_TYPE1, battleID)
-
+    -- local mapConfig = tBattleConfig.map[config.mapID]
+    -- local monsterOutID = config.monsterOutID
+    -- local mapID = mapConfig.bg
+    -- CombatLogic.combatBegin(human, config.sceneID, monsterOutID, CombatDefine.COMBAT_TYPE1, battleID)
+    -- GuideLogic.setDoSpecialGuide(human, GuideLogic.SKIPTYPE_JUMP_BATTLE)
+
+    local teamIdx = getTeamIdx(human)
+    local monsterOutID = config.monsterOutID[teamIdx]
+    local combatType = getCombatTypeByTeamIdx(teamIdx)
+    CombatLogic.combatBegin(human, config.sceneID, monsterOutID, combatType, battleID)
     GuideLogic.setDoSpecialGuide(human, GuideLogic.SKIPTYPE_JUMP_BATTLE)
 end
 
@@ -2721,10 +2879,21 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
     -- 设置一些战斗结算信息
     combatInfo.defender.name = Util.format(Lang.COMBAT_BATTLE_DEFEND_NAME, param1)
 
+    -- if CombatDefine.RESULT_WIN ~= result then
+    --     return
+    -- end
+
+    local bl = isOpenOtherTeam(human)
+
     if CombatDefine.RESULT_WIN ~= result then
+        if bl then
+            resetTeamRecord(human)
+        end
+
         return
     end
 
+
     local nBattleType = BattleLogic_GetBattleType(human)
     local guajiID = BattleLogic_GetBattleGuaJiID(human)
     local battleID = BattleLogic_GetBattleBattleID(human)
@@ -2750,6 +2919,22 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
         return
     end
 
+    -- 如果当前关卡是多队伍关卡,则需要所有队伍都胜利才算通关
+    if bl then
+        local needTeamCnt = getLevelTeamCnt(human)
+        local nowTeamIdx = getTeamIdx(human)
+
+        if needTeamCnt <= nowTeamIdx then
+            resetTeamRecord(human)
+        else
+            updateTeamRecord(human, nowTeamIdx)
+            local nextTeamIdx = getTeamIdx(human)
+            combatInfo.nextCombatType = getCombatTypeByTeamIdx(nextTeamIdx)
+            return
+        end
+    end
+
+
     if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
         MainDianLogic.MaiDian_Begin(human, MaiDianDefine.MAIDIAN_TYPE_BATTLE, {nValue = battleID})
     end
@@ -2824,9 +3009,14 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
     for i = 1, #config.winReward do
         local itemID = config.winReward[i][1]
         local itemCnt = config.winReward[i][2]
+
+        local sourceId = 0
+        -- itemCnt, sourceId = RoleStorageBox.GetFinalItemCnt(human, itemID, itemCnt, "battle")
+
         -- 装备不在这显示
         combatInfo.rewardItem[i] = combatInfo.rewardItem[i] or { }
-        combatInfo.rewardItem[i] = { itemID, itemCnt }
+        -- combatInfo.rewardItem[i] = { itemID, itemCnt }
+        combatInfo.rewardItem[i] = { itemID, itemCnt, [4] = sourceId}
         BagLogic.addItem(human, itemID, itemCnt, "battle_win")
     end
     combatInfo.attacker.lv = human.db.lv
@@ -3329,9 +3519,13 @@ function mopupFight(human)
             itemCnt = itemCnt + math.ceil(itemCnt * talismanAdd_zs)
         end
 
+        local sourceId = 0
+        -- itemCnt, sourceId = RoleStorageBox.GetFinalItemCnt(human, itemID, itemCnt, "battle")
+
         if not ItemDefine.isEquip(itemID) then
             msgRet.item[0] = msgRet.item[0] + 1
-            Grid.makeItem(msgRet.item[msgRet.item[0]], itemID, itemCnt)
+            -- Grid.makeItem(msgRet.item[msgRet.item[0]], itemID, itemCnt)
+            Grid.makeItem(msgRet.item[msgRet.item[0]], itemID, itemCnt, nil, nil, nil, nil, nil, nil, sourceId)
         end
 
         BagLogic.addItem(human, itemID, itemCnt, "battle")
@@ -3631,7 +3825,10 @@ function getCombatMonsterOutID(human, side)
         return
     end
 
-    return config.monsterOutID
+    -- return config.monsterOutID
+
+    local teamIdx = getTeamIdx(human)
+    return config.monsterOutID[teamIdx]
 end
 
 function getCombatName(human)
@@ -3755,7 +3952,10 @@ function getBattleMonsterOutID(human)
     -- local battleID = human.db.battleID
     -- local config = BattleExcel.node[battleID]
     local config = tBattleExcel.node[nBattleID]
-    return config.monsterOutID
+    -- return config.monsterOutID
+
+    local teamIdx = getTeamIdx(human)
+    return config.monsterOutID[teamIdx]
 end
 
 function onUpdatePos(human)
@@ -3795,10 +3995,10 @@ function battleChapterReward(human, mapID)
         return
     end
 
-    local mapConf = tBattleConfig.map[mapID]
-    if not mapConf then
-        return
-    end
+    -- local mapConf = tBattleConfig.map[mapID]
+    -- if not mapConf then
+    --     return
+    -- end
 
     -- 没有通过当前大关卡
     local battleID = nBattleID
@@ -3814,32 +4014,62 @@ function battleChapterReward(human, mapID)
         roleMapId = battleNodeConfig.mapID
     end
 
-    if mapID > roleMapId then
-        return
-    end
+    -- if mapID > roleMapId then
+    --     return
+    -- end
 
-    -- if not human.db.chapterReward then
-    --     human.db.chapterReward = { }
+    -- -- if not human.db.chapterReward then
+    -- --     human.db.chapterReward = { }
+    -- -- end
+
+    -- -- 判断是否已经领取了当前大关卡的奖励
+    -- -- local chapterReward = human.db.chapterReward
+    -- local chapterReward = tChapterReward
+
+    -- if chapterReward[mapID] then
+    --     return Broadcast.sendErr(human, Lang.FRIEND_HEART_GET_HAD)
     -- end
 
-    -- 判断是否已经领取了当前大关卡的奖励
-    -- local chapterReward = human.db.chapterReward
-    local chapterReward = tChapterReward
+    -- chapterReward[mapID] = true
+    -- ObjHuman.save(human)
+
+    -- local reward = mapConf.reward
+    -- BagLogic.addItemList(human, reward, "chapterReward")
+    -- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1105)
+
 
-    if chapterReward[mapID] then
-        return Broadcast.sendErr(human, Lang.FRIEND_HEART_GET_HAD)
+    -- 新修改: 一键领取所有可领取的奖励
+    local len = 0
+    local itemLArr = {}
+    local getMapIdList = {}
+
+    for mapId, mapCfg in ipairs(tBattleConfig.map) do
+        if not tChapterReward[mapId] and roleMapId >= mapId then
+            for _, itemInfo in ipairs(mapCfg.reward) do
+                len = len + 1
+                itemLArr[len] = {itemInfo[1], itemInfo[2]}
+            end
+
+            getMapIdList[mapId] = true
+            tChapterReward[mapId] = true
+        end
     end
 
-    chapterReward[mapID] = true
-    ObjHuman.save(human)
+    if len > 0 then
+        BagLogic.addItemList(human, itemLArr, "chapterReward")
+        RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1105)
 
-    local reward = mapConf.reward
-    BagLogic.addItemList(human, reward, "chapterReward")
-    RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1105)
+        len = 0
+        local msgRet = Msg.gc.GC_BATTLE_CHAPTER_REWARD
+        local mapIDList = msgRet.mapIDList
+        for mapId in pairs(getMapIdList) do
+            len = len + 1
+            mapIDList[len] = mapId
+        end
+        mapIDList[0] = len
 
-    local msgRet = Msg.gc.GC_BATTLE_CHAPTER_REWARD
-    msgRet.mapID = mapID
-    Msg.send(msgRet, human.fd)
+        Msg.send(msgRet, human.fd)
+    end
 end
 
 -- 判断难度是否解锁
@@ -4269,7 +4499,7 @@ function GetGameReward(human, indexStr)
         human.db.hardBattleGameTimes = hardBattleGameTimes
     end
 
-    BagLogic.addItemList(human, { {itemId, itemCnt} }, "battle")
+    BagLogic.addItemList(human, { {itemId, itemCnt} }, "battle_game")
 
     local msgRet = Msg.gc.GC_BATTLE_GETGAMEREWARD
     msgRet.battleGameTimes = battleGameTimes + eliteBattleGameTimes + hardBattleGameTimes
@@ -4551,3 +4781,19 @@ function GM_ClearNowModelAttrData(human)
     human.db.eliteBattleAttrData = nil
     human.db.hardBattleAttrData = nil
 end
+
+
+
+-----------------------------多队伍--------------------------------------------------------
+-- 请求当前模式当前关卡需要几支队伍
+function QueryLevelTeamCnt(human)
+    local teamCnt = getLevelTeamCnt(human)
+    local msgRet = Msg.gc.GC_BATTLE_TEAM_COUNT
+    msgRet.teamCnt = teamCnt
+
+    print("====================QueryLevelTeamCnt==========================", teamCnt)
+
+    Msg.send(msgRet, human.fd)
+end
+
+-------------------------------------------------------------------------------------------

+ 4 - 1
script/module/battle/EliteDefine.lua

@@ -25,4 +25,7 @@ COPY_SELECT_MAIN = 2
 -- 增加扫荡次数道具
 BATTLE_ADD_MOPUP_GOODID = 1012
 -- 最大扫荡配置
-BATTLE_MOPUP_MAX_LEN = 12
+BATTLE_MOPUP_MAX_LEN = 12
+
+-- 开启多队伍挑战的关卡要求
+OPEN_OTHER_TEAM_LEVEL = 601

+ 18 - 3
script/module/combat/BeSkill.lua

@@ -508,6 +508,12 @@ function onSkillID(obj,skillID)
 	return skillID
 end
 
+-- 延迟加或者不加战斗帧的技能cmd
+local DELAY_FRAME_CMD ={
+	["qusan"] = 1,
+}
+
+
 local function use(attacker,targets,data,newFrame, packBuff)
 	if canUse(attacker,data) and canUseOnHit(targets and targets[1],data) then
 		--print("beskill realuse:",attacker.pos,data[1])
@@ -523,13 +529,22 @@ local function use(attacker,targets,data,newFrame, packBuff)
            CombatImpl.afterBuff()
         end
 
+		local isAddFrame = false
 		if Skill.CMD[skillConfig.cmd] then
 			if newFrame or CombatImpl.isSkillFrameEmpty() then
 				--进入战斗时,未加入任何战斗帧触发被动技能时,先添加被动技能的战斗帧,可以在这个战斗帧上挂被动技能引发的额外作用
-                CombatImpl.addFrame()
-				CombatImpl.setSkillID(attacker, data[1]) 
+                -- CombatImpl.addFrame()
+				-- CombatImpl.setSkillID(attacker, data[1])
+
+				if not DELAY_FRAME_CMD[skillConfig.cmd] then
+					CombatImpl.addFrame()
+					CombatImpl.setSkillID(attacker, data[1])
+				else
+					isAddFrame = true
+				end
+
 			end
-			ret = Skill.CMD[skillConfig.cmd](attacker,skillConfig,targets)
+			ret = Skill.CMD[skillConfig.cmd](attacker,skillConfig,targets, isAddFrame)
 		end	
 
 		--判断是否加喊话

+ 52 - 8
script/module/combat/CombatPosLogic.lua

@@ -18,10 +18,10 @@ local CombatPosExcel = require("excel.combatPos")
 local FormationExcel = CombatPosExcel.formation
 local DefineExcel = CombatPosExcel.define[1]
 local Util = require("common.Util")
--- local Lang = require("common.Lang")
+local Lang = require("common.Lang")
 local Msg = require("core.Msg")
 local ObjHuman = require("core.ObjHuman")
--- local Broadcast = require("broadcast.Broadcast")
+local Broadcast = require("broadcast.Broadcast")
 local CombatDefine = require("combat.CombatDefine")
 local CombatLogic = require("combat.CombatLogic")
 local CombatImpl = require("combat.CombatImpl")
@@ -50,6 +50,7 @@ local TalismanLogic = require("talisman.TalismanLogic")
 local NewFirstChargeLogic = require("present.NewFirstChargeLogic")
 
 
+
 --秘宝的加成
 local function getTalismanAdd(human)
 	local res = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.BATTLE_ISQUICKTIME)
@@ -113,6 +114,38 @@ function copyCombatHeros(human, sourceType, targetType)
 end
 
 
+local function table_find(tbl, val)
+	for _, v in pairs(tbl) do
+		if v == val then
+			return true
+		end
+	end
+	return false
+end
+
+
+-- 检查当前上阵的英雄是否在目标阵容里上阵了
+local function heroExclusionCheck(human, exclusionTypeList, nowHeroLlist)
+	for _, combatType in ipairs(exclusionTypeList) do
+		local combatHeroDB = getCombatHeroDB(human, combatType)
+
+		if combatHeroDB and combatHeroDB.herolistList then
+			for _, heroUuid in pairs(nowHeroLlist)do
+				if heroUuid ~= "0" and heroUuid ~= "" then
+					if table_find(combatHeroDB.herolistList, heroUuid) then
+						return false
+					end
+				end
+			end
+		end
+	end
+
+	return true
+end
+
+
+
+
 
 -- 可否更新阵容
 local function checkUpdatePos(human, msg)
@@ -142,6 +175,15 @@ local function checkUpdatePos(human, msg)
     local posList = getPosList(msg.formation)
     local heroList = Util.split(msg.heroList, ",")
     local helpList = Util.split(msg.helpList, ",", true)
+
+	local exclusionTypeList = CombatDefine.COMBAT_EXCLUSION_LIST[msg.type]
+	if exclusionTypeList then
+		if not heroExclusionCheck(human, exclusionTypeList, heroList) then
+			return Broadcast.sendErr(human, Lang.COMMON_HERO_UPPOS)
+		end
+	end
+
+
     local cnt = 0
     local useList = { }
     local fatherList = { }
@@ -153,21 +195,23 @@ local function checkUpdatePos(human, msg)
 
             if i == CombatDefine.COMBAT_HERO_CNT and canBackup(human) == 0 then
                 -- 援军未激活
-                return
+                return Broadcast.sendErr(human, Lang.HELP_HERO_NOT_ACTIVATE)
             end
 
             if posList[i] == nil and i ~= CombatDefine.COMBAT_HERO_CNT then
-                -- 站位不可用
-                return
+                -- 站位不可用 POS_ERROR
+                return Broadcast.sendErr(human, Lang.POS_ERROR)
             end
 
             local heroGrid = HeroLogic.getHeroGridByUuid(human, uuid)
-            if not heroGrid then return end
+            if not heroGrid then 
+				return Broadcast.sendErr(human, Lang.DRILL_CHOOSE_FRIEND_ERR_INFO)
+			end
 
             local heroConfig = HeroExcel.hero[heroGrid.id]
             if useList[uuid] or fatherList[heroGrid.id] then
                 -- 同父类英雄重复
-                return
+                return Broadcast.sendErr(human, Lang.HERO_SAME)
             else
                 cnt = cnt + 1
                 useList[uuid] = true
@@ -177,7 +221,7 @@ local function checkUpdatePos(human, msg)
     end
     if cnt == 0 then
         -- 上阵英雄空
-        return
+        return Broadcast.sendErr(human, Lang.NO_HERO)
     end
     -- 检查辅助对象是否激活 todo
 

+ 10 - 2
script/module/combat/Skill.lua

@@ -963,14 +963,22 @@ function CMD.randcmd(obj,skillConfig,skillTargets)
 	return {}
 end
 
-function CMD.qusan(obj,skillConfig,skillTargets)
+function CMD.qusan(obj,skillConfig,skillTargets, isAddFrame)
 	if obj.isPet then return {} end
-	
+	print("================qusan0000==============")
 	local args = skillConfig.args
 	local r = math.random(0,10000)
 	if r > args[3] then
+		print("================qusan==============", r, args[3])
 		return
 	end
+
+	-- 只有能驱散时才增加技能帧
+	if isAddFrame then
+		CombatImpl.addFrame()
+		CombatImpl.setSkillID(obj, skillConfig.id)
+	end
+
 	local qusanType = args[1]
 	local calcType = args[5] and args[5][1]
 	local rate = args[5] and args[5][2]