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 | 1028 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 822 insertions(+), 206 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index ee8d2b0..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 #------------------------------------------------------ @@ -51098,6 +51461,8 @@ ("Cmd", c_ubyte), ("SubCmd", c_ubyte), ("ObjID", c_int), + ("KillerObjID", c_int), # 被谁击杀的,可能为0 + ("SkillID", c_int), # 被什么技能击杀,可能为0 ] def __init__(self): @@ -51115,6 +51480,8 @@ self.Cmd = 0xB4 self.SubCmd = 0x22 self.ObjID = 0 + self.KillerObjID = 0 + self.SkillID = 0 return def GetLength(self): @@ -51127,12 +51494,16 @@ DumpString = '''// B4 22 回合战斗对象死亡 //tagMCTurnFightObjDead: Cmd:%s, SubCmd:%s, - ObjID:%d + ObjID:%d, + KillerObjID:%d, + SkillID:%d '''\ %( self.Cmd, self.SubCmd, - self.ObjID + self.ObjID, + self.KillerObjID, + self.SkillID ) return DumpString @@ -51426,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