From 8683baa38581e664f92fcfd7d38edf6b01e8b157 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 07 八月 2025 16:19:09 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(重生扣除货币)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 308 ++++++++++++++++++++------------------------------
1 files changed, 123 insertions(+), 185 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 3c04f3a..cb78e1b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -2677,58 +2677,6 @@
#------------------------------------------------------
-# A3 17 增加果实使用上限 #tagCMAddFruitUseLimit
-
-class tagCMAddFruitUseLimit(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("ItemID", c_int), #果实物品ID
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xA3
- self.SubCmd = 0x17
- 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 = 0xA3
- self.SubCmd = 0x17
- self.ItemID = 0
- return
-
- def GetLength(self):
- return sizeof(tagCMAddFruitUseLimit)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// A3 17 增加果实使用上限 //tagCMAddFruitUseLimit:
- Cmd:%s,
- SubCmd:%s,
- ItemID:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.ItemID
- )
- return DumpString
-
-
-m_NAtagCMAddFruitUseLimit=tagCMAddFruitUseLimit()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMAddFruitUseLimit.Cmd,m_NAtagCMAddFruitUseLimit.SubCmd))] = m_NAtagCMAddFruitUseLimit
-
-
-#------------------------------------------------------
# A3 10 购买商城物品 #tagCMBuyItem
class tagCMBuyItem(Structure):
@@ -4091,83 +4039,6 @@
#------------------------------------------------------
-# A3 2A 回收魂石 #tagCMRecycleAttrFruit
-
-class tagCMRecycleAttrFruit(Structure):
- Head = tagHead()
- IndexCount = 0 #(BYTE IndexCount)//索引个数
- IndexList = list() #(vector<BYTE> IndexList)//物品在背包中索引列表
- RecycleCountList = list() #(vector<WORD> RecycleCountList)//索引对应回收个数列表
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0x2A
- return
-
- def ReadData(self, _lpData, _pos=0, _Len=0):
- self.Clear()
- _pos = self.Head.ReadData(_lpData, _pos)
- self.IndexCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- for i in range(self.IndexCount):
- value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
- self.IndexList.append(value)
- for i in range(self.IndexCount):
- value,_pos=CommFunc.ReadWORD(_lpData,_pos)
- self.RecycleCountList.append(value)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0x2A
- self.IndexCount = 0
- self.IndexList = list()
- self.RecycleCountList = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 1
- length += 1 * self.IndexCount
- length += 2 * self.IndexCount
-
- return length
-
- def GetBuffer(self):
- data = ''
- data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
- data = CommFunc.WriteBYTE(data, self.IndexCount)
- for i in range(self.IndexCount):
- data = CommFunc.WriteBYTE(data, self.IndexList[i])
- for i in range(self.IndexCount):
- data = CommFunc.WriteWORD(data, self.RecycleCountList[i])
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- IndexCount:%d,
- IndexList:%s,
- RecycleCountList:%s
- '''\
- %(
- self.Head.OutputString(),
- self.IndexCount,
- "...",
- "..."
- )
- return DumpString
-
-
-m_NAtagCMRecycleAttrFruit=tagCMRecycleAttrFruit()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRecycleAttrFruit.Head.Cmd,m_NAtagCMRecycleAttrFruit.Head.SubCmd))] = m_NAtagCMRecycleAttrFruit
-
-
-#------------------------------------------------------
#A3 03 物品合成 #tagCMItemCompound
class tagCMItemCompound(Structure):
@@ -4492,58 +4363,6 @@
#------------------------------------------------------
-# A3 2B 一键使用属性果实 #tagCMUseAllAttrFruit
-
-class tagCMUseAllAttrFruit(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("FuncIndex", c_ubyte), #功能索引
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xA3
- self.SubCmd = 0x2B
- 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 = 0xA3
- self.SubCmd = 0x2B
- self.FuncIndex = 0
- return
-
- def GetLength(self):
- return sizeof(tagCMUseAllAttrFruit)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''// A3 2B 一键使用属性果实 //tagCMUseAllAttrFruit:
- Cmd:%s,
- SubCmd:%s,
- FuncIndex:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.FuncIndex
- )
- return DumpString
-
-
-m_NAtagCMUseAllAttrFruit=tagCMUseAllAttrFruit()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMUseAllAttrFruit.Cmd,m_NAtagCMUseAllAttrFruit.SubCmd))] = m_NAtagCMUseAllAttrFruit
-
-
-#------------------------------------------------------
# A3 23 使用物品 #tagCMUseItems
class tagCMUseItemsSelect(Structure):
@@ -4588,7 +4407,7 @@
class tagCMUseItems(Structure):
Head = tagHead()
ItemIndex = 0 #(BYTE ItemIndex)//物品在背包中索引
- UseCnt = 0 #(WORD UseCnt)//使用个数,0表示全部使用
+ UseCnt = 0 #(DWORD UseCnt)//使用个数,0表示全部使用
ExData = 0 #(DWORD ExData)//使用扩展值, 默认0, 选择物品宝箱时发送选择的物品ID
SelectCount = 0 #(BYTE SelectCount)//指定选择项,当批量使用单个箱子需要同时选中多种选项时使用该值
SelectList = list() #(vector<tagCMUseItemsSelect> SelectList)
@@ -4604,7 +4423,7 @@
self.Clear()
_pos = self.Head.ReadData(_lpData, _pos)
self.ItemIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- self.UseCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.UseCnt,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.ExData,_pos = CommFunc.ReadDWORD(_lpData, _pos)
self.SelectCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
for i in range(self.SelectCount):
@@ -4629,7 +4448,7 @@
length = 0
length += self.Head.GetLength()
length += 1
- length += 2
+ length += 4
length += 4
length += 1
for i in range(self.SelectCount):
@@ -4641,7 +4460,7 @@
data = ''
data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
data = CommFunc.WriteBYTE(data, self.ItemIndex)
- data = CommFunc.WriteWORD(data, self.UseCnt)
+ data = CommFunc.WriteDWORD(data, self.UseCnt)
data = CommFunc.WriteDWORD(data, self.ExData)
data = CommFunc.WriteBYTE(data, self.SelectCount)
for i in range(self.SelectCount):
@@ -17432,6 +17251,73 @@
#------------------------------------------------------
+# B2 40 武将遣散 #tagCSHeroDismiss
+
+class tagCSHeroDismiss(Structure):
+ Head = tagHead()
+ Count = 0 #(BYTE Count)
+ ItemIndexList = list() #(vector<WORD> ItemIndexList)// 武将物品所在武将背包位置索引列表
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xB2
+ self.Head.SubCmd = 0x40
+ 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.ItemIndexList.append(value)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xB2
+ self.Head.SubCmd = 0x40
+ self.Count = 0
+ self.ItemIndexList = 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.ItemIndexList[i])
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ Count:%d,
+ ItemIndexList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.Count,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagCSHeroDismiss=tagCSHeroDismiss()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroDismiss.Head.Cmd,m_NAtagCSHeroDismiss.Head.SubCmd))] = m_NAtagCSHeroDismiss
+
+
+#------------------------------------------------------
# B2 38 武将锁定 #tagCSHeroLock
class tagCSHeroLock(Structure):
@@ -17540,6 +17426,58 @@
#------------------------------------------------------
+# B2 39 武将重生 #tagCSHeroRebirth
+
+class tagCSHeroRebirth(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ItemIndex", c_ushort), #武将物品所在武将背包位置索引
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB2
+ self.SubCmd = 0x39
+ 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 = 0x39
+ self.ItemIndex = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCSHeroRebirth)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B2 39 武将重生 //tagCSHeroRebirth:
+ Cmd:%s,
+ SubCmd:%s,
+ ItemIndex:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ItemIndex
+ )
+ return DumpString
+
+
+m_NAtagCSHeroRebirth=tagCSHeroRebirth()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroRebirth.Cmd,m_NAtagCSHeroRebirth.SubCmd))] = m_NAtagCSHeroRebirth
+
+
+#------------------------------------------------------
# B2 31 武将升星 #tagCSHeroStarUP
class tagCSHeroStarUP(Structure):
--
Gitblit v1.8.0