From 27449927086d449e2316e2a5422cc82077bae377 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 23 一月 2019 14:24:44 +0800
Subject: [PATCH] 6026 子 【开发】【1.5.100】诛仙装备开发 / 【后端】【1.5.100】诛仙装备分解

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py |    1 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini                               |    6 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py                       |   84 ++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py                   |  112 +++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py                     |   20 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py                 |  111 ++++++++++
 PySysDB/PySysDBPY.h                                                                                      |    8 
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py                                            |   84 ++++++++
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py                                        |  112 +++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                          |    4 
 10 files changed, 533 insertions(+), 9 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 832ed26..c88ffaa 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1632,4 +1632,12 @@
 	dict		GradeAward;	//评级奖励
 	WORD		UnLockEquipPlace;	//解锁的装备位
 	DWORD		NeedPower;	//推荐战力
+};
+
+//诛仙装备分解表
+
+struct tagZhuXianEquipDecompose
+{
+	BYTE		_ClassLV;	//阶级
+	dict		DecomposeInfo;	//{(产出物品ID,..):饼图,..}
 };
\ No newline at end of file
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index 1df956a..481d0ec 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -7136,6 +7136,90 @@
 
 
 #------------------------------------------------------
+# A3 32 诛仙装备分解 #tagCMZhuXianEquipDecompose
+
+class  tagCMZhuXianEquipDecompose(Structure):
+    Head = tagHead()
+    Count = 0    #(BYTE Count)//材料所在背包索引的数量
+    IndexList = list()    #(vector<WORD> IndexList)//材料所在背包索引列表
+    ItemIDList = list()    #(vector<DWORD> ItemIDList)//材料所在背包物品ID列表
+    IsAuto = 0    #(BYTE IsAuto)//是否自动分解
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA3
+        self.Head.SubCmd = 0x32
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.Count):
+            value,_pos=CommFunc.ReadWORD(_lpData,_pos)
+            self.IndexList.append(value)
+        for i in range(self.Count):
+            value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+            self.ItemIDList.append(value)
+        self.IsAuto,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA3
+        self.Head.SubCmd = 0x32
+        self.Count = 0
+        self.IndexList = list()
+        self.ItemIDList = list()
+        self.IsAuto = 0
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        length += 2 * self.Count
+        length += 4 * self.Count
+        length += 1
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.Count)
+        for i in range(self.Count):
+            data = CommFunc.WriteWORD(data, self.IndexList[i])
+        for i in range(self.Count):
+            data = CommFunc.WriteDWORD(data, self.ItemIDList[i])
+        data = CommFunc.WriteBYTE(data, self.IsAuto)
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                Count:%d,
+                                IndexList:%s,
+                                ItemIDList:%s,
+                                IsAuto:%d
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.Count,
+                                "...",
+                                "...",
+                                self.IsAuto
+                                )
+        return DumpString
+
+
+m_NAtagCMZhuXianEquipDecompose=tagCMZhuXianEquipDecompose()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMZhuXianEquipDecompose.Head.Cmd,m_NAtagCMZhuXianEquipDecompose.Head.SubCmd))] = m_NAtagCMZhuXianEquipDecompose
+
+
+#------------------------------------------------------
 # A5 30 购买魔魂铜钱经验什么的 #tagCMBuySomething
 
 class  tagCMBuySomething(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 90a694f..def89d1 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -20107,6 +20107,118 @@
 
 
 #------------------------------------------------------
+# A8 15 诛仙装备分解结果通知 #tagMCZhuXianDecomposeResult
+
+class  tagMCZhuXianDecomposeItem(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("ItemID", c_int),    #物品ID
+                  ("ItemCnt", c_ubyte),    #物品数量
+                  ("IsBind", c_ubyte),    #是否绑定
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        return
+
+    def ReadData(self, stringData, _pos=0, _len=0):
+        self.Clear()
+        memmove(addressof(self), stringData[_pos:], self.GetLength())
+        return _pos + self.GetLength()
+
+    def Clear(self):
+        self.ItemID = 0
+        self.ItemCnt = 0
+        self.IsBind = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagMCZhuXianDecomposeItem)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// A8 15 诛仙装备分解结果通知 //tagMCZhuXianDecomposeResult:
+                                ItemID:%d,
+                                ItemCnt:%d,
+                                IsBind:%d
+                                '''\
+                                %(
+                                self.ItemID,
+                                self.ItemCnt,
+                                self.IsBind
+                                )
+        return DumpString
+
+
+class  tagMCZhuXianDecomposeResult(Structure):
+    Head = tagHead()
+    Cnt = 0    #(BYTE Cnt)//数量
+    ItemList = list()    #(vector<tagMCZhuXianDecomposeItem> ItemList)
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA8
+        self.Head.SubCmd = 0x15
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.Cnt):
+            temItemList = tagMCZhuXianDecomposeItem()
+            _pos = temItemList.ReadData(_lpData, _pos)
+            self.ItemList.append(temItemList)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA8
+        self.Head.SubCmd = 0x15
+        self.Cnt = 0
+        self.ItemList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        for i in range(self.Cnt):
+            length += self.ItemList[i].GetLength()
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.Cnt)
+        for i in range(self.Cnt):
+            data = CommFunc.WriteString(data, self.ItemList[i].GetLength(), self.ItemList[i].GetBuffer())
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                Cnt:%d,
+                                ItemList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.Cnt,
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagMCZhuXianDecomposeResult=tagMCZhuXianDecomposeResult()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCZhuXianDecomposeResult.Head.Cmd,m_NAtagMCZhuXianDecomposeResult.Head.SubCmd))] = m_NAtagMCZhuXianDecomposeResult
+
+
+#------------------------------------------------------
 # AA 0C 登录奖励活动信息 #tagMCActLoginAwardInfo
 
 class  tagMCActLoginAwardItem(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index 885c20d..2689b26 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1350,7 +1350,7 @@
 Writer = hxp
 Releaser = hxp
 RegType = 0
-RegisterPackCount = 2
+RegisterPackCount = 3
 
 PacketCMD_1=0xA3
 PacketSubCMD_1=0x30
@@ -1360,6 +1360,10 @@
 PacketSubCMD_2=0x31
 PacketCallFunc_2=OnUnEquipZhuXianItem
 
+PacketCMD_3=0xA3
+PacketSubCMD_3=0x32
+PacketCallFunc_3=OnZhuXianEquipDecompose
+
 ;个推
 [PlayerGeTui]
 ScriptName = Player\PlayerGeTui.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 173dabb..2dd7da7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4881,7 +4881,8 @@
 ItemDel_ChatBubbleBox, # 激活聊天气泡框
 ItemDel_GatherSoul, # 聚魂分解
 ItemDel_CoatDecompose, # 时装分解
-) = range(2000, 2000 + 37)
+ItemDel_ZhuXianDecompose, # 诛仙装备分解
+) = range(2000, 2000 + 38)
 
 # 物品扣除类型对应信息 {类型:eventName, ...}
 ItemDelTypeDict = {
@@ -4922,6 +4923,7 @@
                    ItemDel_ChatBubbleBox:"ChatBubbleBox",
                    ItemDel_GatherSoul:"GatherSoul",
                    ItemDel_CoatDecompose:"CoatDecompose",
+                   ItemDel_ZhuXianDecompose:"ZhuXianDecompose",
                    }
 
 ##==================================================================================================
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 1df956a..481d0ec 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -7136,6 +7136,90 @@
 
 
 #------------------------------------------------------
+# A3 32 诛仙装备分解 #tagCMZhuXianEquipDecompose
+
+class  tagCMZhuXianEquipDecompose(Structure):
+    Head = tagHead()
+    Count = 0    #(BYTE Count)//材料所在背包索引的数量
+    IndexList = list()    #(vector<WORD> IndexList)//材料所在背包索引列表
+    ItemIDList = list()    #(vector<DWORD> ItemIDList)//材料所在背包物品ID列表
+    IsAuto = 0    #(BYTE IsAuto)//是否自动分解
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA3
+        self.Head.SubCmd = 0x32
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.Count):
+            value,_pos=CommFunc.ReadWORD(_lpData,_pos)
+            self.IndexList.append(value)
+        for i in range(self.Count):
+            value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+            self.ItemIDList.append(value)
+        self.IsAuto,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA3
+        self.Head.SubCmd = 0x32
+        self.Count = 0
+        self.IndexList = list()
+        self.ItemIDList = list()
+        self.IsAuto = 0
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        length += 2 * self.Count
+        length += 4 * self.Count
+        length += 1
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.Count)
+        for i in range(self.Count):
+            data = CommFunc.WriteWORD(data, self.IndexList[i])
+        for i in range(self.Count):
+            data = CommFunc.WriteDWORD(data, self.ItemIDList[i])
+        data = CommFunc.WriteBYTE(data, self.IsAuto)
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                Count:%d,
+                                IndexList:%s,
+                                ItemIDList:%s,
+                                IsAuto:%d
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.Count,
+                                "...",
+                                "...",
+                                self.IsAuto
+                                )
+        return DumpString
+
+
+m_NAtagCMZhuXianEquipDecompose=tagCMZhuXianEquipDecompose()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMZhuXianEquipDecompose.Head.Cmd,m_NAtagCMZhuXianEquipDecompose.Head.SubCmd))] = m_NAtagCMZhuXianEquipDecompose
+
+
+#------------------------------------------------------
 # A5 30 购买魔魂铜钱经验什么的 #tagCMBuySomething
 
 class  tagCMBuySomething(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 90a694f..def89d1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -20107,6 +20107,118 @@
 
 
 #------------------------------------------------------
+# A8 15 诛仙装备分解结果通知 #tagMCZhuXianDecomposeResult
+
+class  tagMCZhuXianDecomposeItem(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("ItemID", c_int),    #物品ID
+                  ("ItemCnt", c_ubyte),    #物品数量
+                  ("IsBind", c_ubyte),    #是否绑定
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        return
+
+    def ReadData(self, stringData, _pos=0, _len=0):
+        self.Clear()
+        memmove(addressof(self), stringData[_pos:], self.GetLength())
+        return _pos + self.GetLength()
+
+    def Clear(self):
+        self.ItemID = 0
+        self.ItemCnt = 0
+        self.IsBind = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagMCZhuXianDecomposeItem)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// A8 15 诛仙装备分解结果通知 //tagMCZhuXianDecomposeResult:
+                                ItemID:%d,
+                                ItemCnt:%d,
+                                IsBind:%d
+                                '''\
+                                %(
+                                self.ItemID,
+                                self.ItemCnt,
+                                self.IsBind
+                                )
+        return DumpString
+
+
+class  tagMCZhuXianDecomposeResult(Structure):
+    Head = tagHead()
+    Cnt = 0    #(BYTE Cnt)//数量
+    ItemList = list()    #(vector<tagMCZhuXianDecomposeItem> ItemList)
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA8
+        self.Head.SubCmd = 0x15
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.Cnt):
+            temItemList = tagMCZhuXianDecomposeItem()
+            _pos = temItemList.ReadData(_lpData, _pos)
+            self.ItemList.append(temItemList)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA8
+        self.Head.SubCmd = 0x15
+        self.Cnt = 0
+        self.ItemList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        for i in range(self.Cnt):
+            length += self.ItemList[i].GetLength()
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.Cnt)
+        for i in range(self.Cnt):
+            data = CommFunc.WriteString(data, self.ItemList[i].GetLength(), self.ItemList[i].GetBuffer())
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                Cnt:%d,
+                                ItemList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.Cnt,
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagMCZhuXianDecomposeResult=tagMCZhuXianDecomposeResult()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCZhuXianDecomposeResult.Head.Cmd,m_NAtagMCZhuXianDecomposeResult.Head.SubCmd))] = m_NAtagMCZhuXianDecomposeResult
+
+
+#------------------------------------------------------
 # AA 0C 登录奖励活动信息 #tagMCActLoginAwardInfo
 
 class  tagMCActLoginAwardItem(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
index cc6f62a..d416a88 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
@@ -199,6 +199,7 @@
     # 记录开服活动宝石总等级
     OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_StoneLV, totalStoneLV)
     PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_StoneTotalLV, totalStoneLV)
