From e0f8672ce49e360e4a318ac81c20f84b05d6bbe8 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 11 三月 2019 21:13:06 +0800
Subject: [PATCH] 6118 【后端】【1.5.200】新增技能效果

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py             |   84 +++++++++++++++------------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py                    |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4522.py  |   31 ++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4070.py |   33 +++++++++++
 4 files changed, 112 insertions(+), 38 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4522.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4522.py
new file mode 100644
index 0000000..03887ce
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveBuff_4522.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+# @todo: buff中抵消debuff
+#
+# @author: Alee
+# @date 2018-1-9 下午09:39:37
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+
+import ChConfig
+import GameWorld
+import SkillCommon
+import BuffSkill
+import IPY_GameWorld
+
+def CheckCanHappen(attacker, defender, effect, tagSkill):
+    debuffState = effect.GetEffectValue(1)
+    if debuffState and debuffState != SkillCommon.GetBuffStateType(tagSkill):
+        return False
+    
+    if effect.GetEffectValue(2):
+        if SkillCommon.GetBuffType(tagSkill) != ChConfig.Def_SkillBuffList.get(effect.GetEffectValue(2)):
+            return False
+    if not effect.GetEffectValue(0):
+        return True
+    return GameWorld.CanHappen(effect.GetEffectValue(0))
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4070.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4070.py
new file mode 100644
index 0000000..b266f84
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4070.py
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#
+# @todo: 高于等于指定血量时抵消某类debuff
+#
+# @author: Alee
+# @date 2018-1-9 下午09:39:37
+# @version 1.0
+#
+# @note: 
+#
+#---------------------------------------------------------------------
+
+import ChConfig
+import GameWorld
+import SkillCommon
+import GameObj
+
+def CheckCanHappen(attacker, defender, effect, curSkill, connSkill):
+    if GameObj.GetHP(attacker)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(attacker) < effect.GetEffectValue(1):
+        return False
+    
+    if effect.GetEffectValue(2):
+        if SkillCommon.GetBuffType(connSkill) != ChConfig.Def_SkillBuffList.get(effect.GetEffectValue(2)):
+            return False
+    
+    if not effect.GetEffectValue(0):
+        return True
+    
+    return GameWorld.CanHappen(effect.GetEffectValue(0))
+    
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
index f179550..e262780 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -350,6 +350,7 @@
              4067:ChConfig.TriggerType_ProDefValue, # 神兵护盾值下降时 62
              4068:ChConfig.TriggerType_LockHP, # 锁血触发技能 63
              4069:ChConfig.TriggerType_ZhongjiZhansha, # 终极斩杀 64
+             4070:ChConfig.TriggerType_DebuffOff,    # 抵消一次debuff 23
              }
     return tdict.get(effectID, -1) 
     #===========================================================================
@@ -387,6 +388,7 @@
              4519:ChConfig.TriggerType_WillDead,   # BUFF类: 进入濒死状态 25
              4520:ChConfig.TriggerType_AddLayer, # BUFF类: 目标BUFF层级增加时 52
              4521:ChConfig.TriggerType_BeLuckyHitSubPer, # 减少受到的会心伤害 65
+             4522:ChConfig.TriggerType_DebuffOff,   # BUFF类: 抵消debuff
              
              803:ChConfig.TriggerType_BloodShield,  # 血盾
              806:ChConfig.TriggerType_BloodShield,  # 血盾
@@ -729,36 +731,6 @@
     return PyGameData.g_PassiveEffManager
 
 
