From b0a1a6c78f4f7b3a2b83544b9e1bb664878179fc Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 07 一月 2026 19:26:40 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(支持查看NPC属性;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py |  184 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 184 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 7763c91..c144fc7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -38649,6 +38649,190 @@
 
 
 #------------------------------------------------------
+# B4 32 查看NPC属性结果 #tagSCViewNPCAttrRet
+
+class  tagSCViewNPCAttr(Structure):
+    PosNum = 0    #(BYTE PosNum)// 在本阵容中的站位,从1开始
+    NPCID = 0    #(DWORD NPCID)// 战斗NPCID,不同的实例ID对应的NPCID可能一样
+    HeroID = 0    #(DWORD HeroID)// 武将ID,玩家或NPC均可能有,如果有值则外观相关以该武将为准,否则以NPCID为准
+    LV = 0    #(WORD LV)// 等级,玩家的武将等级或NPC成长等级,等级显示以该值为准
+    Star = 0    #(BYTE Star)// 星级
+    BreakLV = 0    #(BYTE BreakLV)// 突破
+    AwakeLV = 0    #(BYTE AwakeLV)// 觉醒
+    AttrLen = 0    #(WORD AttrLen)
+    AttrMsg = ""    #(String AttrMsg)// 属性信息 {"属性ID":value, ...}
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        self.PosNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.NPCID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.HeroID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.LV,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.Star,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.BreakLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.AwakeLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.AttrLen,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.AttrMsg,_pos = CommFunc.ReadString(_lpData, _pos,self.AttrLen)
+        return _pos
+
+    def Clear(self):
+        self.PosNum = 0
+        self.NPCID = 0
+        self.HeroID = 0
+        self.LV = 0
+        self.Star = 0
+        self.BreakLV = 0
+        self.AwakeLV = 0
+        self.AttrLen = 0
+        self.AttrMsg = ""
+        return
+
+    def GetLength(self):
+        length = 0
+        length += 1
+        length += 4
+        length += 4
+        length += 2
+        length += 1
+        length += 1
+        length += 1
+        length += 2
+        length += len(self.AttrMsg)
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteBYTE(data, self.PosNum)
+        data = CommFunc.WriteDWORD(data, self.NPCID)
+        data = CommFunc.WriteDWORD(data, self.HeroID)
+        data = CommFunc.WriteWORD(data, self.LV)
+        data = CommFunc.WriteBYTE(data, self.Star)
+        data = CommFunc.WriteBYTE(data, self.BreakLV)
+        data = CommFunc.WriteBYTE(data, self.AwakeLV)
+        data = CommFunc.WriteWORD(data, self.AttrLen)
+        data = CommFunc.WriteString(data, self.AttrLen, self.AttrMsg)
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                PosNum:%d,
+                                NPCID:%d,
+                                HeroID:%d,
+                                LV:%d,
+                                Star:%d,
+                                BreakLV:%d,
+                                AwakeLV:%d,
+                                AttrLen:%d,
+                                AttrMsg:%s
+                                '''\
+                                %(
+                                self.PosNum,
+                                self.NPCID,
+                                self.HeroID,
+                                self.LV,
+                                self.Star,
+                                self.BreakLV,
+                                self.AwakeLV,
+                                self.AttrLen,
+                                self.AttrMsg
+                                )
+        return DumpString
+
+
+class  tagSCViewNPCAttrRet(Structure):
+    Head = tagHead()
+    MapID = 0    #(DWORD MapID)// 自定义地图ID,可用于绑定战斗地图场景功能(如主线关卡、主线boss、爬塔、竞技场等)
+    FuncLineID = 0    #(DWORD FuncLineID)// MapID对应的扩展值,如具体某个关卡等
+    ViewNPCID = 0    #(DWORD ViewNPCID)// 指定查看某个NPCID,发0则查看该关卡阵容所有NPC
+    NPCCnt = 0    #(BYTE NPCCnt)
+    NPCAttrList = list()    #(vector<tagSCViewNPCAttr> NPCAttrList)
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0xB4
+        self.Head.SubCmd = 0x32
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.FuncLineID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.ViewNPCID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.NPCCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        for i in range(self.NPCCnt):
+            temNPCAttrList = tagSCViewNPCAttr()
+            _pos = temNPCAttrList.ReadData(_lpData, _pos)
+            self.NPCAttrList.append(temNPCAttrList)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0xB4
+        self.Head.SubCmd = 0x32
+        self.MapID = 0
+        self.FuncLineID = 0
+        self.ViewNPCID = 0
+        self.NPCCnt = 0
+        self.NPCAttrList = list()
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 4
+        length += 4
+        length += 4
+        length += 1
+        for i in range(self.NPCCnt):
+            length += self.NPCAttrList[i].GetLength()
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteDWORD(data, self.MapID)
+        data = CommFunc.WriteDWORD(data, self.FuncLineID)
+        data = CommFunc.WriteDWORD(data, self.ViewNPCID)
+        data = CommFunc.WriteBYTE(data, self.NPCCnt)
+        for i in range(self.NPCCnt):
+            data = CommFunc.WriteString(data, self.NPCAttrList[i].GetLength(), self.NPCAttrList[i].GetBuffer())
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                MapID:%d,
+                                FuncLineID:%d,
+                                ViewNPCID:%d,
+                                NPCCnt:%d,
+                                NPCAttrList:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.MapID,
+                                self.FuncLineID,
+                                self.ViewNPCID,
+                                self.NPCCnt,
+                                "..."
+                                )
+        return DumpString
+
+
+m_NAtagSCViewNPCAttrRet=tagSCViewNPCAttrRet()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCViewNPCAttrRet.Head.Cmd,m_NAtagSCViewNPCAttrRet.Head.SubCmd))] = m_NAtagSCViewNPCAttrRet
+
+
+#------------------------------------------------------
 # B5 04 拍卖行新上架拍品 #tagGCAddAuctionItemInfo
 
 class  tagGCAddAuctionItem(Structure):

--
Gitblit v1.8.0