hxp
2021-11-04 563e6d6c9bb5e09f7ef7d3534466acd2dbc2aa36
9325 【BT3】【BT4】【BT5】【主干】【后端】日常扫荡优化

# Conflicts:
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
8个文件已修改
190 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossDemonKing.py 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossGrassland.py 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KillDevil.py 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MunekadoTrial.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py
@@ -21,6 +21,7 @@
import GameWorld
import ChConfig
import PlayerFairyDomain
import GameLogic_CrossGrassland
import PlayerControl
import ShareDefine
import random
@@ -34,7 +35,7 @@
#  @remarks 函数详细说明.
def OnExec(curPlayer, msgList):
    if not msgList:
        GameWorld.DebugAnswer(curPlayer, "AddFairyEvent 事件ID")
        GameWorld.DebugAnswer(curPlayer, "AddFairyEvent 事件ID 事件ID ...")
        return
    maxEventCnt = PlayerFairyDomain.GetMaxEventCnt()  # 最大可出现事件个数
    if len(msgList) > maxEventCnt:
@@ -63,6 +64,13 @@
                        index = 0
                    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % fdEventID, ipyData.GetID() * 100 + index)
        
        ipyData = IpyGameDataPY.GetIpyGameData('FairyDomain', fdEventID)
        if not ipyData:
            continue
        # 草园重置
        if ipyData.GetEventType() in [PlayerFairyDomain.FDEventType_GrasslandXian, PlayerFairyDomain.FDEventType_GrasslandLing]:
            GameLogic_CrossGrassland.DoResetCrossGrassland(curPlayer, ipyData.GetEventType(), fdEventID)
    #设置寻访中
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 1)
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py
@@ -503,6 +503,62 @@
    FBCommon.Notify_FB_Over(curPlayer, overDict)
    return
## 可否扫荡
def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    return True
## 扫荡结果
def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    playerID = curPlayer.GetPlayerID()
    enterLV = curPlayer.GetLV()
    GameWorld.DebugLog("仙界秘境扫荡: mapID=%s,lineID=%s,sweepCnt=%s" % (mapID, lineID, sweepCnt), playerID)
    totalExp = 0
    fairylandNPCList = IpyGameDataPY.GetFuncEvalCfg('FairylandNPC', 1)
    for npcID, npcCount in fairylandNPCList:
        npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
        if not npcData:
            continue
        baseExp = npcData.GetExp()
        reExp = PlayerControl.GetPlayerReExp(curPlayer)
        expMulti = IpyGameDataPY.GetFuncCfg("XjmjMonsterExp", 2)
        addExp = eval(IpyGameDataPY.GetFuncCompileCfg("XjmjMonsterExp", 1))
        addExpT = addExp * npcCount
        playerControl = PlayerControl.PlayerControl(curPlayer)
        finalAddExp = playerControl.AddExp(addExpT, ShareDefine.Def_ViewExpType_KillNPC)
        totalExp += finalAddExp
        GameWorld.DebugLog("    reExp=%s,npcID=%s,baseExp=%s,expMulti=%s,addExp=%s,npcCount=%s,addExpT=%s,finalAddExp=%s,totalExp=%s"
                            % (reExp, npcID, baseExp, expMulti, addExp, npcCount, addExpT, finalAddExp, totalExp), playerID)
    rewardRateList = FBCommon.GetFBGradeRewardRateList(ChConfig.Def_FBMapID_BZZD)
    maxGrade = len(rewardRateList)
    grade = maxGrade # 扫荡直接取最高评级
    gradeAddExpRate = rewardRateList[maxGrade - grade]
    gradeExp = int(totalExp * gradeAddExpRate / 100.0)
    totalExp += gradeExp
    GameWorld.DebugLog("    totalExp=%s,gradeExp=%s,gradeAddExpRate=%s" % (totalExp, gradeExp, gradeAddExpRate), playerID)
    playerControl = PlayerControl.PlayerControl(curPlayer)
    playerControl.AddExp(gradeExp)
    expRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_TotalFightExp)
    expPointRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BZZD_TotalFightExpPoint)
    totalExpRecord = expPointRecord * ChConfig.Def_PerPointValue + expRecord
    upPer = 0 #提升比例
    if totalExp > totalExpRecord:#超过旧记录
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExp, totalExp % ChConfig.Def_PerPointValue)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExpPoint, totalExp / ChConfig.Def_PerPointValue)
        upPer = (totalExp - totalExpRecord) * 100 / totalExpRecord if totalExpRecord else 0
    # 通知结果
    overDict = {FBCommon.Over_enterLV:enterLV, FBCommon.Over_exp:totalExp % ChConfig.Def_PerPointValue,
                FBCommon.Over_expPoint: totalExp / ChConfig.Def_PerPointValue,
                'gradeExp':gradeExp % ChConfig.Def_PerPointValue, 'gradeExpPoint':gradeExp / ChConfig.Def_PerPointValue,
                'upPer':upPer, FBCommon.Over_grade:grade, FBCommon.Over_isSweep:1}
    __SendBZZDOverInfo(curPlayer, overDict)
    return
