hxp
2025-09-01 5509de7c6274b7d47d84aa45f589490ba0eab648
129 【战斗】战斗系统-服务端(NPC阵容boss支持配置附加技能;)
4个文件已修改
28 ■■■■ 已修改文件
PySysDB/PySysDBPY.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -337,6 +337,8 @@
    DWORD        PosNPCID6;    //6号位NPCID
    DWORD        PosNPCID7;    //7号位NPCID
    DWORD        BossID;    // 本阵容的BossID,没有boss时为0
    list        SkillIDExList;    // boss附加技能列表
    BYTE        SkillExCnt;    //随机附加技能数,0为所有
};
//称号表 #tagDienstgrad
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py
@@ -548,6 +548,7 @@
    
    def GetSkillCount(self): return len(self._skillList)
    def GetSkillByIndex(self, index): return self._skillList[index]
    def GetSkillIDList(self): return self._skillDict.keys()
    def FindSkillByID(self, skillID): return self._skillDict.get(skillID, None)
    def FindSkillByTypeID(self, skillTypeID):
        skill = None
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -514,7 +514,7 @@
        npcID = getattr(ipyData, "GetPosNPCID%s" % posNum)()
        if not npcID:
            continue
        battleDict = GetNPCBattleDict(npcID, strongerLV, difficulty)
        battleDict = GetNPCBattleDict(ipyData, npcID, strongerLV, difficulty)
        if not battleDict:
            continue
        heroDict[str(posNum)] = battleDict
@@ -522,7 +522,7 @@
    lineupInfo = {"NPCLineupID":lineupID, "Hero":heroDict}
    return lineupInfo
def GetNPCBattleDict(npcID, strongerLV=0, difficulty=0):
def GetNPCBattleDict(lineupIpyData, npcID, strongerLV=0, difficulty=0):
    ## 获取NPC战斗相关字典,支持成长NPC
    # @param strongerLV: 成长等级
    # @param difficulty: 难度系数
@@ -551,6 +551,19 @@
        skinID = 0
        skillIDList = [] + npcData.GetSkillIDList()
        
    # boss额外随机技能
    bossID = lineupIpyData.GetBossID()
    if npcID == bossID:
        skillIDExList = lineupIpyData.GetSkillIDExList()
        if skillIDExList:
            randSkillIDExList = [] + list(skillIDExList)
            skillExCnt = lineupIpyData.GetSkillExCnt()
            if skillExCnt > 0 and len(randSkillIDExList) > skillExCnt:
                random.shuffle(randSkillIDExList)
                randSkillIDExList = randSkillIDExList[:skillExCnt]
            skillIDList += randSkillIDExList
            GameWorld.DebugLog("阵容boss技能: %s, 随机附加技能: %s" % (skillIDList, randSkillIDExList))
    # 成长怪属性
    batAttrDict = GetNPCStrongerAttrDict(npcID, lvIpyData, npcStronger, difficulty)
    if not batAttrDict:
@@ -713,7 +726,7 @@
            skillManager.LearnSkillByID(skillID)
            
        batLineup.posObjIDDict[posNum] = objID
        GameWorld.DebugLog("AddBatObj %s,skill=%s" % (GetObjName(batObj), skillIDList))
        GameWorld.DebugLog("AddBatObj %s,skill=%s" % (GetObjName(batObj), skillManager.GetSkillIDList()))
        batObj.InitBatAttr({int(k):v for k, v in attrDict.items()}, initXP)
        
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -327,6 +327,8 @@
                        ("DWORD", "PosNPCID6", 0),
                        ("DWORD", "PosNPCID7", 0),
                        ("DWORD", "BossID", 0),
                        ("list", "SkillIDExList", 0),
                        ("BYTE", "SkillExCnt", 0),
                        ),
                "Dienstgrad":(
@@ -3071,7 +3073,9 @@
    def GetPosNPCID5(self): return self.attrTuple[5] # 5号位NPCID DWORD
    def GetPosNPCID6(self): return self.attrTuple[6] # 6号位NPCID DWORD
    def GetPosNPCID7(self): return self.attrTuple[7] # 7号位NPCID DWORD
    def GetBossID(self): return self.attrTuple[8] #  本阵容的BossID,没有boss时为0 DWORD
    def GetBossID(self): return self.attrTuple[8] #  本阵容的BossID,没有boss时为0 DWORD
    def GetSkillIDExList(self): return self.attrTuple[9] #  boss附加技能列表 list
    def GetSkillExCnt(self): return self.attrTuple[10] # 随机附加技能数,0为所有 BYTE
# 称号表
class IPY_Dienstgrad():