From 834bb8b03d16728340954e8aef94bcb8356fe6fd Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 12 四月 2024 14:50:31 +0800
Subject: [PATCH] 10019 【砍树】回合战斗(增加技能被动效果5013 5014;优化效果4048;优化释放方式8 43) 1. 增加技能被动效果ID 5013 - 灵宠攻击时触发提升额外伤害百分比 2. 增加技能被动效果ID 5014 - 受到伤害时触发技能 3. 技能被动效果ID 4048 - 闪避时触发技能支持配置触发概率 4. 技能释放方式8,增加治疗方式8 - 按最后一次受伤值回血 5. 技能释放方式43,偷取目标属性,支持多次偷取层级buff逻辑;buff效果ID1015支持计算层级buff属性;

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5005.py |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5006.py |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5014.py |   21 +++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5013.py |   45 +++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_1015.py           |    4 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py     |    9 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py     |   56 +++++++------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4048.py |   24 ++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py             |   35 ++++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py                     |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameObj.py                             |   10 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py        |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                            |   11 ++
 13 files changed, 182 insertions(+), 41 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
index 24ed42c..27eb084 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -2280,10 +2280,14 @@
     aMinAtk = atkObj.GetMinAtk() * summonAtkPer        # 攻击方最小攻击
     aMaxAtk = atkObj.GetMaxAtk() * summonAtkPer       # 攻击方最大攻击
     if petNPCOwner:
+        petNPCOwner.SetDict("useSkillPetID", atkObj.GetID())
         #主人攻击力可能会变化,所以在这里用到时直接取
         aMinAtk = petNPCOwner.GetMinAtk() * summonAtkPer        # 攻击方最小攻击
         aMaxAtk = petNPCOwner.GetMaxAtk() * summonAtkPer       # 攻击方最大攻击
         #GameWorld.DebugLog("灵宠攻击,直接取主人攻击力: %s ~ %s,  自己: %s ~ %s" % (aMinAtk, aMaxAtk, atkObj.GetMinAtk(), atkObj.GetMaxAtk()))
+        
+        hurtValueExPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(petNPCOwner, defObj, curSkill, ChConfig.TriggerType_PetAtkHurtExPer)
+        
     enemyObj = None
     aPetStrengthenPer, dPetWeakenPer = 0, 0 # 强化灵兽, 弱化灵兽
     if turnFightTimeline:
@@ -2532,12 +2536,17 @@
     if atkObj.GetGameObjType() == IPY_GameWorld.gotPlayer or turnFightTimeline:
         # 记录最后一次伤害值
         GameObj.SetLastHurtValue(atkObj, resultHurtType.RealHurtHP)
+        GameObj.SetLastBeHurtValue(defObj, resultHurtType.RealHurtHP)
         if defObj.GetGameObjType() == IPY_GameWorld.gotNPC:
             atkObj.SetDict(ChConfig.Def_PlayerKey_LastHurtNPCObjID, defObj.GetID())
         else:
             defObj.SetDict(ChConfig.Def_PlayerKey_LastAttackerObjID, atkObj.GetID())
             
     TurnAttack.AddTurnObjHurtValue(atkObj, defObj, resultHurtType.HurtType, resultHurtType.RealHurtHP, resultHurtType.LostHP, curSkill)
+    
+    if resultHurtType.RealHurtHP:
+        PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, None, ChConfig.TriggerType_BeHurt, tick)
+        
     return
 
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index f067015..db86242 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -1208,7 +1208,8 @@
 Def_Cure_TagMaxHP, # 目标最大生命值 5
 Def_Cure_TagAtk, # 目标攻击力 6
 Def_Cure_LostHP, # 已损失生命 7
-) = range(8)
+Def_Cure_BeHurtValue, # 受伤值 8
+) = range(9)
 
 #回魔类型(影响公式参数)
 Def_RestoreTypeList = (
@@ -3373,6 +3374,8 @@
 Def_PlayerKey_GreatHitRateReduce = "GreatHitRateReduce"  # 抗卓越一击概率
 Def_PlayerKey_SuperHitRateReduce = "SuperHitRateReduce"  # 抗暴击概率
 Def_PlayerKey_IgnoreDefRateReduce = "IgnoreDefRateReduce"  # 抗无视防御概率
+Def_PlayerKey_LastBeHurtValue = "LastBeHurtValue" # 最后受伤值
+Def_PlayerKey_LastBeHurtValueEx = "LastBeHurtValueEx" # 最后受伤值
 Def_PlayerKey_LastHurtValue = "LastHurtValue" # 最后一次伤害值
 Def_PlayerKey_LastHurtValueEx = "LastHurtValueEx" # 最后一次伤害值
 Def_PlayerKey_LastHurtNPCObjID = "LastHurtNPCObjID" # 最后攻击的NPCObjID
@@ -5154,8 +5157,10 @@
 TriggerType_TurnFightStart, # 回合开场触发 100
 TriggerType_BeMissSkill,   # 目标闪避后触发技能 101
 TriggerType_BeHurtMax,   # 锁定受到伤害最大值 102
-TriggerType_BeSuperHitHurtExPer,  # 被暴击附加额外伤害百分比 103
-) = range(1, 104)
+TriggerType_BeSuperHitHurtExPer,  # 被暴击时受到额外伤害百分比 103
+TriggerType_PetAtkHurtExPer,  # 灵宠攻击时额外伤害百分比 104
+TriggerType_BeHurt,   # 受伤时触发 105
+) = range(1, 106)
 
 
 #不可以佩戴翅膀的地图
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameObj.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameObj.py
index 3103f12..4d0136c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameObj.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameObj.py
@@ -200,6 +200,16 @@
     gameObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValueEx, value / ShareDefine.Def_PerPointValue)
     return
 
