From 1a5b56fd1738f4b01831a12587e1e34ee5def2ff Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 13 十一月 2023 13:32:15 +0800
Subject: [PATCH] 9912 [BT0.1]BOSS凭证(天玄丹buff支持多层,可批量使用)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py              |    8 ++++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py                |    7 +++----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py |    2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)

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 80bac64..7bcb02b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -1275,10 +1275,9 @@
     elif ChConfig.IsGameBoss(npcData):
         GameWorld.ErrLog("Boss没有掉落物品,NPCID=%s" % (npcID), dropPlayer.GetPlayerID())
         
-    if tianxuanState:
-        GameWorld.DebugLog("    去除天玄丹buff", playerID)
-        tick = GameWorld.GetGameWorld().GetTick()
-        BuffSkill.DelBuffBySkillID(dropPlayer, ChConfig.Def_SkillID_TianxuanBuff, tick)
+    if tianxuanBuff and tianxuanState:
+        GameWorld.DebugLog("    去除天玄丹buff: Layer=%s" % tianxuanBuff.GetLayer(), playerID)
+        BuffSkill.SetBuffLayer(dropPlayer, tianxuanBuff, max(tianxuanBuff.GetLayer() - 1, 0), True, ChConfig.Def_SkillID_TianxuanBuff, isSync=True)
         
     return dropIDList, auctionIDList, dropMoneyCnt, moneyValue
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
index 8430e82..6e637b2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
@@ -925,7 +925,7 @@
 
 
 # 当层级为0的时候删除此buff
-def SetBuffLayer(gameObj, buff, layer, delBuff=True, skillTypeID=0, disappearTrigger=True):
+def SetBuffLayer(gameObj, buff, layer, delBuff=True, skillTypeID=0, disappearTrigger=True, isSync=False):
     buff.SetLayer(layer)
     if layer == 0 and delBuff:
         tick = GameWorld.GetGameWorld().GetTick()
@@ -942,7 +942,11 @@
         elif curObjType == IPY_GameWorld.gotNPC:
             npcControl = NPCCommon.NPCControl(gameObj)
             npcControl.RefreshNPCAttrState()
-        
+    else:
+        curObjType = gameObj.GetGameObjType()
+        if isSync and curObjType == IPY_GameWorld.gotPlayer:
+            buffType = SkillCommon.GetBuffType(buff.GetSkill())
+            PYSync_RefreshBuff(gameObj, buff, buffType)
     return
 
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
index 8f6763a..a7fa34e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
@@ -1765,7 +1765,7 @@
 #    if buffSkillLV > curSkillLV:
 #        return
         
-    if not buffSkill.GetLastTime():
+    if not buffSkill.GetLastTime() and not BuffSkill.GetBuffMaxLayer(buffSkill):
         #GameWorld.DebugLog("无时间限制buff,只要存在buff,则无需重复添加")
         return
     

--
Gitblit v1.8.0