| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 15 主线掉落物品操作 #tagCSMainDropItemOP
|
| | |
|
| | | class tagCSMainDropItemOP(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | IndexList = list() #(vector<WORD> IndexList)// 掉落背包中的物品格子索引列表
|
| | | OPType = 0 #(BYTE OPType)// 0 - 拾取非装备物品;1 - 分解;2 - 穿戴/替换;
|
| | | OPValue = 0 #(BYTE OPValue)// 操作额外指令值,由操作类型决定,如穿戴时可发送穿戴后是否自动分解
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB4
|
| | | self.Head.SubCmd = 0x15
|
| | | 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):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.IndexList.append(value)
|
| | | self.OPType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.OPValue,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB4
|
| | | self.Head.SubCmd = 0x15
|
| | | self.Count = 0
|
| | | self.IndexList = list()
|
| | | self.OPType = 0
|
| | | self.OPValue = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 2 * self.Count
|
| | | length += 1
|
| | | length += 1
|
| | |
|
| | | 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.WriteWORD(data, self.IndexList[i])
|
| | | data = CommFunc.WriteBYTE(data, self.OPType)
|
| | | data = CommFunc.WriteBYTE(data, self.OPValue)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | IndexList:%s,
|
| | | OPType:%d,
|
| | | OPValue:%d
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "...",
|
| | | self.OPType,
|
| | | self.OPValue
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCSMainDropItemOP=tagCSMainDropItemOP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSMainDropItemOP.Head.Cmd,m_NAtagCSMainDropItemOP.Head.SubCmd))] = m_NAtagCSMainDropItemOP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 13 主线战斗请求 #tagCSMainFightReq
|
| | |
|
| | | class tagCSMainFightReq(Structure):
|
| | |
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ReqType", c_ubyte), # 0-停止战斗回城;1-设置消耗倍值;2-挑战小怪;3-挑战boss;4-下一段战报;5-下一队;
|
| | | ("ReqType", c_ubyte), # 0-停止战斗回城;1-设置消耗倍值;2-挑战关卡小怪;3-挑战关卡boss;4-继续战斗;
|
| | | ("ReqValue", c_int), # 请求值,ReqType为1时发送消耗倍值
|
| | | ]
|
| | |
|