+def GetLastBeHurtValue(gameObj):
+    ## 最后一次受伤值
+    hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastBeHurtValue)
+    hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastBeHurtValueEx)
+    return hurtEx * ShareDefine.Def_PerPointValue + hurt
+def SetLastBeHurtValue(gameObj, value):
+    gameObj.SetDict(ChConfig.Def_PlayerKey_LastBeHurtValue, value % ShareDefine.Def_PerPointValue)
+    gameObj.SetDict(ChConfig.Def_PlayerKey_LastBeHurtValueEx, value / ShareDefine.Def_PerPointValue)
+    return
+
 def GetBloodShiledHurt(gameObj):
     ## 伤害值用于血盾抵消
     hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
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 742985c..1ab2adb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
@@ -242,7 +242,7 @@
         if buffSkillLV == curSkillLV:
             if layerMaxCnt and curBuff.GetLayer() >= layerMaxCnt and turnFightTimeline and layerPlusAttr:
                 #GameWorld.DebugLog("回合制下属性层级达到最大层不再添加! curID=%s,skillID=%s,Layer=%s" % (curObj.GetID(), curSkillID, curBuff.GetLayer()))
-                return False
+                return
             
             changeLayer = False
             if layerMaxCnt and curBuff.GetLayer() < layerMaxCnt:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_1015.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_1015.py
index 817a096..893c2ba 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_1015.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_1015.py
@@ -14,6 +14,7 @@
 #---------------------------------------------------------------------
 
 import ChConfig
+import BuffSkill
 
 #---------------------------------------------------------------------
 
@@ -45,6 +46,9 @@
     
     vauleFunc = [curBuff.GetValue, curBuff.GetValue1, curBuff.GetValue2]
     addValue = vauleFunc[min(2, valueIndex)]()
+    if curBuff.GetLayer() and BuffSkill.IsLayerPlusAttr(curBuff):
+        addValue *= curBuff.GetLayer()
+        
     calcDict[attrType] = calcDict.get(attrType, 0) + addValue
     if attrType == ChConfig.TYPE_Calc_AttrATKMax:
         calcDict[ChConfig.TYPE_Calc_AttrATKMin] = calcDict.get(ChConfig.TYPE_Calc_AttrATKMin, 0) + addValue
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 5c3cfd8..34f2968 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
@@ -2244,6 +2244,8 @@
         cureBaseValue = 0 if not tagObj else GetCureBaseValue(tagObj, curSkill)
     elif cureType == ChConfig.Def_Cure_LostHP:
         cureBaseValue = max(0, GameObj.GetMaxHP(userObj) - GameObj.GetHP(userObj))
+    elif cureType == ChConfig.Def_Cure_BeHurtValue:
+        cureBaseValue = GameObj.GetLastBeHurtValue(userObj)
         
         
     #这边写死了效果1,基本已经定型
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py
index c1937b5..4e39b52 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py
@@ -37,34 +37,38 @@
         
     #GameWorld.DebugLog("偷取目标属性: atkID=%s,defID=%s,attrIndexAllowList=%s" % (attacker.GetID(), defender.GetID(), attrIndexAllowList))
     addBuffValueList = []
