xdh
2019-04-26 468a44ce85216606038995d20083336d1c3cd9b0
6624 【后端】【2.0】仙界秘境定制经验
2个文件已修改
56 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3552,6 +3552,7 @@
Def_PDict_BZZD_TotalFightExp = "BZZD_TExp" # 最后一次进入副本挑战获得总经验, 领取多倍奖励时用
Def_PDict_BZZD_TotalFightExpPoint = "BZZD_TExpPoint" # 最后一次进入副本挑战获得总经验点, 领取多倍奖励时用
Def_PDict_BZZD_FirstEnterExpTime = "BZZD_FirstEnterExpTime" # 首次进入经验保底补差时长,可用于判断是否首次进入
Def_PDict_BZZD_HistoryEnterCnt = "BZZD_HistoryEnterCnt" # 历史进入总次数
# 公共CD副本扫荡
Def_PDict_PubCDFBS_Time = "PCDFBS_%s_Time" # 开始扫荡时间, 参数(公共组编号)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py
@@ -104,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)
@@ -120,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:
@@ -199,6 +203,12 @@
        
        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:
@@ -235,27 +245,21 @@
        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, 0, [IPY_GameWorld.rptItem])
    GameWorld.DebugLog("首次进入给奖励:silverMoney=%s,goldPaper=%s,itemID=%s"
                       % (silverMoney, goldPaper, itemID), curPlayer.GetPlayerID())
    GameWorld.DebugLog("首次进入给奖励:silverMoney=%s,goldMoney=%s,itemID=%s"
                       % (silverMoney, goldMoney, itemID), curPlayer.GetPlayerID())
    return
def CheckHurtBuff(curPlayer, tick, isAdd=True):
@@ -292,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
##玩家退出副本
@@ -457,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()
@@ -467,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)
@@ -478,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)