## 副本行为
def DoFBAction(curPlayer, actionType, actionInfo, tick):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossDemonKing.py
@@ -28,6 +28,7 @@
import NPCCommon
import ChConfig
import ChItem
import ItemControler
FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
FBDict_IsPlayerOver = 'IsPlayerOver_%s' #玩家是否已经结算掉落的,参数playerID
@@ -344,4 +345,30 @@
            
    return giveItemList
## 可否扫荡
def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    curState = PlayerFairyDomain.GetFairyDomainFBEventState(curPlayer, mapID, lineID)
    if curState not in [PlayerFairyDomain.FDEventState_CanVisit, PlayerFairyDomain.FDEventState_Visiting]:
        GameWorld.DebugLog("缥缈无法扫荡! 不存在该事件或无法进入! mapID=%s,lineID=%s,curState=%s" % (mapID, lineID, curState))
        return False
    return True
## 扫荡结果
def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    playerID = curPlayer.GetPlayerID()
    ipyData = IpyGameDataPY.GetIpyGameDataByCondition("FairyDomain", {"MapID":mapID, "LineID":lineID})
    if not ipyData:
        return
    eventID = ipyData.GetID()
    PlayerFairyDomain.SetFairyDomainFBEventState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visited)
    isOwner = True
    giveItemList = __GetDemonKingPrizeItemList(curPlayer, mapID, lineID, eventID, isOwner)
    ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList)
    isPass = 1
    overDict = {FBCommon.Over_ownerID:playerID, FBCommon.Over_ownerName:curPlayer.GetPlayerName(),
                FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList), FBCommon.Over_isSweep:1}
    FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossGrassland.py
@@ -26,6 +26,7 @@
import ChConfig
import FBCommon
import ItemControler
import random
FBDict_SyncFBNPC = 'SyncFBNPC' #是否需要同步副本NPC
@@ -323,5 +324,48 @@
    return
## 可否扫荡
def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    curState = PlayerFairyDomain.GetFairyDomainFBEventState(curPlayer, mapID, lineID)
    if curState not in [PlayerFairyDomain.FDEventState_CanVisit, PlayerFairyDomain.FDEventState_Visiting]:
        GameWorld.DebugLog("缥缈无法扫荡! 不存在该事件或无法进入! mapID=%s,lineID=%s,curState=%s" % (mapID, lineID, curState))
        return False
    return True
## 扫荡结果
def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    jsonItemList = []
    refreshMapNPCDict = IpyGameDataPY.GetFuncEvalCfg("CrossGrasslandCfg", 2)
    npcCountDict = refreshMapNPCDict.get((mapID, lineID), {})
    GameWorld.DebugLog("草园扫荡: mapID=%s,lineID=%s,npcCountDict=%s" % (mapID, lineID, npcCountDict))
    if npcCountDict:
        npcIDList = npcCountDict.keys()
        doCount = sum(npcCountDict.values()) * 2
        while npcIDList and doCount >= 0:
            doCount -= 1
            npcID = random.choice(npcIDList)
            collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
            if not collectNPCIpyData:
                npcIDList.remove(npcID)
                continue
            awardItemInfo = NPCCommon.DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData, isSweep=True)
            if awardItemInfo == None:
                npcIDList.remove(npcID)
                GameWorld.DebugLog("    扫荡npcID=%s,没有奖励了,移除! npcIDList=%s" % (npcID, npcIDList))
                continue
            jsonItemList.extend(awardItemInfo)
            GameWorld.DebugLog("    npcID=%s,awardItemInfo=%s" % (npcID, awardItemInfo))
    GameWorld.DebugLog("    扫荡jsonItemList=%s" % jsonItemList)
    ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomain', {'MapID':mapID, 'LineID':lineID})
    if ipyData:
        fdeventID = ipyData.GetID()
        PlayerFairyDomain.SetFairyDomainEventState(curPlayer, fdeventID, PlayerFairyDomain.FDEventState_Visited)
    isPass = 1
    overDict = {FBCommon.Over_itemInfo:jsonItemList, FBCommon.Over_isSweep:1}
    FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KillDevil.py
@@ -214,7 +214,7 @@
    lineID = 0
    mapID = FBCommon.GetRecordMapID(GameWorld.GetMap().GetMapID())
    ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomain', {'MapID':mapID, 'LineID':lineID})
    fdeventID = ipyData.GetID()
    fdeventID = ipyData.GetID() if ipyData else 0
    GameWorld.DebugLog("副本结算: isPass=%s" % (isPass))
    
    noAssistPlayerID, assistMoneyType, assistPlayerMoneyDict = PlayerAssist.OnFBAssistOver(isPass, mapID)
@@ -313,5 +313,24 @@
def CheckCanAttackTagObjInFB(attacker, defender):
    return GameWorld.GetGameFB().GetFBStep() == FB_Step_Fight