-    # 效果ID | 属性项,万分率
-    # 最多吸收目标3种属性 存入buffvalue,固定前3个效果
-    # A值-属性ID B值-吸取万分率 C值-最高不超过自身属性万分率,配0不限制
-    for i in range(3):
-        effect = curSkill.GetEffect(i)
-        attrIndex = effect.GetEffectValue(0)
-        if not attrIndex:
-            continue
-        if attrIndexAllowList and attrIndex not in attrIndexAllowList:
-            continue
-        
-        attrRate = effect.GetEffectValue(1)
-        tagValue = EffGetSet.GetValueByEffIndex(defender, attrIndex)
-        addValue = int(tagValue * attrRate / float(ChConfig.Def_MaxRateValue))
-        
-        maxRate = effect.GetEffectValue(2)
-        curValue = EffGetSet.GetValueByEffIndex(attacker, attrIndex)
-        if maxRate:
-            maxValue = int(curValue * maxRate / float(ChConfig.Def_MaxRateValue))
-            addValue = min(addValue, maxValue)
+    buff = SkillCommon.FindBuffByID(attacker, curSkill.GetSkillTypeID())[0]
+    if buff:
+        addBuffValueList = [buff.GetValue(), buff.GetValue1(), buff.GetValue2()]
+        #GameWorld.DebugLog("偷取目标属性,已经存在buff,直接取原值! atkID=%s,defID=%s,addBuffValueList=%s,layer=%s" 
+        #                   % (attacker.GetID(), defender.GetID(), addBuffValueList, buff.GetLayer()))
+    else:
+        # 效果ID | 属性项,万分率
+        # 最多吸收目标3种属性 存入buffvalue,固定前3个效果
+        # A值-属性ID B值-吸取万分率 C值-最高不超过自身属性万分率,配0不限制
+        for i in range(3):
+            effect = curSkill.GetEffect(i)
+            attrIndex = effect.GetEffectValue(0)
+            if not attrIndex:
+                continue
+            if attrIndexAllowList and attrIndex not in attrIndexAllowList:
+                continue
             
-        addBuffValueList.append(addValue)
-        GameWorld.DebugLog("偷取目标属性: atkID=%s,defID=%s,attrIndex=%s,attrRate=%s,addValue=%s,tagValue=%s,curValue=%s,maxRate=%s" 
-                           % (attacker.GetID(), defender.GetID(), attrIndex, attrRate, addValue, tagValue, curValue, maxRate))
+            attrRate = effect.GetEffectValue(1)
+            tagValue = EffGetSet.GetValueByEffIndex(defender, attrIndex)
+            addValue = int(tagValue * attrRate / float(ChConfig.Def_MaxRateValue))
+            
+            maxRate = effect.GetEffectValue(2)
+            curValue = EffGetSet.GetValueByEffIndex(attacker, attrIndex)
+            if maxRate:
+                maxValue = int(curValue * maxRate / float(ChConfig.Def_MaxRateValue))
+                addValue = min(addValue, maxValue)
+                
+            addBuffValueList.append(addValue)
+            GameWorld.DebugLog("偷取目标属性: atkID=%s,defID=%s,attrIndex=%s,attrRate=%s,addValue=%s,tagValue=%s,curValue=%s,maxRate=%s" 
+                               % (attacker.GetID(), defender.GetID(), attrIndex, attrRate, addValue, tagValue, curValue, maxRate))
         
     buffType = SkillCommon.GetBuffType(curSkill)
-    BuffSkill.DoAddBuff(attacker, buffType, curSkill, tick, addBuffValueList, attacker)
-    
-    return True
+    return BuffSkill.DoAddBuff(attacker, buffType, curSkill, tick, addBuffValueList, attacker)
     #处理技能触发和攻击成功逻辑
     #return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4048.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4048.py
new file mode 100644
index 0000000..0c304c1
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4048.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveBuff.PassiveSkill_4048
+#
+# @todo:闪避时触发
+# @author hxp
+# @date 2024-04-12
+# @version 1.0
+#
+# 详细描述: 闪避时触发
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2024-04-12 15:00"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+
+def CheckCanHappen(attacker, defender, effect, curSkill):
+    rate = effect.GetEffectValue(0) # 触发概率,兼容配0的情况
+    if rate and not GameWorld.CanHappen(rate):
+        return False
+    return True
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5005.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5005.py
index 63d90f4..ad6a48b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5005.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5005.py
@@ -28,7 +28,7 @@
         if not petObj:
             return False
         if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnSkillSuccessPetState):
-            #GameWorld.DebugLog("该灵宠释放过技能! 不再触发独立首次!", useSkillPetID.GetID())
+            #GameWorld.DebugLog("该灵宠释放过技能! 不再触发独立首次!", useSkillPetID)
             return False
     elif effType == 2:
         # 共享首次,直接取主人的状态
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5006.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5006.py
index 1bfbf5e..78d382c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5006.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5006.py
@@ -30,7 +30,7 @@
         if not petObj:
             return False
         if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
