From af2575ee52476f0d87d69a76dca5ee1f58cf114d Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 13 四月 2019 10:55:47 +0800
Subject: [PATCH] 6509 子 【2.0】五行灵根 / 【后端】【2.0】五行灵根修改

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py            |   12 ++++++------
 PySysDB/PySysDBPY.h                                                                             |    4 ++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py     |   26 ++++++++++++++++++--------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py |   18 ++++++++++++++++++
 4 files changed, 44 insertions(+), 16 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 7bc7cab..34507c4 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -16,8 +16,8 @@
 {
 	BYTE		_AttrID;	//属性ID
     dict		AddAttrInfoPerPoint;	//每点增加属性信息
-	BYTE		PointQualityAttrID;		//点数品质进阶增加属性ID
-	list		PointQualityAttrValueList;		//点数品质进阶增加属性值列表
+	dict		PointQualityAttrIDDict;		//点数品质进阶增加属性ID, 根据职业区分
+	dict		PointQualityAttrValueDict;		//点数品质进阶增加属性值列表, 根据职业区分
 	list		PointQualityIntervalList;		//点数品质进阶属性点区间列表
 };
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 0c592e0..a00ba7b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -44,8 +44,8 @@
                 "RolePoint":(
                         ("BYTE", "AttrID", 1),
                         ("dict", "AddAttrInfoPerPoint", 0),
-                        ("BYTE", "PointQualityAttrID", 0),
-                        ("list", "PointQualityAttrValueList", 0),
+                        ("dict", "PointQualityAttrIDDict", 0),
+                        ("dict", "PointQualityAttrValueDict", 0),
                         ("list", "PointQualityIntervalList", 0),
                         ),
 
@@ -1442,15 +1442,15 @@
     def __init__(self):
         self.AttrID = 0
         self.AddAttrInfoPerPoint = {}
-        self.PointQualityAttrID = 0
-        self.PointQualityAttrValueList = []
+        self.PointQualityAttrIDDict = {}
+        self.PointQualityAttrValueDict = {}
         self.PointQualityIntervalList = []
         return
         
     def GetAttrID(self): return self.AttrID # 属性ID
     def GetAddAttrInfoPerPoint(self): return self.AddAttrInfoPerPoint # 每点增加属性信息
-    def GetPointQualityAttrID(self): return self.PointQualityAttrID # 点数品质进阶增加属性ID
-    def GetPointQualityAttrValueList(self): return self.PointQualityAttrValueList # 点数品质进阶增加属性值列表
+    def GetPointQualityAttrIDDict(self): return self.PointQualityAttrIDDict # 点数品质进阶增加属性ID, 根据职业区分
+    def GetPointQualityAttrValueDict(self): return self.PointQualityAttrValueDict # 点数品质进阶增加属性值列表, 根据职业区分
     def GetPointQualityIntervalList(self): return self.PointQualityIntervalList # 点数品质进阶属性点区间列表
 
 # 境界表
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 0953bf8..8ab0775 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -3417,16 +3417,21 @@
     curLV = curPlayer.GetLV()
     if curLV < openLV:
         return 0
+    # 初始点+升级点+境界点
+    setFreePoint = IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 2)
+    
     addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
-    initFreePoint = IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 2)
-    setFreePoint = initFreePoint
-    for lv in xrange(openLV, curLV+1):
-        setFreePoint += GameWorld.GetDictValueByRangeKey(addPointDict, lv, 0)
+    for rangLVs, point in addPointDict.items():
+        if curLV < rangLVs[0]:
+            continue
+        setFreePoint += point * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
+    
+    #境界提升点数
+    setFreePoint += curPlayer.GetOfficialRank() * IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 3)
     return setFreePoint
 
 def DoAddPointOpen(curPlayer):
-    '''加点功能开启 处理给自由属性点及老号处理  
-                    清除老服玩家未加点的点数(清零),以前加的加点属性不清除,属性不变,战力不减, 根据最新的加点开启等级和老服玩家的当前等级,相差的差值给予玩家对应的加点点数'''
+    '''加点功能开启'''
     beforeFreePoint = curPlayer.GetFreePoint()
     
     setFreePoint = GetAllPointByLV(curPlayer)
@@ -3636,6 +3641,9 @@
     #  @remarks 玩家升级 加点 2010-05-26 adaws修改 原来有加技能点 现将升级加技能提出 
     def __DoLVUPAddPoint(self):
         curPlayer = self.__Player
+        if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_AddPoint):
+            # 未开启前不可加点,因为DoAddPointOpen会一次性补齐,避免意外情况多加了点数
+            return
 
         curFreePoint = curPlayer.GetFreePoint()
         addPoint = GetLvUp_AddPoint(curPlayer)
@@ -4047,8 +4055,10 @@
             pointFuncInfo[1](curPlayer, curPQLV)
             if not curPQLV:
                 continue
-            pqAttrID = ipyData.GetPointQualityAttrID()
-            pqAttrValueList = ipyData.GetPointQualityAttrValueList()
+            pqAttrIDDict = ipyData.GetPointQualityAttrIDDict()
+            pqAttrID = pqAttrIDDict[curPlayer.GetJob()]
+            pqAttrValueDict = ipyData.GetPointQualityAttrValueDict()
+            pqAttrValueList = pqAttrValueDict[str(curPlayer.GetJob())]
             pqAttrValue = 0 if curPQLV > len(pqAttrValueList) else pqAttrValueList[curPQLV - 1]
             CalcAttrDict_Type(pqAttrID, pqAttrValue, lingGenQualityAttrList)
             #GameWorld.DebugLog("        属性点(%s)品阶等级属性: curPQLV=%s,pqAttrID=%s,pqAttrValue=%s" % (pointAttrID, curPQLV, pqAttrID, pqAttrValue))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
index cde63ee..6774f91 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
@@ -143,6 +143,21 @@
     DoRealmLVUpLogic(curPlayer)
     return
 
+# 提升1级境界加点
+def __DoRealmLVUpAddPoint(curPlayer):
+    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_AddPoint):
+        # 未开启前不可加点,因为DoAddPointOpen会一次性补齐,避免意外情况多加了点数
+        return
+
+    curFreePoint = curPlayer.GetFreePoint()
+    addPoint = IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 3)
+    if addPoint != 0:
+        setFreePoint = curFreePoint + addPoint
+        DataRecordPack.DR_Freepoint(curPlayer, "RealmLVUp", addPoint)
+        curPlayer.SetFreePoint(setFreePoint)
+
+    return
+
 
 def DoRealmLVUpLogic(curPlayer, needSys=True):
     curRealmLV = curPlayer.GetOfficialRank()
@@ -153,6 +168,9 @@
         return
     
     curPlayer.SetOfficialRank(nextRealmLv)
+    # 提升1级境界加点
+    __DoRealmLVUpAddPoint(curPlayer)
+    
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmFBIsOpen, 0)
     if needSys:
         addBuffID = nextRealmIpyData.GetBuffID()

--
Gitblit v1.8.0