From f10b4418d4b543e77dadf11730ddd7636c11cf79 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 20 十一月 2019 19:55:24 +0800
Subject: [PATCH] 8341 【恺英】【后端】强化进化系统优化(强化大师)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py |   79 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 78 insertions(+), 1 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
index 4897a13..8be890e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
@@ -33,6 +33,8 @@
 import ChConfig
 import ChEquip
 import EventShell
+import ChPyNetSendPack
+import NetPackCommon
 #-------------------------------------------------------------------------------------------
 
 #===============================================================================
@@ -147,7 +149,6 @@
     OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_PlusLV, ChEquip.GetTotalPlusLV(curPlayer))
     return
 
-
 def DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV):
     #先刷装备BUFF 再计算属性
     curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrActivatyNotify, ChConfig.Def_AttrActivatyNotify_Plus)
@@ -205,3 +206,79 @@
     EventShell.EventRespons_EquipPlusEvolve(curPlayer, nextEvolveLV)
     return
 
+
+#// A5 C7 激活大师强化等级 #tagCMActivateMasterPlusLV
+#
+#struct    tagCMActivateMasterPlusLV
+#{
+#    tagHead        Head;
+#    BYTE    ClassLV;    // 所属装备阶
+#    WORD    MasterPlusLV;    // 大师强化等级
+#};
+def OnActivateMasterPlusLV(index, clientData, tick):
+    
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    classLV = clientData.ClassLV
+    actMasterPlusLV = clientData.MasterPlusLV
+    
+    curMasterPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV)
+    if curMasterPlusLV >= actMasterPlusLV:
+        # 已经激活过了
+        GameWorld.DebugLog("已经激活过该强化大师等级了! actMasterPlusLV=%s,curMasterPlusLV=%s" % (actMasterPlusLV, curMasterPlusLV))
+        return
+    
+    ipyData = IpyGameDataPY.GetIpyGameDataByCondition("ItemPlusMaster", {"ClassLV":classLV, "MasterPlusLV":actMasterPlusLV}, False, False)
+    if not ipyData:
+        GameWorld.DebugLog("不存在该强化大师等级! actMasterPlusLV=%s" % actMasterPlusLV)
+        return
+    
+    packType = IPY_GameWorld.rptEquip
+    # 判断可否激活
+    for equipPlace in ChConfig.EquipPlace_Base:
+        ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
+        if not ipyData:
+            return
+        equipIndex = ipyData.GetGridIndex()
+        plusLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, equipIndex)
+        if plusLV < actMasterPlusLV:
+            GameWorld.DebugLog("部位强化等级不足,无法激活强化大师! equipPlace=%s,equipIndex=%s,plusLV=%s < %s" 
+                               % (equipPlace, equipIndex, plusLV, actMasterPlusLV))
+            return
+        
+    GameWorld.DebugLog("激活强化大师等级! classLV=%s,actMasterPlusLV=%s" % (classLV, actMasterPlusLV))
+    
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV, actMasterPlusLV)
+        
+    SyncEquipMasterPlusLVInfo(curPlayer, classLV)
+    
+    #刷新所有属性
+    DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
+    return
+
+def SyncEquipMasterPlusLVInfo(curPlayer, classLV=0, isForce=False):
+    ## 同步大师强化等级信息
+    if not classLV:
+        needSyncClassLVList = xrange(1, IpyGameDataPY.GetFuncCfg('EquipMaxClasslv') + 1)
+    else:
+        needSyncClassLVList = [classLV]
+        
+    masterPlusLVInfoList = []
+    for classLV in needSyncClassLVList:
+        masterPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV)
+        if not masterPlusLV and not isForce:
+            continue
+        lvInfo = ChPyNetSendPack.tagMCMasterPlusLV()
+        lvInfo.ClassLV = classLV
+        lvInfo.MasterPlusLV = masterPlusLV
+        masterPlusLVInfoList.append(lvInfo)
+        
+    if not masterPlusLVInfoList:
+        return
+    
+    clientPack = ChPyNetSendPack.tagMCMasterPlusLVInfo()
+    clientPack.MasterPlusLVInfoList = masterPlusLVInfoList
+    clientPack.Count = len(masterPlusLVInfoList)
+    NetPackCommon.SendFakePack(curPlayer, clientPack)
+    return
+
+

--
Gitblit v1.8.0