From dfef43adce546cc3d8578811f8b82689246d227c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 11 五月 2019 18:24:03 +0800
Subject: [PATCH] 6603 【后端】【2.0】增加新版的sp和被动技能 - 消耗印记问题

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
index e06a6b6..8dc357f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -2119,12 +2119,14 @@
         # 重刷被动技能
         PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer)
         # 重刷技能战力
-        PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
+        curControl = PlayerControl.PlayerControl(curPlayer)
+        curControl.RefreshAllSkill()
+        curControl.RefreshPlayerAttrState()
        
     NotifyElementSkillInfo(curPlayer, mainSkillID, selectSkillID if updSelectSkillLV != activeSkillLV else 0)
     return
 
-def RefreshElementSkill(curPlayer, skillTypeID):
+def RefreshElementSkill(curPlayer, skillTypeID, isChangeLV=True):
     ##更新专精技能生效的等级
     __InitElementSkillInfo()
     if skillTypeID not in PyGameData.g_elemntSkillDict:
@@ -2153,6 +2155,8 @@
     curSkill = skillManager.FindSkillBySkillTypeID(skillTypeID)
     curSkillLV = curSkill.GetSkillLV() if curSkill else 0
     #GameWorld.DebugLog('更新专精技能生效的等级 skillTypeID=%s,curSkillLV=%s,activeSkillLV=%s,updSkillLV=%s'%(skillTypeID, curSkillLV, activeSkillLV, updSkillLV))
+    if not isChangeLV:
+        return
     if updSkillLV == curSkillLV:
         return
     elif updSkillLV < curSkillLV:
@@ -2172,7 +2176,7 @@
     #加点、丹药、境界、洗点 会影响灵根点
     __InitElementSkillInfo()
     
-    needRefreshSkillIDList = []
+    needRefreshSkillIDDict = {} #{skillid:是否变更技能等级}
     skillManager = curPlayer.GetSkillManager()
     for i in xrange(skillManager.GetSkillCount()):
         hasSkill = skillManager.GetSkillByIndex(i)
@@ -2180,6 +2184,7 @@
         ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, True, False)
         if not ipyDataList:
             continue
+        curSelectSkillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % hasSkillID)
         for ipyData in ipyDataList:
             curElementSkillID = ipyData.GetElementSkillID()
             if curElementSkillID not in PyGameData.g_elemntSkillDict:
@@ -2187,17 +2192,20 @@
             attrID = GetSkillUpNeedAttr(PyGameData.g_elemntSkillDict[curElementSkillID][0])[0]
             if attrID not in attrIDList:
                 continue
-            needRefreshSkillIDList.append(curElementSkillID)
+            needRefreshSkillIDDict[curElementSkillID] = curSelectSkillID == curElementSkillID
+    
     #GameWorld.DebugLog('属性点变更 刷新专精attrIDList=%s,needRefreshSkillIDList=%s'%(attrIDList,needRefreshSkillIDList))
     isRefresh = False
-    for skillID in needRefreshSkillIDList:
-        if RefreshElementSkill(curPlayer, skillID):
+    for skillID, isChangeLV in needRefreshSkillIDDict.items():
+        if RefreshElementSkill(curPlayer, skillID, isChangeLV):
             isRefresh = True
     if isRefresh:
         # 重刷被动技能
         PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer)    
         # 重刷技能战力
-        PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
+        curControl = PlayerControl.PlayerControl(curPlayer)
+        curControl.RefreshAllSkill()
+        curControl.RefreshPlayerAttrState()
     NotifyElementSkillInfo(curPlayer)
     return
 

--
Gitblit v1.8.0