From c65290e4ebcbecf93fbde371947ff99feab7d29d Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 26 六月 2024 14:41:51 +0800 Subject: [PATCH] 10191 【越南】【主干】【港台】新增多种培养材料副本 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py | 4 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GeneralTrain.py | 159 +++++++++++++++++++++++++++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 11 + ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 33 ++++++ PySysDB/PySysDBPY.h | 13 ++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py | 2 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 11 + ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 1 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py | 22 ++++ 9 files changed, 251 insertions(+), 5 deletions(-) diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h index 9735ee0..2f3389e 100644 --- a/PySysDB/PySysDBPY.h +++ b/PySysDB/PySysDBPY.h @@ -880,6 +880,19 @@ eval RewardInfo; //奖励信息 }; +//副本通用养成表 + +struct tagFBGeneralTrain +{ + DWORD _DataMapID; //数据地图ID + BYTE _LineID; //功能线路ID + WORD LVLimit; //多少级可挑战, 0为不限制 + WORD RealmLimit; //多少境界可挑战, 0为不限制 + DWORD BossNPCID; //过关bossID + list OtherNPCIDList; //其他NPCIDList + list PassAwardItemList; //过关奖励列表 +}; + //副本助战表 struct tagFBHelpBattle diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py index 8d7d762..be51fff 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py @@ -23980,6 +23980,7 @@ PassGradeCnt = 0 #(BYTE PassGradeCnt)//星级值对应个数, 每个key存9个lineID PassGrade = list() #(vector<DWORD> PassGrade)//副本线路对应星级值列表 EnterCntTotal = 0 #(DWORD EnterCntTotal)//累计进入次数 + PassLineID = 0 #(DWORD PassLineID)//已过关到的lineID data = None def __init__(self): @@ -23997,6 +23998,7 @@ value,_pos=CommFunc.ReadDWORD(_lpData,_pos) self.PassGrade.append(value) self.EnterCntTotal,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.PassLineID,_pos = CommFunc.ReadDWORD(_lpData, _pos) return _pos def Clear(self): @@ -24007,6 +24009,7 @@ self.PassGradeCnt = 0 self.PassGrade = list() self.EnterCntTotal = 0 + self.PassLineID = 0 return def GetLength(self): @@ -24017,6 +24020,7 @@ length += 2 length += 1 length += 4 * self.PassGradeCnt + length += 4 length += 4 return length @@ -24031,6 +24035,7 @@ for i in range(self.PassGradeCnt): data = CommFunc.WriteDWORD(data, self.PassGrade[i]) data = CommFunc.WriteDWORD(data, self.EnterCntTotal) + data = CommFunc.WriteDWORD(data, self.PassLineID) return data def OutputString(self): @@ -24041,7 +24046,8 @@ ItemAddCnt:%d, PassGradeCnt:%d, PassGrade:%s, - EnterCntTotal:%d + EnterCntTotal:%d, + PassLineID:%d '''\ %( self.FBID, @@ -24050,7 +24056,8 @@ self.ItemAddCnt, self.PassGradeCnt, "...", - self.EnterCntTotal + self.EnterCntTotal, + self.PassLineID ) return DumpString diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py index c797b9e..d8ea020 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py @@ -3558,6 +3558,7 @@ Def_Player_Dict_ReqFBMissionType = "ReqFBMissionType" # 请求进入副本的任务类型 Def_Player_Dict_PlayerFBStar_MapId = "FBStar_%s_%s" # 副本星级星级信息, 参数为[mapID, key编号], 按位存储每个lineID对应的星级 Def_Player_Dict_CustomMapStep = "CustomMapStep_%s_%s" # 前端自定义场景阶段, 参数(mapID, lineID),对应 CustomMapStep_Fight ... +Def_Player_Dict_FBPassLineID = "FBPassLineID_%s" # 副本已过关到的lineID, 参数为副本ID Def_Player_Dict_EnterFbCntTotal = "EnterFbCntTotal_%s" # 进入副本总累计次数, 参数为副本ID Def_Player_Dict_EnterFbCntDay = "EnterFbCntDay_%s" # 今日进入副本次数, 参数为副本ID Def_Player_Dict_BuyFbCntDay = "BuyFbCntDay_%s" # 今日购买副本进入次数, 参数为副本ID diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index 8d7d762..be51fff 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -23980,6 +23980,7 @@ PassGradeCnt = 0 #(BYTE PassGradeCnt)//星级值对应个数, 每个key存9个lineID PassGrade = list() #(vector<DWORD> PassGrade)//副本线路对应星级值列表 EnterCntTotal = 0 #(DWORD EnterCntTotal)//累计进入次数 + PassLineID = 0 #(DWORD PassLineID)//已过关到的lineID data = None def __init__(self): @@ -23997,6 +23998,7 @@ value,_pos=CommFunc.ReadDWORD(_lpData,_pos) self.PassGrade.append(value) self.EnterCntTotal,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.PassLineID,_pos = CommFunc.ReadDWORD(_lpData, _pos) return _pos def Clear(self): @@ -24007,6 +24009,7 @@ self.PassGradeCnt = 0 self.PassGrade = list() self.EnterCntTotal = 0 + self.PassLineID = 0 return def GetLength(self): @@ -24017,6 +24020,7 @@ length += 2 length += 1 length += 4 * self.PassGradeCnt + length += 4 length += 4 return length @@ -24031,6 +24035,7 @@ for i in range(self.PassGradeCnt): data = CommFunc.WriteDWORD(data, self.PassGrade[i]) data = CommFunc.WriteDWORD(data, self.EnterCntTotal) + data = CommFunc.WriteDWORD(data, self.PassLineID) return data def OutputString(self): @@ -24041,7 +24046,8 @@ ItemAddCnt:%d, PassGradeCnt:%d, PassGrade:%s, - EnterCntTotal:%d + EnterCntTotal:%d, + PassLineID:%d '''\ %( self.FBID, @@ -24050,7 +24056,8 @@ self.ItemAddCnt, self.PassGradeCnt, "...", - self.EnterCntTotal + self.EnterCntTotal, + self.PassLineID ) return DumpString diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py index 107a2e5..439d86d 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py @@ -40,7 +40,7 @@ FBCommon.SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID, 0) tick = GameWorld.GetGameWorld().GetTick() - if mapID in ChConfig.ClientCustomScene: + if mapID in FBCommon.GetClientCustomScene(): PlayerFB.DoEnterCustomScene(curPlayer, mapID, lineID, tick) elif mapID in ChConfig.Def_CrossMapIDList: PlayerControl.PlayerEnterCrossServer(curPlayer, mapID, lineID) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py index aad18b7..849c9c4 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py @@ -20,6 +20,7 @@ import GameWorldProcess import CrossRealmPlayer import DataRecordPack +import IpyGameDataPY import PlayerSuccess import ReadChConfig import PlayerAssist @@ -1380,6 +1381,9 @@ if mapID in value: return key + if mapID in FBCommon.GetGeneralTrainMapIDList(): + return "GeneralTrain" + #for key , value in ReadChConfig.GetEvalChConfig("MapID_ProcessPy").items(): # if mapID in value: # return key diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py index 207155a..05b356d 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py @@ -2364,6 +2364,27 @@ return dataMapID return mapID +def GetGeneralTrainMapIDList(): + ## 获取通用养成副本 + GeneralTrainMapIDList = IpyGameDataPY.GetConfigEx("GeneralTrainMapIDList") + if not GeneralTrainMapIDList: + GeneralTrainMapIDList = [] + ipyDataMgr = IpyGameDataPY.IPY_Data() + for i in xrange(ipyDataMgr.GetFBGeneralTrainCount()): + ipyData = ipyDataMgr.GetFBGeneralTrainByIndex(i) + dMapID = ipyData.GetDataMapID() + if dMapID not in GeneralTrainMapIDList: + GeneralTrainMapIDList.append(dMapID) + GeneralTrainMapIDList = IpyGameDataPY.SetConfigEx("GeneralTrainMapIDList", GeneralTrainMapIDList) + #GameWorld.Log("加载GeneralTrainMapIDList=%s" % GeneralTrainMapIDList) + + return GeneralTrainMapIDList + +def GetClientCustomScene(): + ## 获取前端自定义副本场景 + mapIDList = GetGeneralTrainMapIDList() + return mapIDList + ChConfig.ClientCustomScene + ## 同步进入副本时间 # @param curPlayer 玩家 # @param syncMapID 同步的地图,默认0为全部 @@ -2427,6 +2448,7 @@ mapInfo.EnterCntTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntTotal % mID) mapInfo.RecoverCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mID) mapInfo.ItemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mID) + mapInfo.PassLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mID) for keyNum in range(ChConfig.Def_FBStar_MaxKeyCnt): gradeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayerFBStar_MapId % (mID, keyNum)) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GeneralTrain.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GeneralTrain.py new file mode 100644 index 0000000..cd69137 --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GeneralTrain.py @@ -0,0 +1,159 @@ +#!/usr/bin/python +# -*- coding: GBK -*- +#------------------------------------------------------------------------------- +# +##@package GameWorldLogic.FBProcess.GameLogic_GeneralTrain +# +# @todo:通用养成副本 +# @author hxp +# @date 2024-06-26 +# @version 1.0 +# +# 详细描述: 通用养成副本 +# +#------------------------------------------------------------------------------- +#"""Version = 2024-06-26 14:30""" +#------------------------------------------------------------------------------- + +import FBCommon +import GameWorld +import PlayerControl +import IpyGameDataPY +import ItemControler +import NPCCommon +import ChConfig + +## 是否能够通过活动查询进入 +def OnEnterFBEvent(curPlayer, mapID, lineID, tick): + ipyData = IpyGameDataPY.GetIpyGameData('FBGeneralTrain', mapID, lineID) + if not ipyData: + return False + + LVLimit = ipyData.GetLVLimit() + if LVLimit and curPlayer.GetLV() < LVLimit: + GameWorld.DebugLog("通用养成副本等级不足,无法挑战! mapID=%s,lineID=%s,LVLimit=%s" % (mapID, lineID, LVLimit)) + return False + + RealmLimit = ipyData.GetRealmLimit() + if RealmLimit and curPlayer.GetOfficialRank() < RealmLimit: + GameWorld.DebugLog("通用养成副本境界不足,无法挑战! mapID=%s,lineID=%s,RealmLimit=%s" % (mapID, lineID, RealmLimit)) + return False + + passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID) + if passLineID + 1 != lineID: + GameWorld.DebugLog("通用养成副本只能挑战下一关! mapID=%s,lineID=%s,passLineID=%s" % (mapID, lineID, passLineID)) + return False + + return True + +## 是否需要做进入副本通用检查条件逻辑,默认需要检查 +def OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID): + ## 进行中的不需要重复检查,防止断线重连被禁止进入 + if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) == ChConfig.CustomMapStep_Fight: + GameWorld.DebugLog("通用养成副本已经在进行中,本次进入不需要重新检查! mapID=%s,lineID=%s" % (mapID, lineID)) + return False + return True + +## 客户端进入自定义场景 +def OnEnterCustomScene(curPlayer, mapID, lineID): + return + +## 判断可否召唤木桩怪 +def OnCanSummonPriWoodPile(curPlayer, mapID, lineID, npcID, count): + + if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight: + FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Fight) + + npcIDList = GetGeneralTrainNPCIDList(mapID, lineID) + if not npcIDList or npcID not in npcIDList: + GameWorld.DebugLog("通用养成副本该NPC不能召唤! mapID=%s,lineID=%s,npcID=%s not in %s" % (mapID, lineID, npcID, npcIDList)) + return False + + return True + +def OnCustomSceneProcess(curPlayer, mapID, lineID, tick): + return + +def GetGeneralTrainNPCIDList(mapID, lineID): + npcIDList = [] + ipyData = IpyGameDataPY.GetIpyGameData('FBGeneralTrain', mapID, lineID) + if not ipyData: + return [] + + npcIDList.append(ipyData.GetBossNPCID()) + npcIDList.extend(ipyData.GetOtherNPCIDList()) + return npcIDList + +def GetGeneralTrainBossID(mapID, lineID): + ipyData = IpyGameDataPY.GetIpyGameData('FBGeneralTrain', mapID, lineID) + if not ipyData: + return 0 + return ipyData.GetBossNPCID() + +## 自定义场景副本击杀NPC +def DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID): + + npcID = curNPC.GetNPCID() + bossID = GetGeneralTrainBossID(mapID, lineID) + GameWorld.DebugLog("击杀副本NPC: mapID=%s,lineID=%s,npcID=%s,bossID=%s" % (mapID, lineID, npcID, bossID), curPlayer.GetPlayerID()) + if npcID != bossID: + return + + if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight: + return + + ipyData = IpyGameDataPY.GetIpyGameData('FBGeneralTrain', mapID, lineID) + if not ipyData: + return + + passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID) + if lineID > passLineID: + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBPassLineID % mapID, lineID) + + #增加进入次数 + FBCommon.AddEnterFBCount(curPlayer, mapID) + + giveItemList = ipyData.GetPassAwardItemList() + GameWorld.DebugLog("通用养成副本过关! mapID=%s,lineID=%s,giveItemList=%s" % (mapID, lineID, giveItemList)) + + NPCCommon.DoGiveItemByVirtualDrop(curPlayer, giveItemList, bossID) + + FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Over) + + isPass = 1 + overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)} + FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict) + return + +## 可否扫荡 +def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx): + + ipyData = IpyGameDataPY.GetIpyGameData('FBGeneralTrain', mapID, lineID) + if not ipyData: + return + + passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID) + if passLineID < lineID: + GameWorld.DebugLog("没有过关不能扫荡! mapID=%s,passLineID=%s < %s" % (mapID, passLineID, lineID)) + return + + return True + +## 扫荡结果 +def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx): + GameWorld.DebugLog("通用养成副本扫荡: mapID=%s,lineID=%s,sweepCnt=%s" % (mapID, lineID, sweepCnt)) + ipyData = IpyGameDataPY.GetIpyGameData('FBGeneralTrain', mapID, lineID) + if not ipyData: + return + + giveItemList = ipyData.GetPassAwardItemList() + awardItemList = [] + for itemID, itemCount, isAuctionItem in giveItemList: + awardItemList.append([itemID, itemCount * sweepCnt, isAuctionItem]) + + ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList) + + isPass = 1 + overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(awardItemList), FBCommon.Over_isSweep:1} + FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict) + return True diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py index f2b1e46..d0dc989 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py @@ -721,6 +721,16 @@ ("eval", "RewardInfo", 0), ), + "FBGeneralTrain":( + ("DWORD", "DataMapID", 1), + ("BYTE", "LineID", 1), + ("WORD", "LVLimit", 0), + ("WORD", "RealmLimit", 0), + ("DWORD", "BossNPCID", 0), + ("list", "OtherNPCIDList", 0), + ("list", "PassAwardItemList", 0), + ), + "FBHelpBattle":( ("DWORD", "DataMapID", 1), ("BYTE", "LineID", 1), @@ -3292,6 +3302,21 @@ def GetGradeInfo(self): return self.attrTuple[14] # 评级规则 eval def GetRewardInfo(self): return self.attrTuple[15] # 奖励信息 eval +# 副本通用养成表 +class IPY_FBGeneralTrain(): + + def __init__(self): + self.attrTuple = None + return + + def GetDataMapID(self): return self.attrTuple[0] # 数据地图ID DWORD + def GetLineID(self): return self.attrTuple[1] # 功能线路ID BYTE + def GetLVLimit(self): return self.attrTuple[2] # 多少级可挑战, 0为不限制 WORD + def GetRealmLimit(self): return self.attrTuple[3] # 多少境界可挑战, 0为不限制 WORD + def GetBossNPCID(self): return self.attrTuple[4] # 过关bossID DWORD + def GetOtherNPCIDList(self): return self.attrTuple[5] # 其他NPCIDList list + def GetPassAwardItemList(self): return self.attrTuple[6] # 过关奖励列表 list + # 副本助战表 class IPY_FBHelpBattle(): @@ -5840,6 +5865,7 @@ self.__LoadFileData("ChinMap", onlyCheck) self.__LoadFileData("FBFunc", onlyCheck) self.__LoadFileData("FBLine", onlyCheck) + self.__LoadFileData("FBGeneralTrain", onlyCheck) self.__LoadFileData("FBHelpBattle", onlyCheck) self.__LoadFileData("NPCCustomRefresh", onlyCheck) self.__LoadFileData("DailyAction", onlyCheck) @@ -6651,6 +6677,13 @@ self.CheckLoadData("FBLine") return self.ipyFBLineCache[index] + def GetFBGeneralTrainCount(self): + self.CheckLoadData("FBGeneralTrain") + return self.ipyFBGeneralTrainLen + def GetFBGeneralTrainByIndex(self, index): + self.CheckLoadData("FBGeneralTrain") + return self.ipyFBGeneralTrainCache[index] + def GetFBHelpBattleCount(self): self.CheckLoadData("FBHelpBattle") return self.ipyFBHelpBattleLen -- Gitblit v1.8.0