From cb1d20b4aff8ca422a12a18f024a65b201687ec0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 08 二月 2023 15:52:48 +0800
Subject: [PATCH] 9765 【BT8】【后端】神通(神通技能可用个数增加条件限制)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py | 37 ++++++++++++++++++++++++++-----------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Shentong.py | 2 +-
2 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Shentong.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Shentong.py
index 31078f6..e2f7d82 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Shentong.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Shentong.py
@@ -50,7 +50,7 @@
syncIDList.append(shentongID)
PlayerShentong.SetShentongLVInfo(curPlayer, shentongID, 0, 0)
- ShentongSkillCountMax = IpyGameDataPY.GetFuncCfg("Shentong", 1)
+ ShentongSkillCountMax = len(IpyGameDataPY.GetFuncEvalCfg("Shentong", 1))
skillManager = curPlayer.GetSkillManager()
playerCtl = PlayerControl.PlayerControl(curPlayer)
for num in range(ShentongSkillCountMax):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py
index b16e2ff..ab373f0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py
@@ -95,7 +95,7 @@
lvSkillTypeID = lvSkillData.GetSkillTypeID() if lvSkillData else 0
lvSkillLV = lvSkillData.GetSkillLV() if lvSkillData else 0
- ShentongSkillCount = IpyGameDataPY.GetFuncCfg("Shentong", 1)
+ ShentongSkillCount = len(IpyGameDataPY.GetFuncEvalCfg("Shentong", 1))
skillIDList = []
for num in range(ShentongSkillCount):
skillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongSkillID % num)
@@ -141,9 +141,11 @@
return
def SetShentongSkill(curPlayer, setSkillIDList):
+ # @param setSkillIDList: 因为是发送所有技能槽设置的技能,所以元素中可能存在技能0
if not setSkillIDList:
return
- ShentongSkillCountMax = IpyGameDataPY.GetFuncCfg("Shentong", 1)
+ needSkillCntList = IpyGameDataPY.GetFuncEvalCfg("Shentong", 1)
+ ShentongSkillCountMax = len(needSkillCntList)
if len(setSkillIDList) > ShentongSkillCountMax:
return
@@ -158,30 +160,43 @@
GameWorld.ErrLog("找不到该神通技能数据! skillID=%s" % skillID)
return
forbidSkillIDList.append(skillID)
-
+
+ setSkillCount = len(forbidSkillIDList)
+ canUseSkillDict = {} # {skillTypeID:skillID, ...}
ipyDataMgr = IpyGameDataPY.IPY_Data()
for index in xrange(ipyDataMgr.GetShentongLVCount()):
ipyData = ipyDataMgr.GetShentongLVByIndex(index)
LVSkillID = ipyData.GetLVSkillID()
if not LVSkillID:
continue
- if LVSkillID not in forbidSkillIDList:
- continue
shentongID = ipyData.GetShentongID()
shentongClassLV = ipyData.GetShentongClassLV()
shentongLV = ipyData.GetShentongLV()
classLV, lv = GetShentongLVInfo(curPlayer, shentongID)
if classLV < shentongClassLV or (classLV == shentongClassLV and lv < shentongLV):
- GameWorld.ErrLog("神通等级不足,无法使用该技能! LVSkillID=%s,shentongID=%s,needClassLV=(%s-%s),curClassLV=(%s-%s)"
- % (LVSkillID, shentongID, shentongClassLV, shentongLV, classLV, lv), curPlayer.GetPlayerID())
- return
- forbidSkillIDList.remove(LVSkillID)
-
+ #GameWorld.ErrLog("神通等级不足,无法使用该技能! LVSkillID=%s,shentongID=%s,needClassLV=(%s-%s),curClassLV=(%s-%s)"
+ # % (LVSkillID, shentongID, shentongClassLV, shentongLV, classLV, lv), curPlayer.GetPlayerID())
+ continue
+ skillData = GameWorld.GetGameData().GetSkillBySkillID(LVSkillID)
+ if not skillData:
+ continue
+ skillTypeID = skillData.GetSkillTypeID()
+ canUseSkillDict[skillTypeID] = LVSkillID
+ if LVSkillID in forbidSkillIDList:
+ forbidSkillIDList.remove(LVSkillID)
+
if forbidSkillIDList:
GameWorld.ErrLog("存在无法使用的神通技能,无法设置! setSkillIDList=%s,forbidSkillIDList=%s"
% (setSkillIDList, forbidSkillIDList), curPlayer.GetPlayerID())
return
+ if setSkillCount > 0:
+ needCanUseSkillCnt = needSkillCntList[setSkillCount - 1]
+ if needCanUseSkillCnt > len(canUseSkillDict):
+ GameWorld.DebugLog("存在未解锁的神通技能孔,无法设置! setSkillIDList=%s,needCanUseSkillCnt=%s > canUseSkillCnt=%s(%s)"
+ % (setSkillIDList, needCanUseSkillCnt, len(canUseSkillDict), canUseSkillDict), curPlayer.GetPlayerID())
+ return
+
# 因为可能调整顺序,必须先统一删除再统一添加,不然可能导致技能顺序调整后先被添加后又被删除
skillManager = curPlayer.GetSkillManager()
playerCtl = PlayerControl.PlayerControl(curPlayer)
@@ -276,7 +291,7 @@
def Sync_ShentongSkillInfo(curPlayer, isLogin=False):
skillIDList = []
- ShentongSkillCountMax = IpyGameDataPY.GetFuncCfg("Shentong", 1)
+ ShentongSkillCountMax = len(IpyGameDataPY.GetFuncEvalCfg("Shentong", 1))
for num in range(ShentongSkillCountMax):
skillIDList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongSkillID % num))
--
Gitblit v1.8.0