From 2ccb840f9db8c61f7e9a0a336205713b41790bf3 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 06 八月 2025 19:52:49 +0800 Subject: [PATCH] 129 【战斗】战斗系统-服务端(import问题) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 1660 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 1,431 insertions(+), 229 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index bad86e4..8c1dd37 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -3252,6 +3252,114 @@ #------------------------------------------------------ +# A2 07 背包购买格子信息 #tagSCPackBuyInfo + +class tagSCPackBuy(Structure): + _pack_ = 1 + _fields_ = [ + ("PackType", c_ubyte), # 背包类型 + ("BuyCnt", c_ushort), # 已购买次数 + ] + + 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.PackType = 0 + self.BuyCnt = 0 + return + + def GetLength(self): + return sizeof(tagSCPackBuy) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// A2 07 背包购买格子信息 //tagSCPackBuyInfo: + PackType:%d, + BuyCnt:%d + '''\ + %( + self.PackType, + self.BuyCnt + ) + return DumpString + + +class tagSCPackBuyInfo(Structure): + Head = tagHead() + Count = 0 #(BYTE Count) + BuyInfoList = list() #(vector<tagSCPackBuy> BuyInfoList) + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xA2 + self.Head.SubCmd = 0x07 + 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): + temBuyInfoList = tagSCPackBuy() + _pos = temBuyInfoList.ReadData(_lpData, _pos) + self.BuyInfoList.append(temBuyInfoList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xA2 + self.Head.SubCmd = 0x07 + self.Count = 0 + self.BuyInfoList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.Count): + length += self.BuyInfoList[i].GetLength() + + 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.WriteString(data, self.BuyInfoList[i].GetLength(), self.BuyInfoList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Count:%d, + BuyInfoList:%s + '''\ + %( + self.Head.OutputString(), + self.Count, + "..." + ) + return DumpString + + +m_NAtagSCPackBuyInfo=tagSCPackBuyInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCPackBuyInfo.Head.Cmd,m_NAtagSCPackBuyInfo.Head.SubCmd))] = m_NAtagSCPackBuyInfo + + +#------------------------------------------------------ # A2 05 虚拟背包物品清空 #tagMCVPackClear class tagMCVPackClear(Structure): @@ -3870,122 +3978,6 @@ m_NAtagMCArrestTaskInfo=tagMCArrestTaskInfo() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCArrestTaskInfo.Head.Cmd,m_NAtagMCArrestTaskInfo.Head.SubCmd))] = m_NAtagMCArrestTaskInfo - - -#------------------------------------------------------ -# A3 39 玩家属性果实已使用个数信息#tagMCAttrFruitEatCntList - -class tagMCAttrFruitEatCnt(Structure): - _pack_ = 1 - _fields_ = [ - ("ItemID", c_int), #果实物品ID - ("EatCnt", c_int), #已使用个数 - ("ItemAddCnt", c_int), #增幅丹增加上限 - ("ItemBreakCnt", c_int), #增幅丹突破次数 - ] - - 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.EatCnt = 0 - self.ItemAddCnt = 0 - self.ItemBreakCnt = 0 - return - - def GetLength(self): - return sizeof(tagMCAttrFruitEatCnt) - - def GetBuffer(self): - return string_at(addressof(self), self.GetLength()) - - def OutputString(self): - DumpString = '''// A3 39 玩家属性果实已使用个数信息//tagMCAttrFruitEatCntList: - ItemID:%d, - EatCnt:%d, - ItemAddCnt:%d, - ItemBreakCnt:%d - '''\ - %( - self.ItemID, - self.EatCnt, - self.ItemAddCnt, - self.ItemBreakCnt - ) - return DumpString - - -class tagMCAttrFruitEatCntList(Structure): - Head = tagHead() - count = 0 #(BYTE count)//信息个数 - EatCntList = list() #(vector<tagMCAttrFruitEatCnt> EatCntList) - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xA3 - self.Head.SubCmd = 0x39 - 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): - temEatCntList = tagMCAttrFruitEatCnt() - _pos = temEatCntList.ReadData(_lpData, _pos) - self.EatCntList.append(temEatCntList) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xA3 - self.Head.SubCmd = 0x39 - self.count = 0 - self.EatCntList = list() - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - for i in range(self.count): - length += self.EatCntList[i].GetLength() - - 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.WriteString(data, self.EatCntList[i].GetLength(), self.EatCntList[i].GetBuffer()) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - count:%d, - EatCntList:%s - '''\ - %( - self.Head.OutputString(), - self.count, - "..." - ) - return DumpString - - -m_NAtagMCAttrFruitEatCntList=tagMCAttrFruitEatCntList() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCAttrFruitEatCntList.Head.Cmd,m_NAtagMCAttrFruitEatCntList.Head.SubCmd))] = m_NAtagMCAttrFruitEatCntList #------------------------------------------------------ @@ -43549,6 +43541,114 @@ #------------------------------------------------------ +# B1 23 每日掉落战利品信息 #tagSCDropBootyInfo + +class tagSCDropBooty(Structure): + _pack_ = 1 + _fields_ = [ + ("ItemID", c_int), # 战利品ID + ("TodayDropCnt", c_int), # 今日已掉落数量 + ] + + 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.TodayDropCnt = 0 + return + + def GetLength(self): + return sizeof(tagSCDropBooty) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B1 23 每日掉落战利品信息 //tagSCDropBootyInfo: + ItemID:%d, + TodayDropCnt:%d + '''\ + %( + self.ItemID, + self.TodayDropCnt + ) + return DumpString + + +class tagSCDropBootyInfo(Structure): + Head = tagHead() + Count = 0 #(WORD Count) + DropBootyList = list() #(vector<tagSCDropBooty> DropBootyList)//每日已掉落战利品信息列表 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x23 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos) + for i in range(self.Count): + temDropBootyList = tagSCDropBooty() + _pos = temDropBootyList.ReadData(_lpData, _pos) + self.DropBootyList.append(temDropBootyList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x23 + self.Count = 0 + self.DropBootyList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 2 + for i in range(self.Count): + length += self.DropBootyList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteWORD(data, self.Count) + for i in range(self.Count): + data = CommFunc.WriteString(data, self.DropBootyList[i].GetLength(), self.DropBootyList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Count:%d, + DropBootyList:%s + '''\ + %( + self.Head.OutputString(), + self.Count, + "..." + ) + return DumpString + + +m_NAtagSCDropBootyInfo=tagSCDropBootyInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCDropBootyInfo.Head.Cmd,m_NAtagSCDropBootyInfo.Head.SubCmd))] = m_NAtagSCDropBootyInfo + + +#------------------------------------------------------ # B1 17 头像信息 #tagMCFaceInfo class tagMCFace(Structure): @@ -44211,6 +44311,137 @@ m_NAtagSCHeroInfo=tagSCHeroInfo() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCHeroInfo.Head.Cmd,m_NAtagSCHeroInfo.Head.SubCmd))] = m_NAtagSCHeroInfo + + +#------------------------------------------------------ +# B1 24 阵容信息 #tagSCLineupInfo + +class tagSCLineup(Structure): + LineupID = 0 #(BYTE LineupID)// 阵容ID + ShapeType = 0 #(BYTE ShapeType)// 阵型 + HeroCnt = 0 #(BYTE HeroCnt) + HeroItemIndexList = list() #(vector<WORD> HeroItemIndexList)// 所在武将背包索引+1列表 [站位1物品索引+1, 站位2, ...],站位无武将时为0 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.LineupID,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.ShapeType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.HeroCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.HeroCnt): + value,_pos=CommFunc.ReadWORD(_lpData,_pos) + self.HeroItemIndexList.append(value) + return _pos + + def Clear(self): + self.LineupID = 0 + self.ShapeType = 0 + self.HeroCnt = 0 + self.HeroItemIndexList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 1 + length += 1 + length += 2 * self.HeroCnt + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.LineupID) + data = CommFunc.WriteBYTE(data, self.ShapeType) + data = CommFunc.WriteBYTE(data, self.HeroCnt) + for i in range(self.HeroCnt): + data = CommFunc.WriteWORD(data, self.HeroItemIndexList[i]) + return data + + def OutputString(self): + DumpString = ''' + LineupID:%d, + ShapeType:%d, + HeroCnt:%d, + HeroItemIndexList:%s + '''\ + %( + self.LineupID, + self.ShapeType, + self.HeroCnt, + "..." + ) + return DumpString + + +class tagSCLineupInfo(Structure): + Head = tagHead() + LineupCnt = 0 #(BYTE LineupCnt) + LineupList = list() #(vector<tagSCLineup> LineupList) + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x24 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.LineupCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.LineupCnt): + temLineupList = tagSCLineup() + _pos = temLineupList.ReadData(_lpData, _pos) + self.LineupList.append(temLineupList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB1 + self.Head.SubCmd = 0x24 + self.LineupCnt = 0 + self.LineupList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + for i in range(self.LineupCnt): + length += self.LineupList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.LineupCnt) + for i in range(self.LineupCnt): + data = CommFunc.WriteString(data, self.LineupList[i].GetLength(), self.LineupList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + LineupCnt:%d, + LineupList:%s + '''\ + %( + self.Head.OutputString(), + self.LineupCnt, + "..." + ) + return DumpString + + +m_NAtagSCLineupInfo=tagSCLineupInfo() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCLineupInfo.Head.Cmd,m_NAtagSCLineupInfo.Head.SubCmd))] = m_NAtagSCLineupInfo #------------------------------------------------------ @@ -46528,94 +46759,6 @@ m_NAtagMCHelpBattleRecordList=tagMCHelpBattleRecordList() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCHelpBattleRecordList.Head.Cmd,m_NAtagMCHelpBattleRecordList.Head.SubCmd))] = m_NAtagMCHelpBattleRecordList - - -#------------------------------------------------------ -# B2 04 冰晶矿脉信息通知 #tagMCIceLodeInfo - -class tagMCIceLodeInfo(Structure): - Head = tagHead() - Cnt = 0 #(BYTE Cnt)// 今日玩法数量 - LineList = list() #(vector<BYTE> LineList)// 玩法列表 - AwardRecord = 0 #(DWORD AwardRecord)// 领奖记录 - HasSweep = 0 #(BYTE HasSweep)// 是否已扫荡 - DayLV = 0 #(WORD DayLV)// 今日等级 - data = None - - def __init__(self): - self.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x04 - 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): - value,_pos=CommFunc.ReadBYTE(_lpData,_pos) - self.LineList.append(value) - self.AwardRecord,_pos = CommFunc.ReadDWORD(_lpData, _pos) - self.HasSweep,_pos = CommFunc.ReadBYTE(_lpData, _pos) - self.DayLV,_pos = CommFunc.ReadWORD(_lpData, _pos) - return _pos - - def Clear(self): - self.Head = tagHead() - self.Head.Clear() - self.Head.Cmd = 0xB2 - self.Head.SubCmd = 0x04 - self.Cnt = 0 - self.LineList = list() - self.AwardRecord = 0 - self.HasSweep = 0 - self.DayLV = 0 - return - - def GetLength(self): - length = 0 - length += self.Head.GetLength() - length += 1 - length += 1 * self.Cnt - length += 4 - length += 1 - length += 2 - - 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.WriteBYTE(data, self.LineList[i]) - data = CommFunc.WriteDWORD(data, self.AwardRecord) - data = CommFunc.WriteBYTE(data, self.HasSweep) - data = CommFunc.WriteWORD(data, self.DayLV) - return data - - def OutputString(self): - DumpString = ''' - Head:%s, - Cnt:%d, - LineList:%s, - AwardRecord:%d, - HasSweep:%d, - DayLV:%d - '''\ - %( - self.Head.OutputString(), - self.Cnt, - "...", - self.AwardRecord, - self.HasSweep, - self.DayLV - ) - return DumpString - - -m_NAtagMCIceLodeInfo=tagMCIceLodeInfo() -ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCIceLodeInfo.Head.Cmd,m_NAtagMCIceLodeInfo.Head.SubCmd))] = m_NAtagMCIceLodeInfo #------------------------------------------------------ @@ -49697,6 +49840,142 @@ #------------------------------------------------------ +# B4 29 Buff消失 #tagSCBuffDel + +class tagSCBuffDel(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ObjID", c_int), + ("BuffID", c_int), + ("RelatedSkillID", c_int), # 关联的技能ID,一般是主技能ID或由于某个技能释放引起的buff变更 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x29 + 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 = 0x29 + self.ObjID = 0 + self.BuffID = 0 + self.RelatedSkillID = 0 + return + + def GetLength(self): + return sizeof(tagSCBuffDel) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 29 Buff消失 //tagSCBuffDel: + Cmd:%s, + SubCmd:%s, + ObjID:%d, + BuffID:%d, + RelatedSkillID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID, + self.BuffID, + self.RelatedSkillID + ) + return DumpString + + +m_NAtagSCBuffDel=tagSCBuffDel() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCBuffDel.Cmd,m_NAtagSCBuffDel.SubCmd))] = m_NAtagSCBuffDel + + +#------------------------------------------------------ +# B4 28 Buff刷新 #tagSCBuffRefresh + +class tagSCBuffRefresh(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ObjID", c_int), # 谁身上的buff + ("BuffID", c_int), # buffID,某个obj上的唯一buffID,不同的buffID可能skillID相同 + ("SkillID", c_int), # 该buff对应技能表ID + ("RelatedSkillID", c_int), # 关联的技能ID,一般是主技能ID或由于某个技能释放引起的buff变更 + ("LastTime", c_int), # 剩余时长毫秒/回合数 + ("Layer", c_ushort), # 层数,不需要默认0 + ("OwnerID", c_int), # buff来源者,即施法方 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x28 + 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 = 0x28 + self.ObjID = 0 + self.BuffID = 0 + self.SkillID = 0 + self.RelatedSkillID = 0 + self.LastTime = 0 + self.Layer = 0 + self.OwnerID = 0 + return + + def GetLength(self): + return sizeof(tagSCBuffRefresh) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 28 Buff刷新 //tagSCBuffRefresh: + Cmd:%s, + SubCmd:%s, + ObjID:%d, + BuffID:%d, + SkillID:%d, + RelatedSkillID:%d, + LastTime:%d, + Layer:%d, + OwnerID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID, + self.BuffID, + self.SkillID, + self.RelatedSkillID, + self.LastTime, + self.Layer, + self.OwnerID + ) + return DumpString + + +m_NAtagSCBuffRefresh=tagSCBuffRefresh() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCBuffRefresh.Cmd,m_NAtagSCBuffRefresh.SubCmd))] = m_NAtagSCBuffRefresh + + +#------------------------------------------------------ # B4 12 删除恶意攻击玩家 #tagMCDelMaliciousAtkPlayer class tagMCDelMaliciousAtkPlayer(Structure): @@ -49889,6 +50168,90 @@ m_NAtagMCNPCSkillWarn=tagMCNPCSkillWarn() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCNPCSkillWarn.Head.Cmd,m_NAtagMCNPCSkillWarn.Head.SubCmd))] = m_NAtagMCNPCSkillWarn + + +#------------------------------------------------------ +# B4 18 对象属性刷新展示 #tagSCObjPropertyRefreshView + +class tagSCObjPropertyRefreshView(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ObjID", c_int), + ("RefreshType", c_ushort), # 同0418刷新类型,如血量、怒气 + ("Value", c_int), # 更新值 + ("ValueEx", c_int), # 更新值,如果是大数值的此值为整除亿部分 + ("DiffType", c_ubyte), # 变化类型,0-减少;1-增加 + ("DiffValue", c_int), # 变化值 + ("DiffValueEx", c_int), # 变化值,如果是大数值的此值为整除亿部分 + ("SkillID", c_int), # 使用的技能表ID + ("RelatedSkillID", c_int), # 关联的技能ID,一般是主技能ID,非主技能额外触发的为0 + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x18 + 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 = 0x18 + self.ObjID = 0 + self.RefreshType = 0 + self.Value = 0 + self.ValueEx = 0 + self.DiffType = 0 + self.DiffValue = 0 + self.DiffValueEx = 0 + self.SkillID = 0 + self.RelatedSkillID = 0 + return + + def GetLength(self): + return sizeof(tagSCObjPropertyRefreshView) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 18 对象属性刷新展示 //tagSCObjPropertyRefreshView: + Cmd:%s, + SubCmd:%s, + ObjID:%d, + RefreshType:%d, + Value:%d, + ValueEx:%d, + DiffType:%d, + DiffValue:%d, + DiffValueEx:%d, + SkillID:%d, + RelatedSkillID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID, + self.RefreshType, + self.Value, + self.ValueEx, + self.DiffType, + self.DiffValue, + self.DiffValueEx, + self.SkillID, + self.RelatedSkillID + ) + return DumpString + + +m_NAtagSCObjPropertyRefreshView=tagSCObjPropertyRefreshView() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCObjPropertyRefreshView.Cmd,m_NAtagSCObjPropertyRefreshView.SubCmd))] = m_NAtagSCObjPropertyRefreshView #------------------------------------------------------ @@ -50727,17 +51090,629 @@ #------------------------------------------------------ +# B4 24 回合战斗初始化 #tagSCTurnFightInit + +class tagSCTurnFightObj(Structure): + _pack_ = 1 + _fields_ = [ + ("ObjID", c_int), # 战斗单位唯一ID + ("NPCID", c_int), # 战斗NPCID,不同的实例ID对应的NPCID可能一样 + ("HeroID", c_int), # 玩家武将ID,仅玩家阵容有 + ("SkinID", c_int), # 玩家武将皮肤ID,仅玩家阵容有 + ("HP", c_int), # 当前血量,求余20亿部分 + ("HPEx", c_int), # 当前血量,整除20亿部分 + ("MaxHP", c_int), # 最大血量,求余20亿部分 + ("MaxHPEx", c_int), # 最大血量,整除20亿部分 + ("LV", c_ushort), # 等级 + ("PosNum", c_ubyte), # 在本阵容中的站位,从1开始,非主战斗武将为0,如红颜 + ("AngreXP", c_ushort), # 当前怒气值 + ] + + 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.ObjID = 0 + self.NPCID = 0 + self.HeroID = 0 + self.SkinID = 0 + self.HP = 0 + self.HPEx = 0 + self.MaxHP = 0 + self.MaxHPEx = 0 + self.LV = 0 + self.PosNum = 0 + self.AngreXP = 0 + return + + def GetLength(self): + return sizeof(tagSCTurnFightObj) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 24 回合战斗初始化 //tagSCTurnFightInit: + ObjID:%d, + NPCID:%d, + HeroID:%d, + SkinID:%d, + HP:%d, + HPEx:%d, + MaxHP:%d, + MaxHPEx:%d, + LV:%d, + PosNum:%d, + AngreXP:%d + '''\ + %( + self.ObjID, + self.NPCID, + self.HeroID, + self.SkinID, + self.HP, + self.HPEx, + self.MaxHP, + self.MaxHPEx, + self.LV, + self.PosNum, + self.AngreXP + ) + return DumpString + + +class tagSCTurnFightLineup(Structure): + Num = 0 #(BYTE Num)// 该阵容在本阵营的编号,不同阵营的阵容编号可能相同,都是从1开始,一般1V1时每个阵营为1个阵容,多V多时则每个阵营为多个阵容 + OwnerID = 0 #(DWORD OwnerID)// 阵容所属的玩家ID,可能为0,0代表非玩家阵容 + ShapeType = 0 #(BYTE ShapeType)// 本阵容阵型,0为默认阵型,可扩展不同的阵型,如boss特殊战斗阵型,或者其他不同站位的阵型 + ObjCnt = 0 #(BYTE ObjCnt) + ObjList = list() #(vector<tagSCTurnFightObj> ObjList)// 本阵容战斗单位列表 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.Num,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.OwnerID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.ShapeType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.ObjCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.ObjCnt): + temObjList = tagSCTurnFightObj() + _pos = temObjList.ReadData(_lpData, _pos) + self.ObjList.append(temObjList) + return _pos + + def Clear(self): + self.Num = 0 + self.OwnerID = 0 + self.ShapeType = 0 + self.ObjCnt = 0 + self.ObjList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 4 + length += 1 + length += 1 + for i in range(self.ObjCnt): + length += self.ObjList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.Num) + data = CommFunc.WriteDWORD(data, self.OwnerID) + data = CommFunc.WriteBYTE(data, self.ShapeType) + data = CommFunc.WriteBYTE(data, self.ObjCnt) + for i in range(self.ObjCnt): + data = CommFunc.WriteString(data, self.ObjList[i].GetLength(), self.ObjList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Num:%d, + OwnerID:%d, + ShapeType:%d, + ObjCnt:%d, + ObjList:%s + '''\ + %( + self.Num, + self.OwnerID, + self.ShapeType, + self.ObjCnt, + "..." + ) + return DumpString + + +class tagSCTurnFightFaction(Structure): + Faction = 0 #(BYTE Faction)//阵营编号,1或2,1为发起方的阵营编号 + LineupCnt = 0 #(BYTE LineupCnt) + LineupList = list() #(vector<tagSCTurnFightLineup> LineupList)// 本阵营所有阵容列表,为支持多V多扩展用,通常情况下每个阵营只有一个阵容 + data = None + + def __init__(self): + self.Clear() + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + self.Faction,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.LineupCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.LineupCnt): + temLineupList = tagSCTurnFightLineup() + _pos = temLineupList.ReadData(_lpData, _pos) + self.LineupList.append(temLineupList) + return _pos + + def Clear(self): + self.Faction = 0 + self.LineupCnt = 0 + self.LineupList = list() + return + + def GetLength(self): + length = 0 + length += 1 + length += 1 + for i in range(self.LineupCnt): + length += self.LineupList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteBYTE(data, self.Faction) + data = CommFunc.WriteBYTE(data, self.LineupCnt) + for i in range(self.LineupCnt): + data = CommFunc.WriteString(data, self.LineupList[i].GetLength(), self.LineupList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Faction:%d, + LineupCnt:%d, + LineupList:%s + '''\ + %( + self.Faction, + self.LineupCnt, + "..." + ) + return DumpString + + +class tagSCTurnFightInit(Structure): + Head = tagHead() + MapID = 0 #(DWORD MapID)// 自定义地图ID,可用于绑定战斗地图场景功能(如主线关卡、主线boss、爬塔、竞技场等) + FuncLineID = 0 #(DWORD FuncLineID)// MapID对应的扩展值,如具体某个关卡等 + TurnMax = 0 #(BYTE TurnMax)// 最大轮次 + Len = 0 #(WORD Len) + Msg = "" #(String Msg)// 本场战斗扩展信息,一般为json格式,具体内容由MapID决定 + FactionCnt = 0 #(BYTE FactionCnt) + FactionList = list() #(vector<tagSCTurnFightFaction> FactionList)// 阵营列表,通常固定只有两个阵营 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x24 + 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.ReadDWORD(_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) + self.FactionCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.FactionCnt): + temFactionList = tagSCTurnFightFaction() + _pos = temFactionList.ReadData(_lpData, _pos) + self.FactionList.append(temFactionList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x24 + self.MapID = 0 + self.FuncLineID = 0 + self.TurnMax = 0 + self.Len = 0 + self.Msg = "" + self.FactionCnt = 0 + self.FactionList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 4 + length += 4 + length += 1 + length += 2 + length += len(self.Msg) + length += 1 + for i in range(self.FactionCnt): + length += self.FactionList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteDWORD(data, self.MapID) + data = CommFunc.WriteDWORD(data, self.FuncLineID) + data = CommFunc.WriteBYTE(data, self.TurnMax) + data = CommFunc.WriteWORD(data, self.Len) + data = CommFunc.WriteString(data, self.Len, self.Msg) + data = CommFunc.WriteBYTE(data, self.FactionCnt) + for i in range(self.FactionCnt): + data = CommFunc.WriteString(data, self.FactionList[i].GetLength(), self.FactionList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + MapID:%d, + FuncLineID:%d, + TurnMax:%d, + Len:%d, + Msg:%s, + FactionCnt:%d, + FactionList:%s + '''\ + %( + self.Head.OutputString(), + self.MapID, + self.FuncLineID, + self.TurnMax, + self.Len, + self.Msg, + self.FactionCnt, + "..." + ) + return DumpString + + +m_NAtagSCTurnFightInit=tagSCTurnFightInit() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCTurnFightInit.Head.Cmd,m_NAtagSCTurnFightInit.Head.SubCmd))] = m_NAtagSCTurnFightInit + + +#------------------------------------------------------ +# B4 21 回合战斗对象开始行动 #tagMCTurnFightObjAction + +class tagMCTurnFightObjAction(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("TurnNum", c_ubyte), # 当前轮次 + ("ObjID", c_int), + ] + + 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 + 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 + '''\ + %( + self.Cmd, + self.SubCmd, + self.TurnNum, + self.ObjID + ) + 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), + ("KillerObjID", c_int), # 被谁击杀的,可能为0 + ("SkillID", c_int), # 被什么技能击杀,可能为0 + ] + + 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.KillerObjID = 0 + self.SkillID = 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, + KillerObjID:%d, + SkillID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID, + self.KillerObjID, + self.SkillID + ) + 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), + ("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.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, + HP:%d, + HPEx:%d, + RebornType:%d, + RebornValue1:%d, + RebornValue2:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID, + 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 30 查看战报结果 #tagSCTurnFightReportRet + +class tagSCTurnFightReport(Structure): + Head = tagHead() + GUID = "" #(char GUID[40])//该战报guid + Len = 0 #(DWORD Len) + Report = "" #(String Report)//完整战报 + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x30 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.GUID,_pos = CommFunc.ReadString(_lpData, _pos,40) + self.Len,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.Report,_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 = 0x30 + self.GUID = "" + self.Len = 0 + self.Report = "" + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 40 + length += 4 + length += len(self.Report) + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteString(data, 40, self.GUID) + data = CommFunc.WriteDWORD(data, self.Len) + data = CommFunc.WriteString(data, self.Len, self.Report) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + GUID:%s, + Len:%d, + Report:%s + '''\ + %( + self.Head.OutputString(), + self.GUID, + self.Len, + self.Report + ) + return DumpString + + + +#------------------------------------------------------ +# B4 25 回合战斗战报片段标记 #tagSCTurnFightReportSign + +class tagSCTurnFightReportSign(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("Sign", c_ubyte), # 0-战报片段开始;1-战报片段结束; + ] + + def __init__(self): + self.Clear() + self.Cmd = 0xB4 + self.SubCmd = 0x25 + 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 = 0x25 + self.Sign = 0 + return + + def GetLength(self): + return sizeof(tagSCTurnFightReportSign) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 25 回合战斗战报片段标记 //tagSCTurnFightReportSign: + Cmd:%s, + SubCmd:%s, + Sign:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.Sign + ) + return DumpString + + +m_NAtagSCTurnFightReportSign=tagSCTurnFightReportSign() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCTurnFightReportSign.Cmd,m_NAtagSCTurnFightReportSign.SubCmd))] = m_NAtagSCTurnFightReportSign + + +#------------------------------------------------------ # B4 20 回合制战斗状态 #tagMCTurnFightState class tagMCTurnFightState(Structure): Head = tagHead() - MapID = 0 #(DWORD MapID)// 自定义地图ID,可用于绑定战斗场景功能(如野外关卡,爬塔功能,竞技场等) - FuncLineID = 0 #(WORD FuncLineID) - TagType = 0 #(BYTE TagType)// 战斗目标类型,0-NPC,1-玩家,2-队伍 - TagID = 0 #(DWORD TagID)// 战斗目标类型对应的ID + MapID = 0 #(DWORD MapID)// 自定义地图ID,可用于绑定战斗地图场景功能(如主线关卡、主线boss、爬塔、竞技场等) + FuncLineID = 0 #(DWORD FuncLineID)// MapID对应的扩展值,如具体某个关卡等 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 @@ -50752,12 +51727,9 @@ self.Clear() _pos = self.Head.ReadData(_lpData, _pos) self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos) - self.FuncLineID,_pos = CommFunc.ReadWORD(_lpData, _pos) - self.TagType,_pos = CommFunc.ReadBYTE(_lpData, _pos) - self.TagID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.FuncLineID,_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 @@ -50769,11 +51741,8 @@ self.Head.SubCmd = 0x20 self.MapID = 0 self.FuncLineID = 0 - self.TagType = 0 - self.TagID = 0 self.State = 0 self.TurnNum = 0 - self.TurnMax = 0 self.Len = 0 self.Msg = "" return @@ -50782,10 +51751,7 @@ length = 0 length += self.Head.GetLength() length += 4 - length += 2 - length += 1 length += 4 - length += 1 length += 1 length += 1 length += 2 @@ -50797,12 +51763,9 @@ 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.WriteBYTE(data, self.TagType) - data = CommFunc.WriteDWORD(data, self.TagID) + data = CommFunc.WriteDWORD(data, self.FuncLineID) 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 @@ -50812,11 +51775,8 @@ Head:%s, MapID:%d, FuncLineID:%d, - TagType:%d, - TagID:%d, State:%d, TurnNum:%d, - TurnMax:%d, Len:%d, Msg:%s '''\ @@ -50824,11 +51784,8 @@ self.Head.OutputString(), self.MapID, self.FuncLineID, - self.TagType, - self.TagID, self.State, self.TurnNum, - self.TurnMax, self.Len, self.Msg ) @@ -50840,6 +51797,251 @@ #------------------------------------------------------ +# B4 26 回合战斗标签 #tagSCTurnFightTag + +class tagSCTurnFightTag(Structure): + Head = tagHead() + Len = 0 #(BYTE Len) + Tag = "" #(String Tag)// 标签,释放技能的标签格式: Skill_objID_skillID,其他标签格式可再扩展 + Sign = 0 #(BYTE Sign)// 0-标签头;1-标签尾; + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x26 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.Len,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.Tag,_pos = CommFunc.ReadString(_lpData, _pos,self.Len) + self.Sign,_pos = CommFunc.ReadBYTE(_lpData, _pos) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x26 + self.Len = 0 + self.Tag = "" + self.Sign = 0 + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 1 + length += len(self.Tag) + length += 1 + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteBYTE(data, self.Len) + data = CommFunc.WriteString(data, self.Len, self.Tag) + data = CommFunc.WriteBYTE(data, self.Sign) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + Len:%d, + Tag:%s, + Sign:%d + '''\ + %( + self.Head.OutputString(), + self.Len, + self.Tag, + self.Sign + ) + return DumpString + + +m_NAtagSCTurnFightTag=tagSCTurnFightTag() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCTurnFightTag.Head.Cmd,m_NAtagSCTurnFightTag.Head.SubCmd))] = m_NAtagSCTurnFightTag + + +#------------------------------------------------------ +# B4 27 使用技能 #tagSCUseSkill + +class tagSCUseSkillHurt(Structure): + _pack_ = 1 + _fields_ = [ + ("ObjID", c_int), + ("AttackTypes", c_int), # 飘血类型汇总,支持多种类型并存,如无视防御且暴击同时被格挡,二进制或运算最终值;0-失败;1-普通;2-回血;5-格挡;6-无视防御;7-暴击;9-闪避 + ("HurtHP", c_int), # 飘血值,求余亿部分 + ("HurtHPEx", c_int), # 飘血值,整除亿部分 + ("CurHP", c_int), # 更新剩余血量,求余亿部分 + ("CurHPEx", c_int), # 更新剩余血量,整除亿部分 + ("SuckHP", c_int), # 本次伤害转化的吸血量 + ("BounceHP", c_int), # 本次伤害反弹的伤害量 + ] + + 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.ObjID = 0 + self.AttackTypes = 0 + self.HurtHP = 0 + self.HurtHPEx = 0 + self.CurHP = 0 + self.CurHPEx = 0 + self.SuckHP = 0 + self.BounceHP = 0 + return + + def GetLength(self): + return sizeof(tagSCUseSkillHurt) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''// B4 27 使用技能 //tagSCUseSkill: + ObjID:%d, + AttackTypes:%d, + HurtHP:%d, + HurtHPEx:%d, + CurHP:%d, + CurHPEx:%d, + SuckHP:%d, + BounceHP:%d + '''\ + %( + self.ObjID, + self.AttackTypes, + self.HurtHP, + self.HurtHPEx, + self.CurHP, + self.CurHPEx, + self.SuckHP, + self.BounceHP + ) + return DumpString + + +class tagSCUseSkill(Structure): + Head = tagHead() + ObjID = 0 #(DWORD ObjID) + PMType = 0 #(BYTE PMType)// 物法类型 0或1-物理;2-法术 + BattleType = 0 #(BYTE BattleType)// 战斗类型 0-常规;1-连击;2-反击;3-追击 + CurHP = 0 #(DWORD CurHP)// 释放技能后剩余血量,吸血、反弹可能引起变化,求余亿部分 + CurHPEx = 0 #(DWORD CurHPEx)// 释放技能后剩余血量,吸血、反弹可能引起变化,整除亿部分 + SkillID = 0 #(DWORD SkillID) + HurtCount = 0 #(BYTE HurtCount)//伤害数目 + HurtList = list() #(vector<tagSCUseSkillHurt> HurtList)//size = HurtCount + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x27 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.ObjID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.PMType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.BattleType,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.CurHP,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.CurHPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.SkillID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.HurtCount,_pos = CommFunc.ReadBYTE(_lpData, _pos) + for i in range(self.HurtCount): + temHurtList = tagSCUseSkillHurt() + _pos = temHurtList.ReadData(_lpData, _pos) + self.HurtList.append(temHurtList) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0xB4 + self.Head.SubCmd = 0x27 + self.ObjID = 0 + self.PMType = 0 + self.BattleType = 0 + self.CurHP = 0 + self.CurHPEx = 0 + self.SkillID = 0 + self.HurtCount = 0 + self.HurtList = list() + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 4 + length += 1 + length += 1 + length += 4 + length += 4 + length += 4 + length += 1 + for i in range(self.HurtCount): + length += self.HurtList[i].GetLength() + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteDWORD(data, self.ObjID) + data = CommFunc.WriteBYTE(data, self.PMType) + data = CommFunc.WriteBYTE(data, self.BattleType) + data = CommFunc.WriteDWORD(data, self.CurHP) + data = CommFunc.WriteDWORD(data, self.CurHPEx) + data = CommFunc.WriteDWORD(data, self.SkillID) + data = CommFunc.WriteBYTE(data, self.HurtCount) + for i in range(self.HurtCount): + data = CommFunc.WriteString(data, self.HurtList[i].GetLength(), self.HurtList[i].GetBuffer()) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + ObjID:%d, + PMType:%d, + BattleType:%d, + CurHP:%d, + CurHPEx:%d, + SkillID:%d, + HurtCount:%d, + HurtList:%s + '''\ + %( + self.Head.OutputString(), + self.ObjID, + self.PMType, + self.BattleType, + self.CurHP, + self.CurHPEx, + self.SkillID, + self.HurtCount, + "..." + ) + return DumpString + + +m_NAtagSCUseSkill=tagSCUseSkill() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCUseSkill.Head.Cmd,m_NAtagSCUseSkill.Head.SubCmd))] = m_NAtagSCUseSkill + + +#------------------------------------------------------ # B5 04 拍卖行新上架拍品 #tagGCAddAuctionItemInfo class tagGCAddAuctionItem(Structure): -- Gitblit v1.8.0