-## 当前释放技能 skillData
-#def CalcBuffTriggerSkill(attacker, skillData, target, tick):
-#    #===========================================================================
-#    # passiveEff = GetPassiveEffManager().GetPassiveEff(attacker, False)
-#    # if not passiveEff:
-#    #    return
-#    # #影响技能的BUFF
-#    # buffTriggerSkillDict = passiveEff.GetBuffTriggerSkill(skillData.GetSkillID())
-#    # if not buffTriggerSkillDict:
-#    #    return
-#    # 
-#    # passiveEff.CalcBuffTriggerSkill(attacker, target, skillData, buffTriggerSkillDict, tick)
-#    #===========================================================================
-#    OnPassiveSkillTrigger(attacker, target, ChConfig.TriggerType_AttackOver, tick)
-
-#===============================================================================
-# # 判断PK关系是否可攻击 Def_BattleRelationType_CommNoBoss也可攻击 只是攻击无效果
-# def CheckBattleRelationType(skillBattleType, battleRelationType):
-#    if skillBattleType in [ChConfig.Def_BattleRelationType_Comm, ChConfig.Def_BattleRelationType_CommNoBoss]:
-#        return True
-#    
-#    #if battleRelationType in [ChConfig.Def_BattleRelationType_Comm, ChConfig.Def_BattleRelationType_CommNoBoss]:
-#    #    return True
-#    
-#    if skillBattleType != battleRelationType:
-#        # PK模式的判定
-#        return False
-#    return True
-#===============================================================================
-
 # 查找被动技能时的对象
 def GetPassiveDefender(attacker, defender):
     # 寻找被击者,1.目标排除是自己(后面逻辑会更换) 2. 查客户端伤害队列,3.查服务端伤害队列    
@@ -780,7 +752,15 @@
         return
     
     return GameWorld.GetObj(curHurt.GetObjID(), curHurt.GetObjType())
-        
+
+# 当前有效被动触发技能, 可用于基础使用判定   
+def IsValidPassiveSkill(curSkill):
+    validMap = SkillShell.GetAttrMapID(curSkill)
+    if validMap and validMap != GameWorld.GetMap().GetMapID():
+        # 有效地图可触发
+        return False
+    
+    return True
 
 # 多种被动技能优先触发释放一个,如被动 血量40%触发无敌技能,血量一定是停留在40%
 # 先锁血,后触发技能 同 DelayUsePassiveTriggerSkill 使用
@@ -825,6 +805,9 @@
         if not curSkill:
             continue
 
+        if not IsValidPassiveSkill(curSkill):
+            continue
+        
         if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
             # 只有天赋才可以再次被触发
             continue 
@@ -975,6 +958,9 @@
         if not curSkill:
             continue
 
+        if not IsValidPassiveSkill(curSkill):
+            continue
+        
         if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
             # 只有天赋才可以再次被触发
             continue 
@@ -1070,6 +1056,10 @@
         curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
         if not curSkill:
             continue
+        
+        if not IsValidPassiveSkill(curSkill):
+            continue
+        
         if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
             # 只有天赋才可以再次被触发
             continue 
@@ -1133,6 +1123,9 @@
         if not curSkill:
             continue
         
+        if not IsValidPassiveSkill(curSkill):
+            continue
+
         effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
         if not effect:
             continue
@@ -1176,6 +1169,9 @@
             continue
         curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
         if not curSkill:
+            continue
+        
+        if not IsValidPassiveSkill(curSkill):
             continue
         
         effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
@@ -1225,6 +1221,13 @@
     
     for skillID, effectList in buffDict.items():
         if tagSkillID == skillID:
+            continue
+        
+        curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
+        if not curSkill:
+            continue
+        
+        if not IsValidPassiveSkill(curSkill):
             continue
         for passiveEffect in effectList:
             # 被动触发的技能
@@ -1285,15 +1288,19 @@
     for skillID, effectList in buffDict.items():
         if skillID == useSkillID:
             continue
+        curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
+        if not curSkill:
+            continue
+        
+        if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
+            # 只有天赋才可以再次被触发
+            continue 
+        
+        if not IsValidPassiveSkill(curSkill):
+            continue
         for passiveEffect in effectList:
             # 被动触发的技能
             pyName = "PassiveBuff_%s"%passiveEffect.GetEffectID()
-            curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
-            if not curSkill:
-                continue
-            if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
-                # 只有天赋才可以再次被触发
-                continue 
             callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
             if not callFunc:
                 continue
@@ -1365,6 +1372,9 @@
         if not curSkill:
             continue
         
+        if not IsValidPassiveSkill(curSkill):
+            continue
+        
         for passiveEffect in effectList:
             if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
                 # 只有天赋才可以再次被触发
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
index b69e8ad..767157b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -3438,7 +3438,7 @@
     
     return curSkill.GetExAttr2()
 
-# 只有在指定地图才能生效的buff效果
+# 只有在指定地图才能生效的buff效果,或者指定地图可被动触发
 def GetAttrMapID(curSkill):
     return curSkill.GetExAttr3()
 

--
Gitblit v1.8.0