+    PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Stone, totalStoneLV, False, True)
     return
 
 #//A3 05 宝石摘取 #tagCMEquipStonePick
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index c646e09..95334be 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1285,6 +1285,11 @@
                         ("WORD", "UnLockEquipPlace", 0),
                         ("DWORD", "NeedPower", 0),
                         ),
+
+                "ZhuXianEquipDecompose":(
+                        ("BYTE", "ClassLV", 1),
+                        ("dict", "DecomposeInfo", 0),
+                        ),
                 }
 
 
@@ -3916,6 +3921,17 @@
     def GetGradeAward(self): return self.GradeAward # 评级奖励
     def GetUnLockEquipPlace(self): return self.UnLockEquipPlace # 解锁的装备位
     def GetNeedPower(self): return self.NeedPower # 推荐战力
+
+# 诛仙装备分解表
+class IPY_ZhuXianEquipDecompose():
+    
+    def __init__(self):
+        self.ClassLV = 0
+        self.DecomposeInfo = {}
+        return
+        
+    def GetClassLV(self): return self.ClassLV # 阶级
+    def GetDecomposeInfo(self): return self.DecomposeInfo # {(产出物品ID,..):饼图,..}
 
 
 def Log(msg, playerID=0, par=0):
@@ -4183,6 +4199,8 @@
         self.ipyZhuXianBossLen = len(self.ipyZhuXianBossCache)
         self.ipyZhuXianTowerCache = self.__LoadFileData("ZhuXianTower", IPY_ZhuXianTower)
         self.ipyZhuXianTowerLen = len(self.ipyZhuXianTowerCache)
