From 6c13b08938e96e5e1ed7f0c4cfe2be9a4130db4b Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 01 十一月 2018 11:38:26 +0800
Subject: [PATCH] 4518 【后端】【1.2.0】仙界秘境怪物等级跟随人物等级变化  4501 【后端】【1.2.0】人物等级低于世界等级X级,单人挑战仙界密境获得伤害BUFF加成

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py |   30 +++++++++++++++++++++++++++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py                  |    8 ++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py                    |    3 ++-
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
index 31ad5c9..bb1d347 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
@@ -2109,3 +2109,11 @@
     
     return callFunc(curPlayer, tick)
 
+def OnPlayerLVUp(curPlayer):
+    ## 玩家升级
+    do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
+    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnPlayerLVUp"))
+    if callFunc == None:
+        return False
+    return callFunc(curPlayer)
+    
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py
index 4bd727b..3c8e618 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py
@@ -33,6 +33,8 @@
 import PlayerBossReborn
 import PlayerFairyCeremony
 import ItemControler
+import SkillShell
+import BuffSkill
 
 import random
 import math
@@ -188,11 +190,12 @@
         
         logType = FBCommon.GetFBJoinType(curPlayer, False)
         EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_BZZD, 0, ChConfig.CME_Log_Start, logType)
-        
+    fbPlayerCnt = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_NPCStrengthenPlayerCnt)
+    isTeamEnter = (teamID and fbPlayerCnt > 1)
+    if not isTeamEnter:
+        CheckHurtBuff(curPlayer, tick)
     showState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GuideState, ChConfig.GuideState_BZZDShow)
     if not showState:
-        fbPlayerCnt = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_NPCStrengthenPlayerCnt)
-        isTeamEnter = (teamID and fbPlayerCnt > 1)
         if not isTeamEnter:
             FBCommon.SendFBEncourageInfo(curPlayer, 0)
             GameWorld.Log("首次单人进入该副本,需要等前端播完副本场景引导秀才正常进入准备阶段!", playerID)
@@ -246,6 +249,19 @@
                        % (silverMoney, goldPaper, itemID), curPlayer.GetPlayerID())
     return
 
+def CheckHurtBuff(curPlayer, tick, isAdd=True):
+    #人物等级低于世界等级X级,单人挑战仙界密境获得伤害BUFF加成
+    curLV = curPlayer.GetLV()
+    worldlv = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
+    buffID = IpyGameDataPY.GetFuncCfg('XjmjAddHarm', 2)
+    lvRange = IpyGameDataPY.GetFuncCfg('XjmjAddHarm')
+    if isAdd and worldlv - curLV >=lvRange:
+        curSkill = GameWorld.GetGameData().GetSkillBySkillID(buffID)
+        SkillShell.__DoLogic_AddBuff(curPlayer, curPlayer, curSkill, False, tick, 0, 0)
+    if not isAdd and worldlv - curLV < lvRange:
+        BuffSkill.DelBuffBySkillID(curPlayer, buffID, tick)
+    return
+
 ## 客户端发送开始副本
 def OnClientStartFB(curPlayer, tick):
     gameFB = GameWorld.GetGameFB()
@@ -276,6 +292,9 @@
 def DoExitFB(curPlayer, tick):
     # 清除鼓舞buff
     FBCommon.ClearEncourageBuff(curPlayer, tick)
+    buffID = IpyGameDataPY.GetFuncCfg('XjmjAddHarm', 2)
+    BuffSkill.DelBuffBySkillID(curPlayer, buffID, tick)
+    FBCommon.UpdFBLineNPCStrengthenLV(curPlayer.GetPlayerID(), True)
     return
 
 ##玩家主动离开副本.
@@ -285,6 +304,11 @@
 def DoPlayerLeaveFB(curPlayer, tick):
     return
 
+def OnPlayerLVUp(curPlayer):
+    CheckHurtBuff(curPlayer, GameWorld.GetGameWorld().GetTick(), False)
+    FBCommon.UpdFBLineNPCStrengthenLV(curPlayer.GetPlayerID(), False)
+    return
+
 ## 获得副本帮助信息
 #  @param curPlayer 当前玩家(被通知对象)
 #  @param tick 当前时间
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index 4204d7a..b4e5ad1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -3894,7 +3894,8 @@
             curPlayer.SetHP(curPlayer.GetMaxHP())
             if curPlayer.GetMaxMP() > 0:
                 curPlayer.SetMP(curPlayer.GetMaxMP())
-                
+            
+            FBLogic.OnPlayerLVUp(curPlayer)
             # 记录开服活动冲级数据
             OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_LV, curPlayer.GetLV())
             

--
Gitblit v1.8.0