From a166d721a3d7ff6cd2339983214e718c7a6a0ffe Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 11 六月 2025 11:00:36 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(武将招募;武将背包;武将养成系统;)

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

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index e95e85e..cae4322 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -17264,6 +17264,411 @@
 
 
 #------------------------------------------------------
+# B2 33 武将觉醒 #tagCSHeroAwake
+
+class  tagCSHeroAwake(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("ItemIndex", c_ushort),    #武将物品所在武将背包位置索引
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x33
+        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.Cmd = 0xB2
+        self.SubCmd = 0x33
+        self.ItemIndex = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCSHeroAwake)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 33 武将觉醒 //tagCSHeroAwake:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                ItemIndex:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.ItemIndex
+                                )
+        return DumpString
+
+
+m_NAtagCSHeroAwake=tagCSHeroAwake()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroAwake.Cmd,m_NAtagCSHeroAwake.SubCmd))] = m_NAtagCSHeroAwake
+
+
+#------------------------------------------------------
+# B2 34 武将觉醒选择天赋 #tagCSHeroAwakeSelectTalent
+
+class  tagCSHeroAwakeSelectTalent(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("ItemIndex", c_ushort),    #武将物品所在武将背包位置索引
+                  ("SelectIndex", c_ubyte),    #选择新解锁槽位的天赋索引
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x34
+        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.Cmd = 0xB2
+        self.SubCmd = 0x34
+        self.ItemIndex = 0
+        self.SelectIndex = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCSHeroAwakeSelectTalent)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 34 武将觉醒选择天赋 //tagCSHeroAwakeSelectTalent:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                ItemIndex:%d,
+                                SelectIndex:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.ItemIndex,
+                                self.SelectIndex
+                                )
+        return DumpString
+
+
+m_NAtagCSHeroAwakeSelectTalent=tagCSHeroAwakeSelectTalent()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroAwakeSelectTalent.Cmd,m_NAtagCSHeroAwakeSelectTalent.SubCmd))] = m_NAtagCSHeroAwakeSelectTalent
+
+
+#------------------------------------------------------
+# B2 32 武将突破 #tagCSHeroBreak
+
+class  tagCSHeroBreak(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("ItemIndex", c_ushort),    #武将物品所在武将背包位置索引
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x32
+        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.Cmd = 0xB2
+        self.SubCmd = 0x32
+        self.ItemIndex = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCSHeroBreak)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 32 武将突破 //tagCSHeroBreak:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                ItemIndex:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.ItemIndex
+                                )
+        return DumpString
+
+
+m_NAtagCSHeroBreak=tagCSHeroBreak()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroBreak.Cmd,m_NAtagCSHeroBreak.SubCmd))] = m_NAtagCSHeroBreak
+
+
+#------------------------------------------------------
+# B2 30 武将升级 #tagCSHeroLVUP
+
+class  tagCSHeroLVUP(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("ItemIndex", c_ushort),    #武将物品所在武将背包位置索引
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x30
+        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.Cmd = 0xB2
+        self.SubCmd = 0x30
+        self.ItemIndex = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCSHeroLVUP)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 30 武将升级 //tagCSHeroLVUP:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                ItemIndex:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.ItemIndex
+                                )
+        return DumpString
+
+
+m_NAtagCSHeroLVUP=tagCSHeroLVUP()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroLVUP.Cmd,m_NAtagCSHeroLVUP.SubCmd))] = m_NAtagCSHeroLVUP
+
+
+#------------------------------------------------------
+# B2 31 武将升星 #tagCSHeroStarUP
+
+class  tagCSHeroStarUP(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("ItemIndex", c_ushort),    #武将物品所在武将背包位置索引
+                  ("UseItemIndex", c_ushort),    #使用武将材料物品所在武将背包位置索引
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x31
+        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.Cmd = 0xB2
+        self.SubCmd = 0x31
+        self.ItemIndex = 0
+        self.UseItemIndex = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCSHeroStarUP)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 31 武将升星 //tagCSHeroStarUP:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                ItemIndex:%d,
+                                UseItemIndex:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.ItemIndex,
+                                self.UseItemIndex
+                                )
+        return DumpString
+
+
+m_NAtagCSHeroStarUP=tagCSHeroStarUP()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroStarUP.Cmd,m_NAtagCSHeroStarUP.SubCmd))] = m_NAtagCSHeroStarUP
+
+
+#------------------------------------------------------
+# B2 35 武将洗炼 #tagCSHeroWash
+
+class  tagCSHeroWash(Structure):
+    Head = tagHead()
+    ItemIndex = 0    #(WORD ItemIndex)//武将物品所在武将背包位置索引
+    LockCnt = 0    #(BYTE LockCnt)
+    LockTalentIndexs = list()    #(vector<BYTE> LockTalentIndexs)//锁定天赋索引列表
+    OPType = 0    #(BYTE OPType)// 操作类型:0-执行洗炼;1-替换原天赋;2-保留原天赋
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xB2
+        self.Head.SubCmd = 0x35
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.ItemIndex,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.LockCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.LockCnt):
+            value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
+            self.LockTalentIndexs.append(value)
+        self.OPType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xB2
+        self.Head.SubCmd = 0x35
+        self.ItemIndex = 0
+        self.LockCnt = 0
+        self.LockTalentIndexs = list()
+        self.OPType = 0
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 2
+        length += 1
+        length += 1 * self.LockCnt
+        length += 1
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteWORD(data, self.ItemIndex)
+        data = CommFunc.WriteBYTE(data, self.LockCnt)
+        for i in range(self.LockCnt):
+            data = CommFunc.WriteBYTE(data, self.LockTalentIndexs[i])
+        data = CommFunc.WriteBYTE(data, self.OPType)
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                ItemIndex:%d,
+                                LockCnt:%d,
+                                LockTalentIndexs:%s,
+                                OPType:%d
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.ItemIndex,
+                                self.LockCnt,
+                                "...",
+                                self.OPType
+                                )
+        return DumpString
+
+
+m_NAtagCSHeroWash=tagCSHeroWash()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroWash.Head.Cmd,m_NAtagCSHeroWash.Head.SubCmd))] = m_NAtagCSHeroWash
+
+
+#------------------------------------------------------
+# B2 36 武将换肤 #tagCSHeroWearSkin
+
+class  tagCSHeroWearSkin(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("ItemIndex", c_ushort),    #武将物品所在武将背包位置索引
+                  ("SkinIndex", c_ubyte),    #皮肤索引
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x36
+        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.Cmd = 0xB2
+        self.SubCmd = 0x36
+        self.ItemIndex = 0
+        self.SkinIndex = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCSHeroWearSkin)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 36 武将换肤 //tagCSHeroWearSkin:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                ItemIndex:%d,
+                                SkinIndex:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.ItemIndex,
+                                self.SkinIndex
+                                )
+        return DumpString
+
+
+m_NAtagCSHeroWearSkin=tagCSHeroWearSkin()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroWearSkin.Cmd,m_NAtagCSHeroWearSkin.SubCmd))] = m_NAtagCSHeroWearSkin
+
+
+#------------------------------------------------------
 # B2 07 重置加点 #tagCMResetAttrPoint
 
 class  tagCMResetAttrPoint(Structure):