+        self.ipyZhuXianEquipDecomposeCache = self.__LoadFileData("ZhuXianEquipDecompose", IPY_ZhuXianEquipDecompose)
+        self.ipyZhuXianEquipDecomposeLen = len(self.ipyZhuXianEquipDecomposeCache)
         Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
         Log("IPY_DataMgr InitOK!")
         return
@@ -4591,6 +4609,8 @@
     def GetZhuXianBossByIndex(self, index): return self.ipyZhuXianBossCache[index]
     def GetZhuXianTowerCount(self): return self.ipyZhuXianTowerLen
     def GetZhuXianTowerByIndex(self, index): return self.ipyZhuXianTowerCache[index]
+    def GetZhuXianEquipDecomposeCount(self): return self.ipyZhuXianEquipDecomposeLen
+    def GetZhuXianEquipDecomposeByIndex(self, index): return self.ipyZhuXianEquipDecomposeCache[index]
 
 IPYData = IPY_DataMgr()
 def IPY_Data(): return IPYData
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py
index 6592e7e..92d5fd1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/EquipZhuXian.py
@@ -20,29 +20,39 @@
 import ShareDefine
 import PlayerControl
 import DataRecordPack
+import IPY_GameWorld
+import ItemControler
 import IpyGameDataPY
+import NetPackCommon
+import ChPyNetSendPack
 import SkillCommon
 import PyGameData
 import ChConfig
