From ced3a2fac8faf91241b1134604d9515dc40540f5 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 21 一月 2025 12:12:15 +0800
Subject: [PATCH] 10263 【越南】【英文】【BT】【砍树】后端支持NPC仿真实玩家战斗和快速战斗(快速战斗后退出副本优化buff通知)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py | 9 ++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 11 +++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py | 58 +++++++++++++++++++++++++++++
3 files changed, 77 insertions(+), 1 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py
index 5f12948..b76c6a0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py
@@ -168,6 +168,7 @@
PlayerControl.SetPlayerSightLevel(curPlayer, self.battleID) # 视野层级默认为战场ID,每场战斗的玩家独立视野
PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default * 3)
GameObj.SetHPFull(curPlayer) # 回满血
+ PlayerControl.SetProDef(curPlayer, PlayerControl.GetMaxProDef(curPlayer))
SkillCommon.ResetAllSkillCD(curPlayer) # 重置技能CD
return
@@ -234,7 +235,8 @@
return
ownerPlayerID = battle.playerID
isSysbg = battle.isSysbg
- GameWorld.DebugLog("清除镜像战斗: battleID=%s,ownerPlayerID=%s,isSysbg=%s" % (isSysbg, ownerPlayerID, isSysbg), battleID)
+ isQuick = battle.isQuick
+ GameWorld.DebugLog("清除镜像战斗: battleID=%s,ownerPlayerID=%s,isSysbg=%s,isQuick=%s" % (isSysbg, ownerPlayerID, isSysbg, isQuick), battleID)
playerMgr = GameWorld.GetPlayerManager()
tick = GameWorld.GetGameWorld().GetTick()
@@ -256,7 +258,12 @@
curPlayer.SetFaction(info.get("Faction", 0))
PlayerControl.SetPlayerSightLevel(curPlayer, info.get("SightLevel", 0))
PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default)
+
+ if not isQuick:
+ continue
+
GameObj.SetHPFull(curPlayer) # 回满血
+ PlayerControl.SetProDef(curPlayer, PlayerControl.GetMaxProDef(curPlayer))
SkillCommon.ResetAllSkillCD(curPlayer) # 重置技能CD
curPlayer.SetAttackTick(tick)
ChPlayer.__Sync_ClientBuff(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py
index 509aa40..2752f9e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChNetSendPack.py
@@ -440,6 +440,64 @@
m_NAtagUseSkillPos=tagUseSkillPos()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagUseSkillPos.Head.Cmd,m_NAtagUseSkillPos.Head.SubCmd))] = m_NAtagUseSkillPos
+#06 12 根据类型清空对象的buff#tagClearObjBuff
+
+class tagClearObjBuff(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("ObjType", c_ubyte),
+ ("ObjID", c_int),
+ ("BuffType", c_ubyte), #buff类型
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0x06
+ self.SubCmd = 0x12
+ 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 = 0x12
+ self.ObjType = 0
+ self.ObjID = 0
+ self.BuffType = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagClearObjBuff)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''//06 12 根据类型清空对象的buff//tagClearObjBuff:
+ Cmd:%s,
+ SubCmd:%s,
+ ObjType:%d,
+ ObjID:%d,
+ BuffType:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.ObjType,
+ self.ObjID,
+ self.BuffType
+ )
+ return DumpString
+
+
+m_NAtagClearObjBuff=tagClearObjBuff()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagClearObjBuff.Cmd,m_NAtagClearObjBuff.SubCmd))] = m_NAtagClearObjBuff
+
#06 05 对象增加Buf#tagObjAddBuff
class tagObjAddBuff(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index 40b3f25..eb41453 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -1265,12 +1265,23 @@
#@return 返回值无意义
#@remarks 通知玩家buff信息
def __Sync_ClientBuff(curPlayer):
+ __SyncClearBuff(curPlayer)
curPlayer.GetBuffState().Sync_Buff()
curPlayer.GetDeBuffState().Sync_Buff()
curPlayer.GetAura().Sync_Buff()
curPlayer.GetIncBuff().Sync_Buff()
curPlayer.GetProcessBuffState().Sync_Buff()
curPlayer.GetProcessDeBuffState().Sync_Buff()
+ return
+
+def __SyncClearBuff(curPlayer):
+ clientPack = ChNetSendPack.tagClearObjBuff()
+ clientPack.Clear()
+ clientPack.ObjType = curPlayer.GetGameObjType()
+ clientPack.ObjID = curPlayer.GetID()
+ clientPack.BuffType = 99 # 99代表清所有
+ NetPackCommon.SendFakePack(curPlayer, clientPack)
+ return
#---------------------------------------------------------------------
##上线时通知离线时间(离线挂机功能)
--
Gitblit v1.8.0