## 可否扫荡
def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    curState = PlayerFairyDomain.GetFairyDomainFBEventState(curPlayer, mapID, lineID)
    if curState not in [PlayerFairyDomain.FDEventState_CanVisit, PlayerFairyDomain.FDEventState_Visiting]:
        GameWorld.DebugLog("缥缈无法扫荡! 不存在该事件或无法进入! mapID=%s,lineID=%s,curState=%s" % (mapID, lineID, curState))
        return False
    return True
## 扫荡结果
def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
    ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomain', {'MapID':mapID, 'LineID':lineID})
    if ipyData:
        fdeventID = ipyData.GetID()
        PlayerFairyDomain.SetFairyDomainEventState(curPlayer, fdeventID, PlayerFairyDomain.FDEventState_Visited)
    isPass = 1
    _, bossID = FBCommon.GetFBLineRefreshNPC(ChConfig.Def_FBMapID_KillDevil)
    jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, {bossID:1})
    overDict = {FBCommon.Over_itemInfo:jsonItemList, FBCommon.Over_isSweep:1}
    FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MunekadoTrial.py
@@ -470,9 +470,9 @@
    if mapID != ChConfig.Def_FBMapID_MunekadoTrial:
        return
    # 暂写死,前两层不能扫
    if lineID < 2:
        GameWorld.DebugLog("前两层不能扫荡!")
        return
    #if lineID < 2:
    #    GameWorld.DebugLog("前两层不能扫荡!")
    #    return
    historyStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
    if historyStar < 5:
        GameWorld.DebugLog("没有S级不能扫荡!")
@@ -508,6 +508,7 @@
    overDict = {FBCommon.Over_grade:star,FBCommon.Over_dataMapID:mapID,FBCommon.Over_isPass:1, FBCommon.Over_isSweep:1}
    overDict[FBCommon.Over_helpPlayer] = helpBattlePlayerDict
    overDict[FBCommon.Over_itemInfo] = jsonItemList
    GameWorld.DebugLog("宗门扫荡结果: overDict=%s" % overDict)
    FBCommon.Notify_FB_Over(curPlayer, overDict)
    return True
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFB.py
@@ -359,7 +359,7 @@
    if fbIpyData and fbIpyData.GetDayTimes():
        FBCommon.AddEnterFBCount(curPlayer, mapID, cnt)
    
    helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", mapID, lineID)
    helpIpyData = IpyGameDataPY.GetIpyGameDataNotLog("FBHelpBattle", mapID, lineID)
    if helpIpyData:
        FBHelpBattle.SendGameServer_SweepCallHelpBattlePlayer(curPlayer, mapID, lineID)
        return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
@@ -30,6 +30,7 @@
import PlayerFeastTravel
import PlayerFairyCeremony
import PlayerNewFairyCeremony
import ItemControler
import ItemCommon
import PyGameData
import EventShell
@@ -193,6 +194,16 @@
        GameWorld.Log('寻访仙域, 没有随机出事件,使用默认事件!! playerLV=%s,visitCnt=%s,默认fdEventIDList=%s'%(curPlayer.GetLV(), visitCnt, fdEventIDList), curPlayer.GetID())
        if not fdEventIDList:
            return
    for fdEventID in fdEventIDList:
        domainIpyData = IpyGameDataPY.GetIpyGameData('FairyDomain', fdEventID)
        if not domainIpyData:
            continue
        # 草园重置
        if domainIpyData.GetEventType() in [FDEventType_GrasslandXian, FDEventType_GrasslandLing]:
            GameLogic_CrossGrassland.DoResetCrossGrassland(curPlayer, domainIpyData.GetEventType(), fdEventID)
    if not PlayerActivity.AddDailyActionFinishCnt(curPlayer, dailyID):
        return
    
@@ -425,6 +436,7 @@
def GetFairyAdventuresAward(curPlayer, fdeventID, state):
    ##奇遇领取奖励
    state = GameWorld.ToIntDef(state, 0)
    isSweep, state = state / 10, state % 10
    if state == FDEventState_Visiting:
        SetFairyDomainEventState(curPlayer, fdeventID, state)
    elif state == FDEventState_Visited:
@@ -464,10 +476,15 @@
                    giveItemList.append(GameWorld.GetResultByWeightList(itemRateList))
            else:
                giveItemList = [ipyData.GetBasicAward()]
        NPCCommon.DoGiveItemByVirtualDrop(curPlayer, giveItemList, 0)
        msgDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
        if isSweep:
            ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList)
            msgDict.update({FBCommon.Over_dataMapID:ChConfig.Def_FBMapID_FairyTreasure,
                            FBCommon.Over_isPass:1, FBCommon.Over_isSweep:1})
        else:
            NPCCommon.DoGiveItemByVirtualDrop(curPlayer, giveItemList, 0)
        FBCommon.Notify_FB_Over(curPlayer, msgDict)
        GameWorld.DebugLog('缥缈奇遇领奖 msgDict=%s, fdeventID=%s' % (msgDict, fdeventID))
        GameWorld.DebugLog('缥缈奇遇领奖 msgDict=%s, fdeventID=%s, isSweep=%s' % (msgDict, fdeventID, isSweep))
    return