From e5db513abff704b3ea6112618651e7d2b622a7c0 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 14 一月 2019 11:50:51 +0800
Subject: [PATCH] 2866 【1.5】【1.4.100】护盾清中毒debuff引起报错

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_2004.py        |    6 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py                  |   41 ++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1302.py |    4 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py  |    4 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_4012.py        |    7 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3001.py        |    6 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3002.py        |    6 +++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3000.py        |    6 +++
 8 files changed, 78 insertions(+), 2 deletions(-)

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 74463eb..61b0f3b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
@@ -729,6 +729,47 @@
     if passiveEff:
         passiveEff.DelBuffInfo(skillData)
     return
+
+
+#---------------------------------------------------------------------
+## 执行buff消失触发逻辑,不处理buff的功能逻辑,只处理需要的必须状态逻辑
+#  如不处理buff的 伤害,爆炸等,但必须处理恢复眩晕状态等
+def DoBuffDisApperEx( curObj, curBuff, tick ):
+    #这个函数里面不能做Buff添加和删除逻辑!!!!!不然指针会错乱
+    curSkill = curBuff.GetSkill()
+
+    skillData = GameWorld.GetGameData().GetSkillBySkillID(curSkill.GetSkillID())
+    
+    #是否是持续性技能
+    isLstSkill = curSkill.GetSkillType() in ChConfig.Def_LstBuff_List
+    
+    PassiveBuffEffMng.OnPassiveSkillTrigger(curObj, None, curSkill, ChConfig.TriggerType_BuffDisappear, tick)
+    
+    #buff消失的触发
+    for effectIndex in range( 0, curSkill.GetEffectCount() ):
+        curEffect = curSkill.GetEffect( effectIndex )
+        effectID = curEffect.GetEffectID()
+        
+        if not effectID:
+            continue
+        
+        if isLstSkill:
+            callFunc = GameWorld.GetExecFunc( GameBuffs, "BuffProcess_%d.%s"%( effectID, "OnBuffDisappearEx") )
+            if not callFunc:
+                callFunc = GameWorld.GetExecFunc( GameBuffs, "Buff_%d.%s"%( effectID, "OnBuffDisappearEx") )
+        else:        
+            callFunc = GameWorld.GetExecFunc( GameBuffs, "Buff_%d.%s"%( effectID, "OnBuffDisappearEx") )
+        
+        if not callFunc:
+            continue
+        
+        callFunc( curObj, curSkill, curBuff, curEffect, tick )
+            
+    passiveEff = PassiveBuffEffMng.GetPassiveEffManager().GetPassiveEff(curObj)
+    if passiveEff:
+        passiveEff.DelBuffInfo(skillData)
+    return
+
 #---------------------------------------------------------------------
 ## buff消失
 #  @param curObj 当前目标
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1302.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1302.py
index bd9a3a2..0163235 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1302.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1302.py
@@ -49,3 +49,7 @@
     return
 
 
+# 消失前
+def OnBuffDisappearEx(defender, curSkill, curBuff, curEffect, tick):
+    defender.SetCanAttack(True)
+    return
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_2004.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_2004.py
index f15cc3d..73338bd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_2004.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_2004.py
@@ -46,3 +46,9 @@
 def OnBuffDisappear(defender, curSkill, curBuff, curEffect, tick):
     defender.SetCanAttack(True)
     return
+
+## 执行buff消失触发逻辑,不处理buff的功能逻辑,只处理需要的必须状态逻辑
+#  如不处理buff的 伤害,爆炸等,但必须处理恢复眩晕状态等
+def OnBuffDisappearEx(defender, curSkill, curBuff, curEffect, tick):
+    defender.SetCanAttack(True)
+    return
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3000.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3000.py
index 28a5094..2804ae7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3000.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3000.py
@@ -54,4 +54,10 @@
     #    curObj.SetPKValue(0)
     curObj.SetPlayerNameColor(IPY_GameWorld.pncNormal)
     
+    
+def OnBuffDisappearEx(curObj, curSkill, curBuff, curEffect, tick):
+    #if curObj.GetPKValue() > 0:
+    #    curObj.SetPKValue(0)
+    curObj.SetPlayerNameColor(IPY_GameWorld.pncNormal)
+    
     
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3001.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3001.py
index c18a767..1943d40 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3001.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3001.py
@@ -52,4 +52,8 @@
 #        curObj.SetPKValue(0)
     curObj.SetPlayerNameColor(IPY_GameWorld.pncNormal)
     
-    
\ No newline at end of file
+    
+def OnBuffDisappearEx(curObj, curSkill, curBuff, curEffect, tick):
+    curObj.SetPlayerNameColor(IPY_GameWorld.pncNormal)   
+    
+ 
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3002.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3002.py
index 93364bc..a99e146 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3002.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_3002.py
@@ -50,4 +50,10 @@
 def OnBuffDisappear(curObj, curSkill, curBuff, curEffect, tick):
     curObj.SetPlayerNameColor(IPY_GameWorld.pncNormal)
     
+    
+def OnBuffDisappearEx(curObj, curSkill, curBuff, curEffect, tick):
+    curObj.SetPlayerNameColor(IPY_GameWorld.pncNormal)
+    
+    
+    
     
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_4012.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_4012.py
index 9f93f20..c98bdaa 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_4012.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_4012.py
@@ -51,3 +51,10 @@
     return
     
     
+def OnBuffDisappearEx(curObj, curSkill, curBuff, curEffect, tick):
+
+    stateType = curEffect.GetEffectValue(0)
+    GameObj.SetPyPlayerState(curObj, stateType, 0)
+    return
+    
+    
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py
index fde565d..165c6f0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py
@@ -63,8 +63,10 @@
         ownerID, ownerType = curBuff.GetOwnerID(), curBuff.GetOwnerType()
         
         #删除Buff
-        BuffSkill.DoBuffDisApper(defender, curBuff, tick)
+        BuffSkill.DoBuffDisApperEx(defender, curBuff, tick)
         buffSkill = curBuff.GetSkill()
+        if not buffSkill:
+            continue
         skillID = buffSkill.GetSkillID()
         buffManager.DeleteBuffByTypeID(buffSkill.GetSkillTypeID())
         SkillShell.ClearBuffEffectBySkillID(defender, skillID, ownerID, ownerType)

--
Gitblit v1.8.0