+
+import random
+
 
 def GetZhuXianEquipIndexByPlace(equipPlace):
     ## 获取诛仙装备位对应的索引
     return equipPlace - 1 - 120
 
+
 def GetZhuXianEquipPlaceByIndex(equipIndex):
     ## 获取诛仙装备索引对应装备位
     return equipIndex + 1 + 120
+
 
 def GetZhuXianEquipPlaceIndexIsUnlock(curPlayer, equipPlaceIndex):
     ## 获取诛仙装备位是否解锁
     # @param equipPlaceIndex: 注意传入的参数是装备位索引
     equipPlace = GetZhuXianEquipPlaceByIndex(equipPlaceIndex)
-    placeUnlockDict = IpyGameDataPY.GetFuncEvalCfg("EquipZhuXian", 1, {}) # 诛仙装备位对应解锁所需诛仙塔层数 {"装备位":诛仙塔层数, ...} 没配的默认解锁
+    placeUnlockDict = IpyGameDataPY.GetFuncEvalCfg("EquipZhuXian", 1, {})  # 诛仙装备位对应解锁所需诛仙塔层数 {"装备位":诛仙塔层数, ...} 没配的默认解锁
     if str(equipPlace) not in placeUnlockDict:
         return True
     needTowerLV = placeUnlockDict[str(equipPlace)]
