From 3bc111d39530eca57909ff49ff7355c87f06a451 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 31 五月 2019 16:31:50 +0800
Subject: [PATCH] 6805 【后端】【2.0】副本前端化(增加回收木桩支持)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini | 6 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 52 +++++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 22 +++++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 52 +++++++++++++++++
4 files changed, 131 insertions(+), 1 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index 1abe51e..406c6ca 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -14514,6 +14514,58 @@
#------------------------------------------------------
+# B4 0F 回收私有专属木桩怪 #tagCMRecyclePriWoodPile
+
+class tagCMRecyclePriWoodPile(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ObjID", c_int),
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB4
+ self.SubCmd = 0x0F
+ 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 = 0xB4
+ self.SubCmd = 0x0F
+ self.ObjID = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCMRecyclePriWoodPile)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B4 0F 回收私有专属木桩怪 //tagCMRecyclePriWoodPile:
+ Cmd:%s,
+ SubCmd:%s,
+ ObjID:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ObjID
+ )
+ return DumpString
+
+
+m_NAtagCMRecyclePriWoodPile=tagCMRecyclePriWoodPile()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRecyclePriWoodPile.Cmd,m_NAtagCMRecyclePriWoodPile.SubCmd))] = m_NAtagCMRecyclePriWoodPile
+
+
+#------------------------------------------------------
# B4 0E 玩家掉血 #tagCMRoleLostHP
class tagCMRoleLostHP(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index 32f0756..f97cd5b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -751,7 +751,7 @@
Writer = hxp
Releaser = hxp
RegType = 0
-RegisterPackCount = 5
+RegisterPackCount = 6
PacketCMD_1=0xA5
PacketSubCMD_1=0x52
@@ -773,6 +773,10 @@
PacketSubCMD_5=0x0C
PacketCallFunc_5=OnSummonPriWoodPile
+PacketCMD_6=0xB4
+PacketSubCMD_6=0x0F
+PacketCallFunc_6=OnRecyclePriWoodPile
+
;资源找回
[PlayerRecover]
ScriptName = Player\PlayerRecover.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 1abe51e..406c6ca 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -14514,6 +14514,58 @@
#------------------------------------------------------
+# B4 0F 回收私有专属木桩怪 #tagCMRecyclePriWoodPile
+
+class tagCMRecyclePriWoodPile(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ObjID", c_int),
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB4
+ self.SubCmd = 0x0F
+ 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 = 0xB4
+ self.SubCmd = 0x0F
+ self.ObjID = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagCMRecyclePriWoodPile)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B4 0F 回收私有专属木桩怪 //tagCMRecyclePriWoodPile:
+ Cmd:%s,
+ SubCmd:%s,
+ ObjID:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ObjID
+ )
+ return DumpString
+
+
+m_NAtagCMRecyclePriWoodPile=tagCMRecyclePriWoodPile()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRecyclePriWoodPile.Cmd,m_NAtagCMRecyclePriWoodPile.SubCmd))] = m_NAtagCMRecyclePriWoodPile
+
+
+#------------------------------------------------------
# B4 0E 玩家掉血 #tagCMRoleLostHP
class tagCMRoleLostHP(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 67f91e3..3cd95cb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -2003,6 +2003,28 @@
return
+#// B4 0F 回收私有专属木桩怪 #tagCMRecyclePriWoodPile
+#
+#struct tagCMRecyclePriWoodPile
+#{
+# tagHead Head;
+# DWORD ObjID;
+#};
+def OnRecyclePriWoodPile(index, clientData, tick):
+ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+ objID = clientData.ObjID
+ curNPC = GameWorld.FindNPCByID(objID)
+ if not curNPC:
+ return
+ if curNPC.GetType() not in [ChConfig.ntPriWoodPilePVE, ChConfig.ntPriWoodPilePVP]:
+ return
+ summonPlayerID = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_PriWoodPilePlayerID)
+ if curPlayer.GetPlayerID() != summonPlayerID:
+ #GameWorld.DebugLog("非玩家私有木桩...")
+ return
+ SetDeadEx(curNPC)
+ return
+
#// B4 0C 召唤私有专属木桩怪 #tagCMSummonPriWoodPile
#
#struct tagCMSummonPriWoodPile
--
Gitblit v1.8.0