@@ -18535,6 +18940,121 @@
 
 
 #------------------------------------------------------
+# B4 12 战斗阵型保存 #tagCSHeroBattlePosSave
+
+class  tagCSHeroBattlePos(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("ItemIndex", c_ushort),    #武将物品所在武将背包位置索引
+                  ("PosNum", c_ubyte),    #1~n上阵位置编号  
+                  ]
+
+    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.ItemIndex = 0
+        self.PosNum = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCSHeroBattlePos)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B4 12 战斗阵型保存 //tagCSHeroBattlePosSave:
+                                ItemIndex:%d,
+                                PosNum:%d
+                                '''\
+                                %(
+                                self.ItemIndex,
+                                self.PosNum
+                                )
+        return DumpString
+
+
+class  tagCSHeroBattlePosSave(Structure):
+    Head = tagHead()
+    FuncType = 0    #(BYTE FuncType)//布阵功能类型:0-默认主阵型;其他待扩展,如某个活动的防守阵型
+    PosCnt = 0    #(BYTE PosCnt)
+    HeroPosList = list()    #(vector<tagCSHeroBattlePos> HeroPosList)// 保存的阵型,只要发送最终的阵型武将位置即可
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xB4
+        self.Head.SubCmd = 0x12
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.FuncType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.PosCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.PosCnt):
+            temHeroPosList = tagCSHeroBattlePos()
+            _pos = temHeroPosList.ReadData(_lpData, _pos)
+            self.HeroPosList.append(temHeroPosList)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xB4
+        self.Head.SubCmd = 0x12
+        self.FuncType = 0
+        self.PosCnt = 0
+        self.HeroPosList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        length += 1
+        for i in range(self.PosCnt):
+            length += self.HeroPosList[i].GetLength()
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.FuncType)
+        data = CommFunc.WriteBYTE(data, self.PosCnt)
+        for i in range(self.PosCnt):
+            data = CommFunc.WriteString(data, self.HeroPosList[i].GetLength(), self.HeroPosList[i].GetBuffer())
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                FuncType:%d,
+                                PosCnt:%d,
+                                HeroPosList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.FuncType,
+                                self.PosCnt,
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagCSHeroBattlePosSave=tagCSHeroBattlePosSave()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroBattlePosSave.Head.Cmd,m_NAtagCSHeroBattlePosSave.Head.SubCmd))] = m_NAtagCSHeroBattlePosSave
+
+
+#------------------------------------------------------
 # B4 11 镜像战斗 #tagCMMirrorFight
 
 class  tagCMMirrorFight(Structure):

--
Gitblit v1.8.0