From 787c076b2fdc73a11b9b76e2ea928f3da1f5873e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 19 十二月 2019 16:35:02 +0800
Subject: [PATCH] 8359 【主干】活跃兑换

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py |  100 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 74 insertions(+), 26 deletions(-)

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..cc92f20 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
@@ -32,7 +32,14 @@
 import PlayerSuccess
 import PlayerBossReborn
 import PlayerFairyCeremony
+import PlayerNewFairyCeremony
+import PlayerActLogin
+import PlayerWeekParty
 import ItemControler
+import GameFuncComm
+import SkillShell
+import BuffSkill
+import EventShell
 
 import random
 import math
@@ -97,6 +104,10 @@
 
 def OnFBPlayerOnLogin(curPlayer):
     playerID = curPlayer.GetPlayerID()
+    historyEnterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_HistoryEnterCnt)
+    expPerSecondDict = IpyGameDataPY.GetFuncEvalCfg("XjmjFirstEnter", 2, {})
+    if historyEnterCnt not in expPerSecondDict:
+        return
     playerExpTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_FirstEnterExpTime)
     if not playerExpTime:
         #GameWorld.DebugLog("还没进入过仙界秘境,不处理经验补时!", playerID)
@@ -113,7 +124,7 @@
     if not giveTime:
         #GameWorld.DebugLog("经验补时时间已超过单次挑战时长,不处理经验补时!playerExpTime=%s" % playerExpTime, playerID)
         return
-    expPerSecond = IpyGameDataPY.GetFuncCfg("XjmjFirstEnter", 2)
+    expPerSecond = expPerSecondDict[historyEnterCnt]
     giveExp = expPerSecond * giveTime
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_FirstEnterExpTime, FirstEnterExpTimeMax)
     if giveExp:
@@ -182,17 +193,28 @@
         FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_BZZD)
         PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_XJMJ, 1)
         PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_XJMJ, 1)
+        PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_XJMJ, 1)
+        PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_XJMJ, 1)
+        PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_XJMJ, 1)
+        EventShell.EventRespons_FBEvent(curPlayer, 'passxjmj')
         FBCommon.UpdateFBEnterTick(curPlayer)
         gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_EnterLV, playerLV)
         PyGameData.g_bzzdPlayerKillNPCCntDict.pop(playerID, 0)
         
         logType = FBCommon.GetFBJoinType(curPlayer, False)
         EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_BZZD, 0, ChConfig.CME_Log_Start, logType)
+        historyEnterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_HistoryEnterCnt)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_HistoryEnterCnt, min(historyEnterCnt+1, 999))
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_FirstEnterExpTime, 1)
+        __GiveFirstEnterPrize(curPlayer, historyEnterCnt+1)
         
+        
+    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)
@@ -223,27 +245,40 @@
         FBCommon.SendFBEncourageInfo(curPlayer, encourageLV)
     DoFBHelp(curPlayer, tick)
     
-    isFirstEnter = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_FirstEnterExpTime)
-    # 没有首次进入经验时间记录,可视为首次进入
-    if not isFirstEnter:
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_FirstEnterExpTime, 1)
-        __GiveFirstEnterPrize(curPlayer)
-        
     return
 
-def __GiveFirstEnterPrize(curPlayer):
-    XjmjFirstEnterPrize = IpyGameDataPY.GetFuncEvalCfg("XjmjFirstEnter", 1)
-    if not XjmjFirstEnterPrize:
+def __GiveFirstEnterPrize(curPlayer, historyEnterCnt):
+    XjmjFirstEnterPrizeDict = IpyGameDataPY.GetFuncEvalCfg("XjmjFirstEnter", 1, {})
+    if historyEnterCnt not in XjmjFirstEnterPrizeDict:
         return
-    silverMoney, goldPaper, itemID = XjmjFirstEnterPrize
+    silverMoney, goldMoney, itemID = XjmjFirstEnterPrizeDict[historyEnterCnt]
     if silverMoney:
         PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, silverMoney)
-    if goldPaper:
-        PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, goldPaper)
+    if goldMoney:
+        PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, goldMoney)
     if itemID:
