From 7a804a8a761d282e9aa629dbcbe62d0316ae4220 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 09 二月 2023 18:40:34 +0800
Subject: [PATCH] 9765 【BT8】【后端】神通(切换技能时所有出战神通技能重新进入CD)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py |    6 ++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py        |    8 +++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py
index ab373f0..b75aeec 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerShentong.py
@@ -25,6 +25,7 @@
 import PlayerGubao
 import ItemCommon
 import ChConfig
+import SkillCommon
 
 def GetShentongLVInfo(curPlayer, shentongID):
     lvInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShentongLVInfo % shentongID)
@@ -207,12 +208,17 @@
             playerCtl.RefreshSkillFightPowerByDel(skillID)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShentongSkillID % num, 0)
         
+    tick = GameWorld.GetGameWorld().GetTick()
     for num in range(ShentongSkillCountMax):
         setSkillID = setSkillIDList[num] 
         if setSkillID:
             skillManager.LearnSkillByID(setSkillID, True)
             playerCtl.RefreshSkillFightPowerEx(setSkillID, 0)
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShentongSkillID % num, setSkillID)
+            # 重新设置技能强制进入CD
+            curSkill = skillManager.FindSkillBySkillID(setSkillID)
+            if curSkill:
+                SkillCommon.SetSkillRemainTime(curSkill, PlayerControl.GetReduceSkillCDPer(curPlayer), tick, curPlayer, True)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShentongSkillID % num, setSkillID)        
         
     Sync_ShentongSkillInfo(curPlayer)
     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 21b92f7..8f6763a 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
@@ -94,7 +94,7 @@
 #  @param tick 当前时间
 #  @return None
 #  @remarks 函数详细说明.
-def SetSkillRemainTime(curSkill, reduceSkillCDPer, tick, atkObj=None):
+def SetSkillRemainTime(curSkill, reduceSkillCDPer, tick, atkObj=None, forceSync=False):
     #GameWorld.Log(GameWorld.GetScript().OutputTrace())
     curSkill.SetLastUseTick(tick)
     coolDownTime = curSkill.GetCoolDownTime()
@@ -114,6 +114,8 @@
                 
         # 被动技能的处理和主动技能区分
         curSkill.SetRemainTime(remainTime)
+        if forceSync:
+            curSkill.Sync_Skill()
         return
     
     # 减CD固定值
@@ -126,7 +128,7 @@
         remainTime = int(remainTime * max(0, ShareDefine.Def_MaxRateValue - reduceSkillCDPer) / ShareDefine.Def_MaxRateValue)
     
     curSkill.SetRemainTime(remainTime)
-    if coolDownTime != remainTime:
+    if forceSync or coolDownTime != remainTime:
         curSkill.Sync_Skill()
     
     #GameWorld.Log("技能: %s 剩余时间: %d"%(curSkill.GetSkillName(), curSkill.GetRemainTime()))

--
Gitblit v1.8.0