hxp
2025-09-01 5509de7c6274b7d47d84aa45f589490ba0eab648
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: 难度系数
@@ -550,6 +550,19 @@
        heroID = 0
        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)
@@ -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