From d37ff1be4e18dee345942f1cac676c616636cb61 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 18 一月 2024 15:57:41 +0800
Subject: [PATCH] 10019 【砍树】回合战斗(每次攻击触发精怪技能支持)
---
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 739 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 734 insertions(+), 5 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 3eb55f0..c634db5 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -9037,6 +9037,7 @@
OnlineType = 0 #(BYTE OnlineType)//在线状态, 0 不在线 1在线
IsInTeam = 0 #(BYTE IsInTeam)//是否有队伍
ServerGroupID = 0 #(DWORD ServerGroupID)//服务器组ID
+ Face = 0 #(DWORD Face)//基本脸型
data = None
def __init__(self):
@@ -9056,6 +9057,7 @@
self.OnlineType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
self.IsInTeam,_pos = CommFunc.ReadBYTE(_lpData, _pos)
self.ServerGroupID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.Face,_pos = CommFunc.ReadDWORD(_lpData, _pos)
return _pos
def Clear(self):
@@ -9071,6 +9073,7 @@
self.OnlineType = 0
self.IsInTeam = 0
self.ServerGroupID = 0
+ self.Face = 0
return
def GetLength(self):
@@ -9083,6 +9086,7 @@
length += 2
length += 1
length += 1
+ length += 4
length += 4
return length
@@ -9098,6 +9102,7 @@
data = CommFunc.WriteBYTE(data, self.OnlineType)
data = CommFunc.WriteBYTE(data, self.IsInTeam)
data = CommFunc.WriteDWORD(data, self.ServerGroupID)
+ data = CommFunc.WriteDWORD(data, self.Face)
return data
def OutputString(self):
@@ -9110,7 +9115,8 @@
RealmLV:%d,
OnlineType:%d,
IsInTeam:%d,
- ServerGroupID:%d
+ ServerGroupID:%d,
+ Face:%d
'''\
%(
self.Head.OutputString(),
@@ -9121,7 +9127,8 @@
self.RealmLV,
self.OnlineType,
self.IsInTeam,
- self.ServerGroupID
+ self.ServerGroupID,
+ self.Face
)
return DumpString
@@ -9196,6 +9203,7 @@
LV = 0 #(WORD LV)//等级
RealmLV = 0 #(WORD RealmLV)//境界
OnlineType = 0 #(BYTE OnlineType)//0不在线 1在线 2脱机在线
+ Face = 0 #(DWORD Face)//基本脸型
data = None
def __init__(self):
@@ -9210,6 +9218,7 @@
self.LV,_pos = CommFunc.ReadWORD(_lpData, _pos)
self.RealmLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
self.OnlineType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.Face,_pos = CommFunc.ReadDWORD(_lpData, _pos)
return _pos
def Clear(self):
@@ -9219,6 +9228,7 @@
self.LV = 0
self.RealmLV = 0
self.OnlineType = 0
+ self.Face = 0
return
def GetLength(self):
@@ -9229,6 +9239,7 @@
length += 2
length += 2
length += 1
+ length += 4
return length
@@ -9240,6 +9251,7 @@
data = CommFunc.WriteWORD(data, self.LV)
data = CommFunc.WriteWORD(data, self.RealmLV)
data = CommFunc.WriteBYTE(data, self.OnlineType)
+ data = CommFunc.WriteDWORD(data, self.Face)
return data
def OutputString(self):
@@ -9249,7 +9261,8 @@
Job:%d,
LV:%d,
RealmLV:%d,
- OnlineType:%d
+ OnlineType:%d,
+ Face:%d
'''\
%(
self.PlayerID,
@@ -9257,7 +9270,8 @@
self.Job,
self.LV,
self.RealmLV,
- self.OnlineType
+ self.OnlineType,
+ self.Face
)
return DumpString
@@ -29521,7 +29535,7 @@
class tagRefreshType(Structure):
_pack_ = 1
_fields_ = [
- ("RefreshType", c_ubyte),
+ ("RefreshType", c_ushort),
("Value", c_int),
("ValueEx", c_int),
]
@@ -37069,6 +37083,66 @@
#------------------------------------------------------
+# AA 03 每日打包直购礼包 #tagMCDailyPackBuyGiftInfo
+
+class tagMCDailyPackBuyGiftInfo(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("PackBuyTime", c_int), # 打包购买的时间戳,如果有该值,代表已经一次性打包购买了,可根据次时间戳算出当前是第几天
+ ("BuyStateToday", c_int), # 今日礼包购买状态,按礼包索引二进制位计算代表是否已购买,仅非打包购买状态下有用
+ ("AwardState", c_int), # 今日礼包领奖状态,按礼包索引二进制位计算代表是否已领取
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xAA
+ self.SubCmd = 0x03
+ 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 = 0xAA
+ self.SubCmd = 0x03
+ self.PackBuyTime = 0
+ self.BuyStateToday = 0
+ self.AwardState = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCDailyPackBuyGiftInfo)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// AA 03 每日打包直购礼包 //tagMCDailyPackBuyGiftInfo:
+ Cmd:%s,
+ SubCmd:%s,
+ PackBuyTime:%d,
+ BuyStateToday:%d,
+ AwardState:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.PackBuyTime,
+ self.BuyStateToday,
+ self.AwardState
+ )
+ return DumpString
+
+
+m_NAtagMCDailyPackBuyGiftInfo=tagMCDailyPackBuyGiftInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCDailyPackBuyGiftInfo.Cmd,m_NAtagMCDailyPackBuyGiftInfo.SubCmd))] = m_NAtagMCDailyPackBuyGiftInfo
+
+
+#------------------------------------------------------
# AA 24 每日免费直购礼包信息 #tagMCDayFreeGoldGiftState
class tagMCDayFreeGoldGiftState(Structure):
@@ -43122,6 +43196,121 @@
#------------------------------------------------------
+# B1 22 砍树结果 #tagMCCutTreeResult
+
+class tagMCCutTreeExItem(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("ItemID", c_int), # 额外奖励物品ID
+ ("ItemCount", c_ushort), # 额外奖励物品ID对应个数
+ ]
+
+ 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.ItemCount = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCCutTreeExItem)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B1 22 砍树结果 //tagMCCutTreeResult:
+ ItemID:%d,
+ ItemCount:%d
+ '''\
+ %(
+ self.ItemID,
+ self.ItemCount
+ )
+ return DumpString
+
+
+class tagMCCutTreeResult(Structure):
+ Head = tagHead()
+ EquipCount = 0 #(BYTE EquipCount)// 获得装备数量,默认展示在砍树背包中的装备即可,收到该封包前会先收到0704物品刷新
+ ExItemCount = 0 #(BYTE ExItemCount)// 额外奖励物品数
+ ExItemList = list() #(vector<tagMCCutTreeExItem> ExItemList)// 额外奖励物品列表
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xB1
+ self.Head.SubCmd = 0x22
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.EquipCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.ExItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.ExItemCount):
+ temExItemList = tagMCCutTreeExItem()
+ _pos = temExItemList.ReadData(_lpData, _pos)
+ self.ExItemList.append(temExItemList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xB1
+ self.Head.SubCmd = 0x22
+ self.EquipCount = 0
+ self.ExItemCount = 0
+ self.ExItemList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 1
+ for i in range(self.ExItemCount):
+ length += self.ExItemList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.EquipCount)
+ data = CommFunc.WriteBYTE(data, self.ExItemCount)
+ for i in range(self.ExItemCount):
+ data = CommFunc.WriteString(data, self.ExItemList[i].GetLength(), self.ExItemList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ EquipCount:%d,
+ ExItemCount:%d,
+ ExItemList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.EquipCount,
+ self.ExItemCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCCutTreeResult=tagMCCutTreeResult()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCCutTreeResult.Head.Cmd,m_NAtagMCCutTreeResult.Head.SubCmd))] = m_NAtagMCCutTreeResult
+
+
+#------------------------------------------------------
# B1 11 功能系统特权信息 #tagMCFuncSysPrivilegeInfoList
class tagMCFuncSysPrivilegeInfo(Structure):
@@ -43762,6 +43951,248 @@
m_NAtagMCYinjiStartTime=tagMCYinjiStartTime()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCYinjiStartTime.Cmd,m_NAtagMCYinjiStartTime.SubCmd))] = m_NAtagMCYinjiStartTime
+
+
+#------------------------------------------------------
+# B1 10 当前任务信息 #tagMCTaskInfo
+
+class tagMCTaskInfo(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("TaskID", c_int), # 任务ID
+ ("CurValue", c_int), # 当前进度值
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB1
+ self.SubCmd = 0x10
+ 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 = 0xB1
+ self.SubCmd = 0x10
+ self.TaskID = 0
+ self.CurValue = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCTaskInfo)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B1 10 当前任务信息 //tagMCTaskInfo:
+ Cmd:%s,
+ SubCmd:%s,
+ TaskID:%d,
+ CurValue:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.TaskID,
+ self.CurValue
+ )
+ return DumpString
+
+
+m_NAtagMCTaskInfo=tagMCTaskInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTaskInfo.Cmd,m_NAtagMCTaskInfo.SubCmd))] = m_NAtagMCTaskInfo
+
+
+#------------------------------------------------------
+# B1 21 仙树信息 #tagMCTreeInfo
+
+class tagMCTreeInfo(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("TreeLV", c_ubyte), # 当前仙树等级
+ ("LVUPState", c_ubyte), # 0-非升级中;1-升级中
+ ("LVUPRemainTime", c_int), # 升级剩余时间,秒;当升级中且倒计时为0时可发送B223执行升级包进行升级
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB1
+ self.SubCmd = 0x21
+ 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 = 0xB1
+ self.SubCmd = 0x21
+ self.TreeLV = 0
+ self.LVUPState = 0
+ self.LVUPRemainTime = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCTreeInfo)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B1 21 仙树信息 //tagMCTreeInfo:
+ Cmd:%s,
+ SubCmd:%s,
+ TreeLV:%d,
+ LVUPState:%d,
+ LVUPRemainTime:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.TreeLV,
+ self.LVUPState,
+ self.LVUPRemainTime
+ )
+ return DumpString
+
+
+m_NAtagMCTreeInfo=tagMCTreeInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTreeInfo.Cmd,m_NAtagMCTreeInfo.SubCmd))] = m_NAtagMCTreeInfo
+
+
+#------------------------------------------------------
+# B1 20 战令信息 #tagMCZhanlingInfo
+
+class tagMCZhanling(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("NeedValue", c_int), # 奖励所需值
+ ("FreeRewardState", c_ubyte), # 免费奖励是否已领取
+ ("ZLRewardState", 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.NeedValue = 0
+ self.FreeRewardState = 0
+ self.ZLRewardState = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCZhanling)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B1 20 战令信息 //tagMCZhanlingInfo:
+ NeedValue:%d,
+ FreeRewardState:%d,
+ ZLRewardState:%d
+ '''\
+ %(
+ self.NeedValue,
+ self.FreeRewardState,
+ self.ZLRewardState
+ )
+ return DumpString
+
+
+class tagMCZhanlingInfo(Structure):
+ Head = tagHead()
+ ZhanlingType = 0 #(BYTE ZhanlingType)// 战令类型
+ IsActivite = 0 #(BYTE IsActivite)// 是否已激活
+ RewardCount = 0 #(WORD RewardCount)
+ RewardList = list() #(vector<tagMCZhanling> RewardList)
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xB1
+ self.Head.SubCmd = 0x20
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.ZhanlingType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.IsActivite,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.RewardCount,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ for i in range(self.RewardCount):
+ temRewardList = tagMCZhanling()
+ _pos = temRewardList.ReadData(_lpData, _pos)
+ self.RewardList.append(temRewardList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xB1
+ self.Head.SubCmd = 0x20
+ self.ZhanlingType = 0
+ self.IsActivite = 0
+ self.RewardCount = 0
+ self.RewardList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 1
+ length += 1
+ length += 2
+ for i in range(self.RewardCount):
+ length += self.RewardList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteBYTE(data, self.ZhanlingType)
+ data = CommFunc.WriteBYTE(data, self.IsActivite)
+ data = CommFunc.WriteWORD(data, self.RewardCount)
+ for i in range(self.RewardCount):
+ data = CommFunc.WriteString(data, self.RewardList[i].GetLength(), self.RewardList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ZhanlingType:%d,
+ IsActivite:%d,
+ RewardCount:%d,
+ RewardList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ZhanlingType,
+ self.IsActivite,
+ self.RewardCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCZhanlingInfo=tagMCZhanlingInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCZhanlingInfo.Head.Cmd,m_NAtagMCZhanlingInfo.Head.SubCmd))] = m_NAtagMCZhanlingInfo
#------------------------------------------------------
@@ -47063,6 +47494,304 @@
#------------------------------------------------------
+# B4 21 回合战斗对象开始行动 #tagMCTurnFightObjAction
+
+class tagMCTurnFightObjAction(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("TurnNum", c_ubyte), # 当前轮次
+ ("ObjID", c_int),
+ ("ObjType", c_ubyte),
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB4
+ self.SubCmd = 0x21
+ 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 = 0xB4
+ self.SubCmd = 0x21
+ self.TurnNum = 0
+ self.ObjID = 0
+ self.ObjType = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCTurnFightObjAction)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B4 21 回合战斗对象开始行动 //tagMCTurnFightObjAction:
+ Cmd:%s,
+ SubCmd:%s,
+ TurnNum:%d,
+ ObjID:%d,
+ ObjType:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.TurnNum,
+ self.ObjID,
+ self.ObjType
+ )
+ return DumpString
+
+
+m_NAtagMCTurnFightObjAction=tagMCTurnFightObjAction()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightObjAction.Cmd,m_NAtagMCTurnFightObjAction.SubCmd))] = m_NAtagMCTurnFightObjAction
+
+
+#------------------------------------------------------
+# B4 22 回合战斗角色死亡 #tagMCTurnFightObjDead
+
+class tagMCTurnFightObjDead(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ObjID", c_int),
+ ("ObjType", c_ubyte),
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB4
+ self.SubCmd = 0x22
+ 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 = 0xB4
+ self.SubCmd = 0x22
+ self.ObjID = 0
+ self.ObjType = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCTurnFightObjDead)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B4 22 回合战斗角色死亡 //tagMCTurnFightObjDead:
+ Cmd:%s,
+ SubCmd:%s,
+ ObjID:%d,
+ ObjType:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ObjID,
+ self.ObjType
+ )
+ return DumpString
+
+
+m_NAtagMCTurnFightObjDead=tagMCTurnFightObjDead()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightObjDead.Cmd,m_NAtagMCTurnFightObjDead.SubCmd))] = m_NAtagMCTurnFightObjDead
+
+
+#------------------------------------------------------
+# B4 23 回合战斗角色复活 #tagMCTurnFightObjReborn
+
+class tagMCTurnFightObjReborn(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ObjID", c_int),
+ ("ObjType", c_ubyte),
+ ("HP", c_int), # 复活后血量,求余亿部分
+ ("HPEx", c_int), # 复活后血量,整除亿部分
+ ("RebornType", c_ubyte), # 复活方式:1-灵宠技能复活;2-待扩展
+ ("RebornValue1", c_int), # 复活方式对应值1,由复活方式决定其值意义
+ ("RebornValue2", c_int), # 复活方式对应值2
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB4
+ self.SubCmd = 0x23
+ 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 = 0xB4
+ self.SubCmd = 0x23
+ self.ObjID = 0
+ self.ObjType = 0
+ self.HP = 0
+ self.HPEx = 0
+ self.RebornType = 0
+ self.RebornValue1 = 0
+ self.RebornValue2 = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCTurnFightObjReborn)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B4 23 回合战斗角色复活 //tagMCTurnFightObjReborn:
+ Cmd:%s,
+ SubCmd:%s,
+ ObjID:%d,
+ ObjType:%d,
+ HP:%d,
+ HPEx:%d,
+ RebornType:%d,
+ RebornValue1:%d,
+ RebornValue2:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ObjID,
+ self.ObjType,
+ self.HP,
+ self.HPEx,
+ self.RebornType,
+ self.RebornValue1,
+ self.RebornValue2
+ )
+ return DumpString
+
+
+m_NAtagMCTurnFightObjReborn=tagMCTurnFightObjReborn()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightObjReborn.Cmd,m_NAtagMCTurnFightObjReborn.SubCmd))] = m_NAtagMCTurnFightObjReborn
+
+
+#------------------------------------------------------
+# B4 20 回合制战斗状态 #tagMCTurnFightState
+
+class tagMCTurnFightState(Structure):
+ Head = tagHead()
+ MapID = 0 #(DWORD MapID)// 自定义地图ID,可用于绑定战斗场景功能(如野外关卡,爬塔功能,竞技场等)
+ FuncLineID = 0 #(WORD FuncLineID)
+ PlayerID = 0 #(DWORD PlayerID)// 对应玩家ID,可为0,某些功能可能有用,如竞技场
+ State = 0 #(BYTE State)// 0-起始状态标记;1-准备完毕;2-战斗中;3-战斗结束;4-结算奖励;5-结束状态标记
+ TurnNum = 0 #(BYTE TurnNum)// 当前轮次
+ TurnMax = 0 #(BYTE TurnMax)// 最大轮次
+ Len = 0 #(WORD Len)
+ Msg = "" #(String Msg)//size = Len
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xB4
+ self.Head.SubCmd = 0x20
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.FuncLineID,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.State,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.TurnNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.TurnMax,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.Len,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.Msg,_pos = CommFunc.ReadString(_lpData, _pos,self.Len)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xB4
+ self.Head.SubCmd = 0x20
+ self.MapID = 0
+ self.FuncLineID = 0
+ self.PlayerID = 0
+ self.State = 0
+ self.TurnNum = 0
+ self.TurnMax = 0
+ self.Len = 0
+ self.Msg = ""
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 4
+ length += 2
+ length += 4
+ length += 1
+ length += 1
+ length += 1
+ length += 2
+ length += len(self.Msg)
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteDWORD(data, self.MapID)
+ data = CommFunc.WriteWORD(data, self.FuncLineID)
+ data = CommFunc.WriteDWORD(data, self.PlayerID)
+ data = CommFunc.WriteBYTE(data, self.State)
+ data = CommFunc.WriteBYTE(data, self.TurnNum)
+ data = CommFunc.WriteBYTE(data, self.TurnMax)
+ data = CommFunc.WriteWORD(data, self.Len)
+ data = CommFunc.WriteString(data, self.Len, self.Msg)
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ MapID:%d,
+ FuncLineID:%d,
+ PlayerID:%d,
+ State:%d,
+ TurnNum:%d,
+ TurnMax:%d,
+ Len:%d,
+ Msg:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.MapID,
+ self.FuncLineID,
+ self.PlayerID,
+ self.State,
+ self.TurnNum,
+ self.TurnMax,
+ self.Len,
+ self.Msg
+ )
+ return DumpString
+
+
+m_NAtagMCTurnFightState=tagMCTurnFightState()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightState.Head.Cmd,m_NAtagMCTurnFightState.Head.SubCmd))] = m_NAtagMCTurnFightState
+
+
+#------------------------------------------------------
# C1 09 跨服排位玩家信息 #tagMCChampionshipPlayerInfo
class tagMCChampionshipPlayerInfo(Structure):
--
Gitblit v1.8.0