10191 【越南】【主干】【港台】新增多种培养材料副本
| | |
| | | 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
|
| | |
| | | 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):
|
| | |
| | | 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):
|
| | |
| | | self.PassGradeCnt = 0
|
| | | self.PassGrade = list()
|
| | | self.EnterCntTotal = 0
|
| | | self.PassLineID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 2
|
| | | length += 1
|
| | | length += 4 * self.PassGradeCnt
|
| | | length += 4
|
| | | length += 4
|
| | |
|
| | | return length
|
| | |
| | | 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):
|
| | |
| | | ItemAddCnt:%d,
|
| | | PassGradeCnt:%d,
|
| | | PassGrade:%s,
|
| | | EnterCntTotal:%d
|
| | | EnterCntTotal:%d,
|
| | | PassLineID:%d
|
| | | '''\
|
| | | %(
|
| | | self.FBID,
|
| | |
| | | self.ItemAddCnt,
|
| | | self.PassGradeCnt,
|
| | | "...",
|
| | | self.EnterCntTotal
|
| | | self.EnterCntTotal,
|
| | | self.PassLineID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | 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
|
| | |
| | | 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):
|
| | |
| | | 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):
|
| | |
| | | self.PassGradeCnt = 0
|
| | | self.PassGrade = list()
|
| | | self.EnterCntTotal = 0
|
| | | self.PassLineID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 2
|
| | | length += 1
|
| | | length += 4 * self.PassGradeCnt
|
| | | length += 4
|
| | | length += 4
|
| | |
|
| | | return length
|
| | |
| | | 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):
|
| | |
| | | ItemAddCnt:%d,
|
| | | PassGradeCnt:%d,
|
| | | PassGrade:%s,
|
| | | EnterCntTotal:%d
|
| | | EnterCntTotal:%d,
|
| | | PassLineID:%d
|
| | | '''\
|
| | | %(
|
| | | self.FBID,
|
| | |
| | | self.ItemAddCnt,
|
| | | self.PassGradeCnt,
|
| | | "...",
|
| | | self.EnterCntTotal
|
| | | self.EnterCntTotal,
|
| | | self.PassLineID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | 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)
|
| | |
| | | import GameWorldProcess
|
| | | import CrossRealmPlayer
|
| | | import DataRecordPack
|
| | | import IpyGameDataPY
|
| | | import PlayerSuccess
|
| | | import ReadChConfig
|
| | | import PlayerAssist
|
| | |
| | | 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
|
| | |
| | | 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为全部
|
| | |
| | | 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))
|
New file |
| | |
| | | #!/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
|
| | |
| | | ("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),
|
| | |
| | | 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(): |
| | | |
| | |
| | | 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)
|
| | |
| | | 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
|