From f198885f31c9c7eb19eb28adce562e39e64d581c Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 18 七月 2025 16:23:11 +0800 Subject: [PATCH] 121 【武将】武将系统-服务端(属性计算、战斗力计算;新角色初始给默认装备、默认阵容武将;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 208 +++++++++++++++++++++++++++++---------------------- 1 files changed, 118 insertions(+), 90 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py index 6908bca..8777856 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py @@ -43549,6 +43549,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): @@ -46528,94 +46636,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 #------------------------------------------------------ @@ -50732,8 +50752,10 @@ class tagSCTurnFightObj(Structure): _pack_ = 1 _fields_ = [ - ("ObjID", c_int), # 实例唯一ID - ("NPCID", c_int), # 绑定的NPCID,不同的实例ID对应的NPCID可能一样 + ("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亿部分 @@ -50755,6 +50777,8 @@ def Clear(self): self.ObjID = 0 self.NPCID = 0 + self.HeroID = 0 + self.SkinID = 0 self.HP = 0 self.HPEx = 0 self.MaxHP = 0 @@ -50774,6 +50798,8 @@ DumpString = '''// B4 24 回合战斗初始化 //tagSCTurnFightInit: ObjID:%d, NPCID:%d, + HeroID:%d, + SkinID:%d, HP:%d, HPEx:%d, MaxHP:%d, @@ -50785,6 +50811,8 @@ %( self.ObjID, self.NPCID, + self.HeroID, + self.SkinID, self.HP, self.HPEx, self.MaxHP, -- Gitblit v1.8.0