-    curTowerLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ZhuXianTowerPassLV) # 已过关的诛仙塔层数
+    curTowerLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ZhuXianTowerPassLV)  # 已过关的诛仙塔层数
     return curTowerLV >= needTowerLV
+
 
 def CheckLearnZhuXianSkill(curPlayer, skillID):
     ## 检查诛仙装备位装备阶数
@@ -68,6 +78,7 @@
                 return
             
     return True
+
 
 #// A3 30 装备诛仙装备 #tagCMEquipZhuXianItem
 #
@@ -127,6 +138,7 @@
     RefreshZhuXianAttr(curPlayer)   
     return
 
+
 #// A3 31 卸下诛仙装备 #tagCMUnEquipZhuXianItem
 #
 #struct    tagCMUnEquipZhuXianItem
@@ -157,10 +169,12 @@
     RefreshZhuXianAttr(curPlayer)
     return
 
+
 def RefreshZhuXianAttr(curPlayer):
     CalcZhuXianAttr(curPlayer)
     PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState() 
     return
+
 
 def CalcZhuXianAttr(curPlayer):
     ## 刷新诛仙属性
@@ -170,14 +184,14 @@
     
     allAttrList = [{} for _ in range(4)]
     allAttrListZXSuit = [{} for _ in range(4)]
-    equipScoreTotal = 0 #为解决装备评分、战力不一致的情况,装备战力改为由评分作为参数计算战力
-    equipPlaceClassLVDict = {} #装备位对应装备阶 {装备位:阶, ...}
-    equipPlaceBaseAttrDict = {} #装备位对应基础属性字典 {装备位:{属性ID:value, ...}, ...}
+    equipScoreTotal = 0  #为解决装备评分、战力不一致的情况,装备战力改为由评分作为参数计算战力
+    equipPlaceClassLVDict = {}  #装备位对应装备阶 {装备位:阶, ...}
+    equipPlaceBaseAttrDict = {}  #装备位对应基础属性字典 {装备位:{属性ID:value, ...}, ...}
     
-    attrIDSkillPlusDict = IpyGameDataPY.GetFuncEvalCfg("SkillPlusAttrID", 1, {}) # 属性ID对应影响的技能TypeID列表 {属性ID:[技能TypeID列表, ...], ...}
+    attrIDSkillPlusDict = IpyGameDataPY.GetFuncEvalCfg("SkillPlusAttrID", 1, {})  # 属性ID对应影响的技能TypeID列表 {属性ID:[技能TypeID列表, ...], ...}
     addAttrIDList = range(ShareDefine.Def_Effect_SkillAddPer1, ShareDefine.Def_Effect_SkillAddPer7 + 1)
     reduceAttrIDList = range(ShareDefine.Def_Effect_SkillReducePer1, ShareDefine.Def_Effect_SkillReducePer7 + 1)
-    zxSkillPlusAttrDict = {} # 玩家诛仙装备影响技能TypeID属性字典 {属性ID:值, ...}
+    zxSkillPlusAttrDict = {}  # 玩家诛仙装备影响技能TypeID属性字典 {属性ID:值, ...}
     
     zhuXianEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptZhuXianEquip)
     equipPackCount = zhuXianEquipPack.GetCount()
@@ -309,6 +323,7 @@
     curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_ZhuXian, equipFightPowerEx)
     return
 
+
 def GetZhuXianEquipSkillAddPer(playerID, skillTypeID):
     ## 获取诛仙装备伤害百分比提升值
     if playerID not in PyGameData.g_zhuXianSkillAddPerDict:
@@ -317,6 +332,7 @@
     if skillTypeID not in skillAddPerDict:
         return 0
     return skillAddPerDict[skillTypeID]
+
 
 def GetZhuXianEquipSkillReducePer(playerID, skillTypeID):
     ## 获取诛仙装备减伤百分比提升值
@@ -327,3 +343,84 @@
         return 0
     return skillReducePerDict[skillTypeID]
 
