| | |
| | | _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),
|
| | |
| | | ("Value1", c_int),
|
| | | ("Value2", c_int),
|
| | | ("Layer", c_ubyte), #层数,不需要默认0
|
| | | ("OwnerID", c_int), # buff来源者
|
| | | ("OwnerType", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.Value1 = 0
|
| | | self.Value2 = 0
|
| | | self.Layer = 0
|
| | | self.OwnerID = 0
|
| | | self.OwnerType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | Value:%d,
|
| | | Value1:%d,
|
| | | Value2:%d,
|
| | | Layer:%d
|
| | | Layer:%d,
|
| | | OwnerID:%d,
|
| | | OwnerType:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | |
| | | self.Value,
|
| | | self.Value1,
|
| | | self.Value2,
|
| | | self.Layer
|
| | | self.Layer,
|
| | | self.OwnerID,
|
| | | self.OwnerType
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | | 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
|