From 0f542f5938f5281588d4ded8f3ba16ee661c4c5e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 06 一月 2026 19:46:12 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(Hero命令优化一键满级可指定等级、星级、突破、觉醒;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
index 5dda203..264e875 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -420,6 +420,8 @@
else:
tfObj.PosNum = posNum
tfObj.AngreXP = batObj.GetXP()
+ tfObj.FightPower = batObj.GetFightPower() % ChConfig.Def_PerPointValue
+ tfObj.FightPowerEx = batObj.GetFightPower() / ChConfig.Def_PerPointValue
tfLineup.ObjList.append(tfObj)
tfLineup.ObjCnt = len(tfLineup.ObjList)
tfFaction.LineupList.append(tfLineup)
@@ -612,6 +614,7 @@
itemIndex = hero.itemIndex
heroLV = 1
star = 0
+ userData = "{}"
if itemIndex >= 0 and itemIndex < curPack.GetCount():
heroItem = curPack.GetAt(itemIndex)
if heroItem and not heroItem.IsEmpty():
@@ -619,6 +622,7 @@
star = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroStar)
#breakLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroBreakLV)
#awakeLV = heroItem.GetUserAttr(ShareDefine.Def_IudetHeroAwakeLV)
+ userData = heroItem.GetUserData()
skillIDlist = []
skillIDlist += hero.heroSkillIDList
@@ -627,6 +631,7 @@
"SkinID":hero.skinID,
"LV":heroLV,
"Star":star,
+ "Data":userData,
#"BreakLV":breakLV,
#"AwakeLV":awakeLV,
"FightPower":hero.fightPower,
@@ -640,7 +645,7 @@
lineupInfo = {"PlayerID":playerID, "FightPower":lineup.fightPower, "ShapeType":lineup.shapeType, "Hero":heroDict}
return lineupInfo
-def GetNPCLineupInfo(lineupID, strongerLV=0, difficulty=0):
+def GetNPCLineupInfo(lineupID, strongerLV=0, difficulty=0, isLog=True):
## 获取NPC阵容信息
# @param lineupID: 阵容ID
# @param npcLV: 成长NPC等级
@@ -662,7 +667,7 @@
npcID = getattr(ipyData, "GetPosNPCID%s" % posNum)()
if not npcID:
continue
- battleDict = GetNPCBattleDict(ipyData, npcID, strongerLV, difficulty)
+ battleDict = GetNPCBattleDict(ipyData, npcID, strongerLV, difficulty, isLog)
if not battleDict:
continue
heroDict[str(posNum)] = battleDict
@@ -775,7 +780,7 @@
lineupInfo = {"NPCLineupID":lineupID, "Hero":heroDict, "BossID":0, "BossPosView":0}
return lineupInfo
-def GetNPCBattleDict(lineupIpyData, npcID, strongerLV=0, difficulty=0):
+def GetNPCBattleDict(lineupIpyData, npcID, strongerLV=0, difficulty=0, isLog=True):
## 获取NPC战斗相关字典,支持成长NPC
# @param strongerLV: 成长等级
# @param difficulty: 难度系数
@@ -820,10 +825,10 @@
random.shuffle(randSkillIDExList)
randSkillIDExList = randSkillIDExList[:skillExCnt]
skillIDList += randSkillIDExList
- GameWorld.DebugLogEx("阵容boss技能: %s, 随机附加技能: %s", skillIDList, randSkillIDExList)
+ isLog and GameWorld.DebugLogEx("阵容boss技能: %s, 随机附加技能: %s", skillIDList, randSkillIDExList)
# 成长怪属性
- batAttrDict = GetNPCStrongerAttrDict(npcID, lvReIpyData, npcStronger, difficulty)
+ batAttrDict = GetNPCStrongerAttrDict(npcID, lvReIpyData, npcStronger, difficulty, isLog)
if not batAttrDict:
batAttrDict = {ChConfig.AttrID_Atk:npcData.GetAtk(), ChConfig.AttrID_Def:npcData.GetDef(), ChConfig.AttrID_MaxHP:npcData.GetMaxHP(),
ChConfig.AttrID_FinalDamPer:npcData.GetFinalDamPer(), ChConfig.AttrID_FinalDamPerDef:npcData.GetFinalDamPerDef(),
@@ -850,7 +855,7 @@
"SkillIDList":skillIDList,
}
- GameWorld.DebugLogEx("GetNPCBattleDict npcID=%s,strongerLV=%s,difficulty=%s,reModelID=%s,%s", npcID, strongerLV, difficulty, reModelID, battleDict)
+ isLog and GameWorld.DebugLogEx("GetNPCBattleDict npcID=%s,strongerLV=%s,difficulty=%s,reModelID=%s,%s", npcID, strongerLV, difficulty, reModelID, battleDict)
return battleDict
def GetNPCHeroSkillIDList(heroID, heroIpyData, breakLV, awakeLV):
@@ -879,7 +884,7 @@
return skillIDList
-def GetNPCStrongerAttrDict(npcID, lvReIpyData, npcStronger, difficulty):
+def GetNPCStrongerAttrDict(npcID, lvReIpyData, npcStronger, difficulty, isLog=True):
## 获取NPC成长属性
# @param strongerLV: 成长等级
# @param difficulty: 难度系数
@@ -901,7 +906,7 @@
batAttrDict[attrID] = attrValue
#GameWorld.DebugLogEx(" attrID=%s,attrValue=%s,reValue=%s,ratio=%s,difficulty=%s", attrID, attrValue, reValue, ratio, difficulty)
- GameWorld.DebugLogEx("NPC成长属性: npcID=%s,lv=%s,difficulty=%s,%s", npcID, lv, difficulty, batAttrDict)
+ isLog and GameWorld.DebugLogEx("NPC成长属性: npcID=%s,lv=%s,difficulty=%s,%s", npcID, lv, difficulty, batAttrDict)
return batAttrDict
def SummonLineupObjs(batLineup, faction, num, lineupInfo, reqPlayerID=0):
@@ -1084,13 +1089,14 @@
if not reqRet:
return
funcLineID = reqRet[1] if len(reqRet) > 1 else funcLineID
+ GameWorld.DebugLogEx(" funcLineID=%s", funcLineID, playerID)
fbIpyData = FBCommon.GetFBIpyData(mapID)
fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, funcLineID, False)
if fbIpyData:
- if not fbLineIpyData:
- GameWorld.DebugLogEx("不存在该副本功能线路! mapID=%s,funcLineID=%s", mapID, funcLineID)
- return
+ #if not fbLineIpyData:
+ # GameWorld.DebugLogEx("不存在该副本功能线路! mapID=%s,funcLineID=%s", mapID, funcLineID)
+ # return
if FBCommon.CheckCanEnterFBComm(curPlayer, mapID, funcLineID, fbIpyData, fbLineIpyData) != ShareDefine.EntFBAskRet_OK:
return
@@ -1274,7 +1280,7 @@
for index, lineupID in enumerate(npcLineupIDList):
turnFight.lineupIndex = index
- GameWorld.DebugLogEx("对战NPC阵容: index=%s, lineupID=%s", index, lineupID)
+ GameWorld.DebugLogEx("对战NPC阵容: mapID=%s,funcLineID=%s,index=%s,lineupID=%s", mapID, funcLineID, index, lineupID)
if index > 0:
turnFight.nextTurnFight()
turnFight.setFactionLineup(ChConfig.Def_FactionB, {1:GetNPCLineupInfo(lineupID, strongerLV, difficulty)})
--
Gitblit v1.8.0