From 76e517b3f6093ab1571521eb3ae7b7143c44cdfb Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期四, 14 一月 2021 16:16:20 +0800 Subject: [PATCH] 4897 【工具】【主干】【BT】GM后台查看神兽装备增加索引显示; --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py | 295 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 290 insertions(+), 5 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py index a85e9db..f0b2e46 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py @@ -332,6 +332,7 @@ PosY = 0 #(WORD PosY) HurtCount = 0 #(WORD HurtCount)//伤害数目 HurtList = list() #(vector<tagSkillPosHurtObj> HurtList)//size = HurtCount + SkillElementID = 0 #(WORD SkillElementID)//专精技能ID data = None def __init__(self): @@ -354,6 +355,7 @@ temHurtList = tagSkillPosHurtObj() _pos = temHurtList.ReadData(_lpData, _pos) self.HurtList.append(temHurtList) + self.SkillElementID,_pos = CommFunc.ReadWORD(_lpData, _pos) return _pos def Clear(self): @@ -369,6 +371,7 @@ self.PosY = 0 self.HurtCount = 0 self.HurtList = list() + self.SkillElementID = 0 return def GetLength(self): @@ -383,6 +386,7 @@ length += 2 for i in range(self.HurtCount): length += self.HurtList[i].GetLength() + length += 2 return length @@ -398,6 +402,7 @@ data = CommFunc.WriteWORD(data, self.HurtCount) for i in range(self.HurtCount): data = CommFunc.WriteString(data, self.HurtList[i].GetLength(), self.HurtList[i].GetBuffer()) + data = CommFunc.WriteWORD(data, self.SkillElementID) return data def OutputString(self): @@ -410,7 +415,8 @@ PosX:%d, PosY:%d, HurtCount:%d, - HurtList:%s + HurtList:%s, + SkillElementID:%d '''\ %( self.Head.OutputString(), @@ -421,7 +427,8 @@ self.PosX, self.PosY, self.HurtCount, - "..." + "...", + self.SkillElementID ) return DumpString @@ -436,7 +443,7 @@ _fields_ = [ ("Cmd", c_ubyte), ("SubCmd", c_ubyte), - ("ObjType", c_ubyte), + ("ObjType", c_ubyte), #buff的受效果者 ("ObjID", c_int), ("BuffType", c_ubyte), #Buff类型 TBuffType ("SkillID", c_ushort), @@ -445,6 +452,8 @@ ("Value1", c_int), ("Value2", c_int), ("Layer", c_ubyte), #层数,不需要默认0 + ("OwnerID", c_int), # buff来源者 + ("OwnerType", c_ubyte), ] def __init__(self): @@ -470,6 +479,8 @@ self.Value1 = 0 self.Value2 = 0 self.Layer = 0 + self.OwnerID = 0 + self.OwnerType = 0 return def GetLength(self): @@ -490,7 +501,9 @@ Value:%d, Value1:%d, Value2:%d, - Layer:%d + Layer:%d, + OwnerID:%d, + OwnerType:%d '''\ %( self.Cmd, @@ -503,7 +516,9 @@ self.Value, self.Value1, self.Value2, - self.Layer + self.Layer, + self.OwnerID, + self.OwnerType ) return DumpString @@ -758,3 +773,273 @@ m_NAtagPlayerReborn=tagPlayerReborn() ChNetPackDict[eval("0x%02x%02x"%(m_NAtagPlayerReborn.Cmd,m_NAtagPlayerReborn.SubCmd))] = m_NAtagPlayerReborn + +#04 18 周围对象刷新#tagObjInfoRefresh + +class tagObjInfoRefresh(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ObjID", c_int), + ("ObjType", c_ubyte), + ("RefreshType", c_ubyte), + ("Value", c_int), + ] + + def __init__(self): + self.Clear() + self.Cmd = 0x04 + 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 = 0x04 + self.SubCmd = 0x18 + self.ObjID = 0 + self.ObjType = 0 + self.RefreshType = 0 + self.Value = 0 + return + + def GetLength(self): + return sizeof(tagObjInfoRefresh) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''//04 18 周围对象刷新//tagObjInfoRefresh: + Cmd:%s, + SubCmd:%s, + ObjID:%d, + ObjType:%d, + RefreshType:%d, + Value:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID, + self.ObjType, + self.RefreshType, + self.Value + ) + return DumpString + + +m_NAtagObjInfoRefresh=tagObjInfoRefresh() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagObjInfoRefresh.Cmd,m_NAtagObjInfoRefresh.SubCmd))] = m_NAtagObjInfoRefresh + +#04 08 玩家召唤NPC出现#tagPlayerSummonNPCAppear + +class tagPlayerSummonNPCAppear(Structure): + Head = tagHead() + PlayerID = 0 #(DWORD PlayerID) + Country = 0 #(BYTE Country) + ObjID = 0 #(DWORD ObjID)//召唤出来的NPCID + NPCID = 0 #(DWORD NPCID) + PosX = 0 #(WORD PosX) + PosY = 0 #(WORD PosY) + HP = 0 #(DWORD HP) + HPEx = 0 #(DWORD HPEx) + MaxHP = 0 #(DWORD MaxHP) + MaxHPEx = 0 #(DWORD MaxHPEx) + Speed = 0 #(WORD Speed) + LV = 0 #(WORD LV) + OwnerNameLen = 0 #(BYTE OwnerNameLen) + OwnerName = "" #(String OwnerName)//size = OwnerNameLen + data = None + + def __init__(self): + self.Clear() + self.Head.Cmd = 0x04 + self.Head.SubCmd = 0x08 + return + + def ReadData(self, _lpData, _pos=0, _Len=0): + self.Clear() + _pos = self.Head.ReadData(_lpData, _pos) + self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.Country,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.ObjID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.NPCID,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.PosX,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.PosY,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.HP,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.HPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.MaxHP,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.MaxHPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos) + self.Speed,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.LV,_pos = CommFunc.ReadWORD(_lpData, _pos) + self.OwnerNameLen,_pos = CommFunc.ReadBYTE(_lpData, _pos) + self.OwnerName,_pos = CommFunc.ReadString(_lpData, _pos,self.OwnerNameLen) + return _pos + + def Clear(self): + self.Head = tagHead() + self.Head.Clear() + self.Head.Cmd = 0x04 + self.Head.SubCmd = 0x08 + self.PlayerID = 0 + self.Country = 0 + self.ObjID = 0 + self.NPCID = 0 + self.PosX = 0 + self.PosY = 0 + self.HP = 0 + self.HPEx = 0 + self.MaxHP = 0 + self.MaxHPEx = 0 + self.Speed = 0 + self.LV = 0 + self.OwnerNameLen = 0 + self.OwnerName = "" + return + + def GetLength(self): + length = 0 + length += self.Head.GetLength() + length += 4 + length += 1 + length += 4 + length += 4 + length += 2 + length += 2 + length += 4 + length += 4 + length += 4 + length += 4 + length += 2 + length += 2 + length += 1 + length += len(self.OwnerName) + + return length + + def GetBuffer(self): + data = '' + data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer()) + data = CommFunc.WriteDWORD(data, self.PlayerID) + data = CommFunc.WriteBYTE(data, self.Country) + data = CommFunc.WriteDWORD(data, self.ObjID) + data = CommFunc.WriteDWORD(data, self.NPCID) + data = CommFunc.WriteWORD(data, self.PosX) + data = CommFunc.WriteWORD(data, self.PosY) + data = CommFunc.WriteDWORD(data, self.HP) + data = CommFunc.WriteDWORD(data, self.HPEx) + data = CommFunc.WriteDWORD(data, self.MaxHP) + data = CommFunc.WriteDWORD(data, self.MaxHPEx) + data = CommFunc.WriteWORD(data, self.Speed) + data = CommFunc.WriteWORD(data, self.LV) + data = CommFunc.WriteBYTE(data, self.OwnerNameLen) + data = CommFunc.WriteString(data, self.OwnerNameLen, self.OwnerName) + return data + + def OutputString(self): + DumpString = ''' + Head:%s, + PlayerID:%d, + Country:%d, + ObjID:%d, + NPCID:%d, + PosX:%d, + PosY:%d, + HP:%d, + HPEx:%d, + MaxHP:%d, + MaxHPEx:%d, + Speed:%d, + LV:%d, + OwnerNameLen:%d, + OwnerName:%s + '''\ + %( + self.Head.OutputString(), + self.PlayerID, + self.Country, + self.ObjID, + self.NPCID, + self.PosX, + self.PosY, + self.HP, + self.HPEx, + self.MaxHP, + self.MaxHPEx, + self.Speed, + self.LV, + self.OwnerNameLen, + self.OwnerName + ) + return DumpString + + +m_NAtagPlayerSummonNPCAppear=tagPlayerSummonNPCAppear() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagPlayerSummonNPCAppear.Head.Cmd,m_NAtagPlayerSummonNPCAppear.Head.SubCmd))] = m_NAtagPlayerSummonNPCAppear + +#06 08 NPC死亡#tagNPCDie + +class tagNPCDie(Structure): + _pack_ = 1 + _fields_ = [ + ("Cmd", c_ubyte), + ("SubCmd", c_ubyte), + ("ObjID", c_int), + ("Reason", c_int), + ("KillerType", c_ubyte), + ("KillerID", c_int), + ] + + def __init__(self): + self.Clear() + self.Cmd = 0x06 + self.SubCmd = 0x08 + 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 = 0x06 + self.SubCmd = 0x08 + self.ObjID = 0 + self.Reason = 0 + self.KillerType = 0 + self.KillerID = 0 + return + + def GetLength(self): + return sizeof(tagNPCDie) + + def GetBuffer(self): + return string_at(addressof(self), self.GetLength()) + + def OutputString(self): + DumpString = '''//06 08 NPC死亡//tagNPCDie: + Cmd:%s, + SubCmd:%s, + ObjID:%d, + Reason:%d, + KillerType:%d, + KillerID:%d + '''\ + %( + self.Cmd, + self.SubCmd, + self.ObjID, + self.Reason, + self.KillerType, + self.KillerID + ) + return DumpString + + +m_NAtagNPCDie=tagNPCDie() +ChNetPackDict[eval("0x%02x%02x"%(m_NAtagNPCDie.Cmd,m_NAtagNPCDie.SubCmd))] = m_NAtagNPCDie -- Gitblit v1.8.0