From 2ebf4a52405b0b628b61c82c106c2e63414b02ae Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 24 一月 2019 18:06:00 +0800
Subject: [PATCH] 5931 【后端】【1.5.100】诛仙装备开发(装备位解锁条件读诛仙塔表)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 52 insertions(+), 4 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 b88c8d9..ca17209 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
@@ -25,6 +25,7 @@
 import PlayerTJG
 import OperControlManager
 import GameObj
+import CrossPlayerData
 #---------------------------------------------------------------------
 
 #---------------------------------------------------------------------
@@ -41,8 +42,8 @@
         # 避免配表错误导致报错
         return False
 
-    if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_GatherSoul and buffOwner and curObj.GetGameObjType() == IPY_GameWorld.gotNPC:
-        if buffOwner.GetGameObjType() == IPY_GameWorld.gotPlayer or (buffOwner.GetGameObjType() == IPY_GameWorld.gotNPC and NPCCommon.GetNpcObjOwnerIsPlayer(buffOwner)):
+    if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_GatherSoul and curObj.GetGameObjType() == IPY_GameWorld.gotNPC:
+        if curSkill.GetSkillTypeID() != 23052:
             #GameWorld.DebugLog('聚魂副本玩家不能对怪物上buff curSkill=%s,buffOwner=%s'%(curSkill.GetSkillTypeID(),buffOwner.GetID()))
             return True
         #GameWorld.DebugLog('聚魂副本对怪物上buff curSkill=%s,buffOwner=%s'%(curSkill.GetSkillTypeID(),buffOwner.GetID()))
@@ -155,6 +156,9 @@
     buffRepeatTimeType = GetBuffRepeatTimeType(curSkill) 
     #用于BUFF满的时候处理刷新逻辑
     isDelRefresh = False
+    
+    # 向跨服发送数据
+    CrossPlayerData.SendMergeData_Buff(curObj, curSkillID, plusValueList)
     
     # buff层级
     layerMaxCnt = 0
@@ -380,7 +384,7 @@
     # 通知客户端
     #buffState.Sync_AddBuffEx()
     if isNotify:
-        PYSync_RefreshBuff(curObj, addBuff, SkillCommon.GetBuffType(curSkill), notifyAll=False)
+        PYSync_RefreshBuff(curObj, addBuff, SkillCommon.GetBuffType(curSkill), notifyAll=False, owner = buffOwner)
 
     #检查是否属于刷新BUFF
     #===========================================================================
@@ -729,6 +733,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 当前目标
@@ -917,7 +962,7 @@
     
     return DelBuffBySkillID(curObj, skillID, tick)
 
-def PYSync_RefreshBuff(gameObj, curBuff, buffType, notifyAll=True):
+def PYSync_RefreshBuff(gameObj, curBuff, buffType, notifyAll=True, owner = None):
     sendPack = ChNetSendPack.tagObjAddBuff()
 
     sendPack.ObjType = gameObj.GetGameObjType()
@@ -929,6 +974,9 @@
     sendPack.Value1 = curBuff.GetValue1();
     sendPack.Value2 = curBuff.GetValue2();
     sendPack.Layer = curBuff.GetLayer();
+    if owner:
+        sendPack.OwnerID = owner.GetID()
+        sendPack.OwnerType = owner.GetGameObjType()
     if notifyAll or gameObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
         gameObj.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength());
     else:

--
Gitblit v1.8.0