From 752de87a70503c2be26eae7ab554b0c3caa2efc0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 13 一月 2025 15:53:05 +0800
Subject: [PATCH] 10334 【越南】【英语】【BT】【砍树】境界修改-服务端

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index 743ac2a..6413109 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -4194,7 +4194,7 @@
         #curTotalExp = GetPlayerTotalExp(curPlayer)
         curTotalExp = curPlayer.GetExpPoint() * ChConfig.Def_PerPointValue + curPlayer.GetTotalExp()
 
-        maxLV = IpyGameDataPY.GetFuncCfg("PlayerMaxLV", 1)
+        maxLV = GetPlayerMaxLV(curPlayer)
         maxLVExpStore = IpyGameDataPY.GetFuncCfg("MaxLVExpStore", 1)
         
         curLV = curPlayer.GetLV()            
@@ -4204,10 +4204,10 @@
 #            GameWorld.DebugLog("经验已满!需先转生!curLV=%s,reinLV=%s" % (curLV, nextReinLV), curPlayer.GetPlayerID())
 #            return 0
 
-        # 检查最大等级
-        if curLV >= maxLV and curTotalExp >= maxLVExpStore:
+        # 检查最大等级,maxLVExpStore -1时不限累计经验上限
+        if curLV >= maxLV and curTotalExp >= maxLVExpStore and maxLVExpStore != -1:
             self.__NotifyExpFull(curPlayer, "GeRen_admin_825676")
-            #GameWorld.DebugLog("经验已满!已满级!curLV=%s" % (curLV), curPlayer.GetPlayerID())
+            GameWorld.DebugLog("经验已满!已满级!curLV=%s,maxLV=%s,curTotalExp=%s >= maxLVExpStore=%s" % (curLV, maxLV, curTotalExp, maxLVExpStore), curPlayer.GetPlayerID())
             return 0, expViewType
         
         # 杀怪
@@ -4255,7 +4255,7 @@
         
         # 不可再升级时,增加后的经验不可超过最大可存储经验
         #if curLV >= nextReinLV or curLV >= maxLV:
-        if curLV >= maxLV:
+        if curLV >= maxLV and maxLVExpStore > 0:
             addExp = min(addExp, max(0, maxLVExpStore - curTotalExp))
 
         if addExp <= 0:
@@ -4356,7 +4356,7 @@
         needSyncTalentPoint = False
         playerNeedDoLVUp = False
         curLV = curPlayer.GetLV()
-        maxLV = IpyGameDataPY.GetFuncCfg("PlayerMaxLV", 1)
+        maxLV = GetPlayerMaxLV(curPlayer)
         
         curPlayer.BeginRefreshState()
         #befXP = curPlayer.GetXP()
@@ -6828,6 +6828,16 @@
         return 0
     return lvIpyData.GetExpPoint() * ChConfig.Def_PerPointValue + lvIpyData.GetExp()
 
+def GetPlayerMaxLV(curPlayer):
+    ## 获取玩家实际可升的最大等级
+    maxLV = IpyGameDataPY.GetFuncCfg("PlayerMaxLV", 1)
+    curRealmLV = curPlayer.GetOfficialRank()
+    realmIpyData = PlayerPrestigeSys.GetRealmIpyData(curRealmLV)
+    if not realmIpyData:
+        return 0
+    playerMaxLV = min(maxLV, realmIpyData.GetLVMax())
+    return playerMaxLV
+
 ## 获得玩家实际等级
 #  @param curPlayer 玩家
 #  @return 玩家实际等级

--
Gitblit v1.8.0