From 1579f778ac32e4a62e830f52611715c5c7c5a307 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 04 七月 2019 11:48:21 +0800
Subject: [PATCH] 7803 【2.0.200】【后端】灵根升品显示特效

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
index 94b076e..d8dd02f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -1189,7 +1189,7 @@
 #===============================================================================
 # #//03 2F 请求装备显隐#tagRequestEquipShowHide
 # //装备显示开关
-# int GetEquipShowSwitch(); 第几套*10+是否有套装
+# int GetEquipShowSwitch(); 灵根特效表key * 1000+第几套*10+是否有套装
 #===============================================================================
 ##请求装备显隐. (设置显示哪套装备外观)
 # @param index 玩家索引
@@ -1243,7 +1243,7 @@
     return
 
 def ChangeEquipfacadeByClassLV(curPlayer, classLV):
-    ##变更第X套装备外观
+    ##变更第X套装备外观 灵根特效表key * 1000+第几套*10+是否有套装
     oldEquipShowSwitch = curPlayer.GetEquipShowSwitch()
     realSuit=1
     equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
@@ -1260,11 +1260,60 @@
         if not curEquip.GetSuiteID():
             realSuit = 0
             break
-    updEquipShowSwitch = classLV*10+realSuit
+    updEquipShowSwitch = oldEquipShowSwitch /1000*1000+ classLV*10+realSuit
     if oldEquipShowSwitch == updEquipShowSwitch:
         return
     curPlayer.SetEquipShowSwitch(updEquipShowSwitch)
     return True
+
+def ChangeEquipfacadeByLingGen(curPlayer):
+    ## 灵根品级变化影响角色外观显示 灵根特效表key * 1000+第几套*10+是否有套装
+    pointValueInfo = [[ShareDefine.Def_Effect_Metal,PlayerControl.GetMetalQualityLV(curPlayer)],
+                          [ShareDefine.Def_Effect_Wood,PlayerControl.GetWoodQualityLV(curPlayer)],
+                          [ShareDefine.Def_Effect_Water,PlayerControl.GetWaterQualityLV(curPlayer)],
+                          [ShareDefine.Def_Effect_Fire,PlayerControl.GetFireQualityLV(curPlayer)],
+                          [ShareDefine.Def_Effect_Earth,PlayerControl.GetEarthQualityLV(curPlayer)],
+                          ]
+    g_skillElementCntDict = {} #灵根对应使用专精技能数量
+    skillManager = curPlayer.GetSkillManager()
+    gameData = GameWorld.GetGameData()
+    for i in xrange(skillManager.GetSkillCount()):
+        curSkill = skillManager.GetSkillByIndex(i)
+        skillID = curSkill.GetSkillTypeID()
+        curSelectSkillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % skillID)
+        if not curSelectSkillID:
+            continue
+        elementSkillData = gameData.GetSkillBySkillID(curSelectSkillID)
+        if not elementSkillData:
+            continue
+        skillElementType = SkillShell.GetSkillElementType(elementSkillData)
+        g_skillElementCntDict[skillElementType] = g_skillElementCntDict.get(skillElementType, 0) + 1
+    
+    showPointID, showQualityLV = 0, 0
+    for pointID, qualityLV in pointValueInfo:
+        if qualityLV > showQualityLV:
+            showQualityLV = qualityLV
+            showPointID = pointID
+        elif showQualityLV and qualityLV == showQualityLV:
+            #比谁的专精技能数量多
+            if g_skillElementCntDict.get(pointID, 0) > g_skillElementCntDict.get(showPointID, 0):
+                showQualityLV = qualityLV
+                showPointID = pointID
+    effectID = 0
+    if showPointID:
+        ipyData = IpyGameDataPY.GetIpyGameData('LingGenEffect', showPointID, showQualityLV)
+        if not ipyData:
+            return
+        effectID = ipyData.GetID()
+    oldEquipShowSwitch = curPlayer.GetEquipShowSwitch()
+    updEquipShowSwitch = oldEquipShowSwitch % 1000 + 1000 * effectID
+    GameWorld.DebugLog('灵根品级变化影响角色外观显示g_skillElementCntDict=%s,oldEquipShowSwitch=%s,updEquipShowSwitch=%s'%
+                       (g_skillElementCntDict, oldEquipShowSwitch, updEquipShowSwitch))
+    if oldEquipShowSwitch != updEquipShowSwitch:
+        curPlayer.SetEquipShowSwitch(updEquipShowSwitch)
+    return
+
+
 #获取当前是第几套装备外观
 def GetEquipFacadeClassLV(curPlayer):return curPlayer.GetEquipShowSwitch()/10
 

--
Gitblit v1.8.0