ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py
@@ -22,23 +22,13 @@
import PlayerBossReborn
import PlayerNewFairyCeremony
import PlayerFairyCeremony
import PlayerFeastTravel
import IpyGameDataPY
import NPCCommon
import ChConfig
## 是否能够通过活动查询进入
def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
    curfbStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
    if not curfbStar:
        #GameWorld.DebugLog("OnEnterFBEvent 首次进入个人boss免费!mapID=%s,lineID=%s" % (mapID, lineID))
        return True
    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
    maxCnt = FBCommon.GetEnterFBMaxCnt(curPlayer, mapID)
    if enterCnt >= maxCnt:
        GameWorld.ErrLog("次数不足,无法进入个人boss! mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
        return False
    return True
## 是否需要做进入副本通用检查条件逻辑,默认需要检查
@@ -52,9 +42,26 @@
## 客户端进入自定义场景
def OnEnterCustomScene(curPlayer, mapID, lineID):
    
    return
## 判断可否召唤木桩怪
def OnCanSummonPriWoodPile(curPlayer, mapID, lineID, npcID, count):
    if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
        FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Fight)
        EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_PersonalBoss, 0, ChConfig.CME_Log_Start)
        # 开始计时
        tick = GameWorld.GetGameWorld().GetTick()
        curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneStepTick, tick)
        FBCommon.UpdateCustomFBGrade(curPlayer, tick, FBCommon.GetFBLineGrade(mapID, lineID))
    return True
def OnCustomSceneProcess(curPlayer, mapID, lineID, tick):
    if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) == ChConfig.CustomMapStep_Fight:
        FBCommon.UpdateCustomFBGrade(curPlayer, tick, FBCommon.GetFBLineGrade(mapID, lineID))
        
    return
@@ -70,27 +77,36 @@
    if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
        return
    
    grade = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneGrade)
    costTime = GameWorld.GetGameWorld().GetTick() - curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneStepTick)
    GameWorld.DebugLog("个人boss过关: grade=%s,costTime=%s" % (grade, costTime))
    isFree = False
    curfbStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
    # 首次过关不扣次数
    if not curfbStar:
        isFree = True
        GameWorld.DebugLog("    首次过关!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, 1, False, [mapID])
        FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID) # 同步信息
    else:
        #增加进入次数
        FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_PersonalBoss)
        
    if curfbStar < grade:
        GameWorld.DebugLog("    更新评级!curfbStar=%s < grade=%s" % (curfbStar, grade), curPlayer.GetPlayerID())
        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, grade, False, [mapID])
        FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID) # 同步信息
    #增加进入次数
    FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_PersonalBoss, isFree=isFree)
    FBCommon.DelFBEnterTicket(curPlayer, ChConfig.Def_FBMapID_PersonalBoss)
    PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_VIPBOSS, 1)
    PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, 1)
    PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, 1)
    PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_VIPBoss, 1)
    
    npcCountDict = {bossID:1}
    dropItemMapInfo = [0, 0]
    jsonItemList = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, npcCountDict, dropItemMapInfo=dropItemMapInfo, isVirtualDrop=True)[0]
    jsonItemList = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, npcCountDict, dropItemMapInfo=dropItemMapInfo, curGrade=grade, isVirtualDrop=True)[0]
    FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Over)
    isPass = 1
    overDict = {FBCommon.Over_itemInfo:jsonItemList}
    overDict = {FBCommon.Over_itemInfo:jsonItemList, FBCommon.Over_grade:grade, FBCommon.Over_costTime:costTime}
    FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
    return
@@ -101,3 +117,36 @@
        return 0
    return ipyData.GetNPCID()
## 可否扫荡
def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    if mapID != ChConfig.Def_FBMapID_PersonalBoss:
        return
    curGrade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
    if curGrade < 5:
        GameWorld.DebugLog("没有S级不能扫荡! curGrade=%s" % curGrade)
        return
    return True
## 扫荡结果
def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    bossID = __GetPersonalBossID(lineID)
    grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
    GameWorld.DebugLog("个人boss扫荡: lineID=%s,bossID=%s,grade=%s,sweepCnt=%s"
                       % (lineID, bossID, grade, sweepCnt), curPlayer.GetPlayerID())
    PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_VIPBOSS, sweepCnt)
    PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, sweepCnt)
    PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, sweepCnt)
    PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_VIPBoss, sweepCnt)
    npcCountDict = {bossID:sweepCnt}
    jsonItemList = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, npcCountDict, curGrade=grade)[0]
    isPass = 1
    overDict = {FBCommon.Over_itemInfo:jsonItemList, FBCommon.Over_isSweep:1}
    FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
    return True