From caace426c6cb047cf1b734486615111853225771 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 17 六月 2021 18:31:35 +0800
Subject: [PATCH] 8988 【主干】【BT2】【BT2-1.100.1】【后端】神装进阶功能

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py |  159 ++++++++++++++++++++++++++++++-----------------------
 1 files changed, 90 insertions(+), 69 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index f1676de..a47cd1d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -6756,98 +6756,52 @@
 # A3 30 装备神装进阶 #tagCMEquipEvolve
 
 class  tagCMEquipEvolve(Structure):
-    Head = tagHead()
-    EquipIndex = 0    #(BYTE EquipIndex)// 要进阶的装备在装备背包中索引
-    NeedEquipIDIndex = 0    #(BYTE NeedEquipIDIndex)// 所需固定装备B在背包中索引
-    NeedItemIDIndexCnt = 0    #(BYTE NeedItemIDIndexCnt)// 附加材料在背包中索引个数
-    NeedItemIDIndex = list()    #(vector<BYTE> NeedItemIDIndex)// 附加材料在背包的索引列表
-    NeedSuitIndexCnt = 0    #(BYTE NeedSuitIndexCnt)// 所需套装材料在背包中索引个数
-    NeedSuitIndex = list()    #(vector<BYTE> NeedSuitIndex)// 所需套装材料在背包的索引列表
-    data = None
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("EquipIndex", c_ubyte),    # 要进阶的装备在装备背包中索引
+                  ]
 
     def __init__(self):
         self.Clear()
-        self.Head.Cmd = 0xA3
-        self.Head.SubCmd = 0x30
+        self.Cmd = 0xA3
+        self.SubCmd = 0x30
         return
 
-    def ReadData(self, _lpData, _pos=0, _Len=0):
+    def ReadData(self, stringData, _pos=0, _len=0):
         self.Clear()
-        _pos = self.Head.ReadData(_lpData, _pos)
-        self.EquipIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
-        self.NeedEquipIDIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
-        self.NeedItemIDIndexCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
-        for i in range(self.NeedItemIDIndexCnt):
-            value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
-            self.NeedItemIDIndex.append(value)
-        self.NeedSuitIndexCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
-        for i in range(self.NeedSuitIndexCnt):
-            value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
-            self.NeedSuitIndex.append(value)
-        return _pos
+        memmove(addressof(self), stringData[_pos:], self.GetLength())
+        return _pos + self.GetLength()
 
     def Clear(self):
-        self.Head = tagHead()
-        self.Head.Clear()
-        self.Head.Cmd = 0xA3
-        self.Head.SubCmd = 0x30
+        self.Cmd = 0xA3
+        self.SubCmd = 0x30
         self.EquipIndex = 0
-        self.NeedEquipIDIndex = 0
-        self.NeedItemIDIndexCnt = 0
-        self.NeedItemIDIndex = list()
-        self.NeedSuitIndexCnt = 0
-        self.NeedSuitIndex = list()
         return
 
     def GetLength(self):
-        length = 0
-        length += self.Head.GetLength()
-        length += 1
-        length += 1
-        length += 1
-        length += 1 * self.NeedItemIDIndexCnt
-        length += 1
-        length += 1 * self.NeedSuitIndexCnt
-
-        return length
+        return sizeof(tagCMEquipEvolve)
 
     def GetBuffer(self):
-        data = ''
-        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
-        data = CommFunc.WriteBYTE(data, self.EquipIndex)
-        data = CommFunc.WriteBYTE(data, self.NeedEquipIDIndex)
-        data = CommFunc.WriteBYTE(data, self.NeedItemIDIndexCnt)
-        for i in range(self.NeedItemIDIndexCnt):
-            data = CommFunc.WriteBYTE(data, self.NeedItemIDIndex[i])
-        data = CommFunc.WriteBYTE(data, self.NeedSuitIndexCnt)
-        for i in range(self.NeedSuitIndexCnt):
-            data = CommFunc.WriteBYTE(data, self.NeedSuitIndex[i])
-        return data
+        return string_at(addressof(self), self.GetLength())
 
     def OutputString(self):
-        DumpString = '''
-                                Head:%s,
-                                EquipIndex:%d,
-                                NeedEquipIDIndex:%d,
-                                NeedItemIDIndexCnt:%d,
-                                NeedItemIDIndex:%s,
-                                NeedSuitIndexCnt:%d,
-                                NeedSuitIndex:%s
+        DumpString = '''// A3 30 装备神装进阶 //tagCMEquipEvolve:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                EquipIndex:%d
                                 '''\
                                 %(
-                                self.Head.OutputString(),
-                                self.EquipIndex,
-                                self.NeedEquipIDIndex,
-                                self.NeedItemIDIndexCnt,
-                                "...",
-                                self.NeedSuitIndexCnt,
-                                "..."
+                                self.Cmd,
+                                self.SubCmd,
+                                self.EquipIndex
                                 )
         return DumpString
 
 
 m_NAtagCMEquipEvolve=tagCMEquipEvolve()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMEquipEvolve.Head.Cmd,m_NAtagCMEquipEvolve.Head.SubCmd))] = m_NAtagCMEquipEvolve
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMEquipEvolve.Cmd,m_NAtagCMEquipEvolve.SubCmd))] = m_NAtagCMEquipEvolve
 
 
 #------------------------------------------------------
@@ -6959,6 +6913,73 @@
 
 
 #------------------------------------------------------
+# A3 31 装备神装拆解 #tagCMEquipShenDecompose
+
+class  tagCMEquipShenDecompose(Structure):
+    Head = tagHead()
+    Count = 0    #(BYTE Count)//所在背包索引的数量
+    IndexList = list()    #(vector<WORD> IndexList)//所在背包索引列表
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xA3
+        self.Head.SubCmd = 0x31
+        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)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xA3
+        self.Head.SubCmd = 0x31
+        self.Count = 0
+        self.IndexList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        length += 2 * self.Count
+
+        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])
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                Count:%d,
+                                IndexList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.Count,
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagCMEquipShenDecompose=tagCMEquipShenDecompose()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMEquipShenDecompose.Head.Cmd,m_NAtagCMEquipShenDecompose.Head.SubCmd))] = m_NAtagCMEquipShenDecompose
+
+
+#------------------------------------------------------
 #A3 05 宝石摘取 #tagCMEquipStonePick
 
 class  tagCMEquipStonePick(Structure):

--
Gitblit v1.8.0