-            #GameWorld.DebugLog("该灵宠攻击过! 不再触发独立首次!", useSkillPetID.GetID())
+            #GameWorld.DebugLog("该灵宠攻击过! 不再触发独立首次!", useSkillPetID))
             return False
     elif effType == 2:
         # 共享首次,直接取主人的状态
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5013.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5013.py
new file mode 100644
index 0000000..84df8da
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5013.py
@@ -0,0 +1,45 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveBuff.PassiveSkill_5013
+#
+# @todo:灵宠攻击时触发提升额外伤害百分比
+# @author hxp
+# @date 2024-04-12
+# @version 1.0
+#
+# 详细描述: 灵宠攻击时触发提升额外伤害百分比
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2024-04-12 15:00"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+import ChConfig
+
+def CheckCanHappen(attacker, defender, effect, curSkill):
+    #生效类型(0-每次;1-独立首次,即每只灵宠独立算首次;2-共享首次,即本场战斗本方多只灵宠的情况下仅首次生效)
+    effType = effect.GetEffectValue(1)
+    if effType == 1:
+        # 独立首次,取灵宠自己的状态
+        useSkillPetID = attacker.GetDictByKey("useSkillPetID")
+        if not useSkillPetID:
+            return False
+        petObj = GameWorld.FindNPCByID(useSkillPetID)
+        if not petObj:
+            return False
+        if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
+            #GameWorld.DebugLog("该灵宠攻击过! 不再触发独立首次! effID=%s,useSkillPetID=%s" % (effect.GetEffectID(), useSkillPetID))
+            return False
+    elif effType == 2:
+        # 共享首次,直接取主人的状态
+        if attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
+            #GameWorld.DebugLog("已经有灵宠攻击过! 不再触发共享首次! effID=%s,atkID=%s" % (effect.GetEffectID(), attacker.GetID()))
+            return False
+        
+    return True
+
+def GetValue(attacker, defender, effect):
+    return effect.GetEffectValue(0)
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5014.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5014.py
new file mode 100644
index 0000000..6bc197b
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_5014.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveBuff.PassiveSkill_5014
+#
+# @todo:受到伤害时触发技能
+# @author hxp
+# @date 2024-04-12
+# @version 1.0
+#
+# 详细描述: 受到伤害时触发技能
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2024-04-12 15:00"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+
+def CheckCanHappen(attacker, defender, effect, curSkill):
+    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 578a15c..488bdc9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -450,6 +450,8 @@
              5010:ChConfig.TriggerType_IsDealy,  # 是否触发致命一击 72
              5011:ChConfig.TriggerType_TurnFightStart, # 回合开场触发 100
              5012:ChConfig.TriggerType_BeMissSkill,   # 目标闪避后触发技能 101
+             5013:ChConfig.TriggerType_PetAtkHurtExPer,   # 灵宠攻击时额外伤害百分比 104
+             5014:ChConfig.TriggerType_BeHurt,   # 受伤时触发 105
              }
     return tdict.get(effectID, -1) 
     #===========================================================================
@@ -1597,12 +1599,29 @@
                 AfterUsePassiveSkill(pyName, attacker, defender, passiveEffect, tick)
                 triggerCount += 1
             SkillCommon.SetUsingPassiveSkill(attacker, 0)
-
+            
         if triggerCount:
-            hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_BuffTriggerDelLayer)
-            if hasEffect:
-                BuffSkill.ReduceBuffLayer(attacker, None, curSkill.GetSkillTypeID(), triggerCount)
-                
+            OnTriggerBuffDel(attacker, curSkill, triggerCount)
+            
+    return
+
+def OnTriggerBuffDel(curObj, curSkill, triggerCount):
+    ## buff中触发减层 或 删除buff 4544
+    hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_BuffTriggerDelLayer)
+    if not hasEffect:
+        return
+    skillID = curSkill.GetSkillID()
+    skillTypeID = curSkill.GetSkillTypeID()
+    isDelBuff = hasEffect.GetEffectValue(0)
+    if isDelBuff:
+        tick = GameWorld.GetGameWorld().GetTick()
+        isOK = BuffSkill.DelBuffBySkillID(curObj, skillID, tick)
+        GameWorld.DebugLog("buff中触发效果删除本buff! objID=%s,delSkillID=%s,isOK=%s" % (curObj.GetID(), skillID, isOK))
+    else:
+        GameWorld.DebugLog("buff中触发效果减层! objID=%s,skillTypeID=%s" % (curObj.GetID(), skillTypeID))
+        BuffSkill.ReduceBuffLayer(curObj, None, skillTypeID, triggerCount)
+    return
+ 
 def AfterUsePassiveSkill(pyName, attacker, defender, passiveEffect, tick):
     # 附加触发后逻辑
     callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "AfterUsePassiveSkill"))
@@ -1689,10 +1708,8 @@
             triggerCount += 1
             
         if triggerCount:
-            hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_BuffTriggerDelLayer)
-            if hasEffect:
-                BuffSkill.ReduceBuffLayer(attacker, None, curSkill.GetSkillTypeID(), triggerCount)
-                
+            OnTriggerBuffDel(attacker, curSkill, triggerCount)
+            
     return curValue
 
 

--
Gitblit v1.8.0