-        ItemControler.GivePlayerItem(curPlayer, itemID, 1, 1, [IPY_GameWorld.rptItem])
-    GameWorld.DebugLog("首次进入给奖励:silverMoney=%s,goldPaper=%s,itemID=%s" 
-                       % (silverMoney, goldPaper, itemID), curPlayer.GetPlayerID())
+        ItemControler.GivePlayerItem(curPlayer, itemID, 1, 0, [IPY_GameWorld.rptItem])
+    GameWorld.DebugLog("首次进入给奖励:silverMoney=%s,goldMoney=%s,itemID=%s" 
+                       % (silverMoney, goldMoney, itemID), curPlayer.GetPlayerID())
+    return
+
+def CheckHurtBuff(curPlayer, tick, isAdd=True):
+    #人物等级低于世界等级X级,单人挑战仙界密境获得伤害BUFF加成
+    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_WorldLV):
+        return
+    playerID = curPlayer.GetID()
+    enterLV = GameWorld.GetGameFB().GetPlayerGameFBDictByKey(playerID, FBPlayerDict_EnterLV)
+    if enterLV < GameFuncComm.GetFuncLimitLV(ShareDefine.GameFuncID_WorldLV):
+        return
+    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
 
 ## 客户端发送开始副本
@@ -261,12 +296,12 @@
     curPlayer.Sync_TimeTick(IPY_GameWorld.tttAddUpTime, 0, max(notify_tick, 0), True)
     curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, max(notify_tick, 0), True)
     DoFBHelp(curPlayer, tick)
-    
-    isFirstEnter = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_FirstEnterExpTime)
-    # 没有首次进入经验时间记录,可视为首次进入
-    if not isFirstEnter:
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_FirstEnterExpTime, 1)
-        __GiveFirstEnterPrize(curPlayer)
+#    
+#    isFirstEnter = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_FirstEnterExpTime)
+#    # 没有首次进入经验时间记录,可视为首次进入
+#    if not isFirstEnter:
+#        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_FirstEnterExpTime, 1)
+#        __GiveFirstEnterPrize(curPlayer)
     return
 
 ##玩家退出副本
@@ -276,6 +311,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
 
 ##玩家主动离开副本.
@@ -283,6 +321,11 @@
 # @param tick 时间戳
 # @return 返回值无意义
 def DoPlayerLeaveFB(curPlayer, tick):
+    return
+
+def OnPlayerLVUp(curPlayer):
+    CheckHurtBuff(curPlayer, GameWorld.GetGameWorld().GetTick(), False)
+    FBCommon.UpdFBLineNPCStrengthenLV(curPlayer.GetPlayerID(), False)
     return
 
 ## 获得副本帮助信息
@@ -418,8 +461,8 @@
     gameFB.SetGameFBDict(BZZD_LastCheckExpTick, tick) # 这个全局tick只是处理多久执行一次而已,不参与其他逻辑
     
     fightTime = int(math.ceil((tick - GameWorld.GetGameFB().GetFBStepTick()) / 1000.0)) # 已经战斗时长,秒
-    expPerSecond = IpyGameDataPY.GetFuncCfg("XjmjFirstEnter", 2)
-    minTotalExp = expPerSecond * fightTime # 理论保底最少经验
+    expPerSecondDict = IpyGameDataPY.GetFuncEvalCfg("XjmjFirstEnter", 2, {})
+    
     
     playerManager = GameWorld.GetMapCopyPlayerManager()
     playerCount = playerManager.GetPlayerCount()
@@ -428,6 +471,9 @@
         if not curPlayer:
             continue
         playerID = curPlayer.GetPlayerID()
+        historyEnterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_HistoryEnterCnt)
+        if historyEnterCnt not in expPerSecondDict:
+            continue
         playerExpTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_FirstEnterExpTime)
         if playerExpTime >= fightTime:
             #GameWorld.DebugLog("已经处理完保底经验时间,不再处理!", playerID)
@@ -439,6 +485,8 @@
         exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
         expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
         playerTotalExp = expPoint * ChConfig.Def_PerPointValue + exp
+        expPerSecond = expPerSecondDict[historyEnterCnt]
+        minTotalExp = expPerSecond * fightTime # 理论保底最少经验
         giveExp = max(0, minTotalExp - playerTotalExp)
         if giveExp > 0:
             giveExp = PlayerControl.PlayerControl(curPlayer).AddExp(giveExp, ShareDefine.Def_ViewExpType_Sys)

--
Gitblit v1.8.0