+
+#// A3 32 诛仙装备分解 #tagCMZhuXianEquipDecompose
+#
+#struct    tagCMZhuXianEquipDecompose
+#{
+#    tagHead        Head;
+#    BYTE        Count;        //材料所在背包索引的数量
+#    WORD        IndexList[Count];    //材料所在背包索引列表
+#    DWORD        ItemIDList[Count];    //材料所在背包物品ID列表
+#    BYTE        IsAuto;        //是否自动分解
+#};
+## 诛仙装备分解 
+#  @param playerIndex 玩家索引  
+#  @param clientData 客户端封包  
+#  @param tick 时间
+#  @return None
+def OnZhuXianEquipDecompose(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    if not clientData.Count:
+        return
+    playerID = curPlayer.GetID()
+    eatIndexList = clientData.IndexList
+    eatItemIDList = clientData.ItemIDList
+    isAuto = clientData.IsAuto
+    giveItemDict = {} #分解得到物品
+    
+    itemPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptZhuXianItem)
+    for i, index in enumerate(eatIndexList):
+        eatItem = itemPack.GetAt(index)
+        if not eatItem or eatItem.IsEmpty():
+            continue
+        eatItemID = eatItem.GetItemTypeID()
+        if eatItemID != eatItemIDList[i]:
+            GameWorld.Log('诛仙装备分解 发的物品ID不对应index=%s eatItemID=%s,ItemIDList[i]=%s' % (index, eatItemID, eatItemIDList[i]), playerID)
+            continue
+        if eatItem.GetType() not in ChConfig.Def_ZhuXianEquiipType:
+            GameWorld.Log('诛仙装备分解 发的物品不是诛仙装备  eatItemID=%s' % eatItemID, playerID)
+            continue
+        
+        itemClassLV = ItemCommon.GetItemClassLV(eatItem)
+        ipyData = IpyGameDataPY.GetIpyGameData('ZhuXianEquipDecompose', itemClassLV)
+        if not ipyData:
+            GameWorld.DebugLog('ZhuXianEquipDecompose 未配置该阶级分解itemClassLV=%s' % itemClassLV, playerID)
+            continue
+        decomposeInfoDict = ipyData.GetDecomposeInfo()
+        getItemDict = {}
+        for itemIDList, rateList in decomposeInfoDict.items():
+            giveitemCnt = GameWorld.GetResultByRandomList(rateList, 0)
+            if not giveitemCnt:
+                continue
+            if isinstance(itemIDList, tuple):
+                itemID = random.choice(itemIDList)
+            else:
+                itemID = itemIDList
+            giveItemDict[itemID] = giveItemDict.get(itemID, 0) + giveitemCnt
+            getItemDict[itemID] = getItemDict.get(itemID, 0) + giveitemCnt
+        saveDataDict = {'getItemDict':getItemDict, 'isAuto':isAuto}
+        ItemCommon.DelItem(curPlayer, eatItem, 1, True, ChConfig.ItemDel_ZhuXianDecompose, saveDataDict)
+    if giveItemDict:
+        needSpace = len(giveItemDict)
+        packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
+        if packSpace < needSpace:
+            prizeItemList = [[giveItemID, itemCnt, 1] for giveItemID, itemCnt in giveItemDict.items()]
+            PlayerControl.SendMailByKey("DefaultLackSpace", [curPlayer.GetPlayerID()], prizeItemList)
+        else:
+            for giveItemID, itemCnt in giveItemDict.items():
+                ItemControler.GivePlayerItem(curPlayer, giveItemID, itemCnt, True, [IPY_GameWorld.rptItem], True)
+    
+    #通知结果
+    packData = ChPyNetSendPack.tagMCZhuXianDecomposeResult()
+    packData.Clear()
+    packData.ItemList = []
+    for itemID, itemCnt in giveItemDict.items():
+        itemInfo = ChPyNetSendPack.tagMCZhuXianDecomposeItem()
+        itemInfo.ItemID = itemID
+        itemInfo.ItemCnt = itemCnt
+        itemInfo.IsBind = 1
+        packData.ItemList.append(itemInfo)
+    packData.Cnt = len(packData.ItemList)
+    NetPackCommon.SendFakePack(curPlayer, packData)
+    return

--
Gitblit v1.8.0