hxp
2019-04-18 c562008bec642a25245295eeec567081bc4e4c42
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossGrassland.py
@@ -22,15 +22,21 @@
import IpyGameDataPY
import PyGameData
import NPCCommon
import PlayerControl
import ChConfig
def DoResetCrossGrassland(curPlayer, eventType):
def DoResetCrossGrassland(curPlayer, eventType, fdeventID):
    ## 草园重置
    
    resetCollectType = 10 + eventType
    NPCCommon.DoResetCollectNPCTimeByType(curPlayer, [resetCollectType])
    
    # 宝箱怪次数重置
    if eventType == PlayerFairyDomain.FDEventType_GrasslandXian:
        npcID = IpyGameDataPY.GetFuncCfg("CrossGrasslandCfg", 1)
        if npcID:
            NPCCommon.UpdateNPCAttackCount(curPlayer, [npcID], 0)
    return
    
def __SetGrasslandVisitState(curPlayer, mapID, lineID, state):
@@ -111,10 +117,55 @@
    __SetGrasslandVisitState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visiting)
    return
## 给自定义副本奖励后续处理
## @return: 返回结算副本over信息字典,不含jsonItem信息
def OnGiveCustomFBPrizeOK(curPlayer, mapID, lineID):
def DoCheckUpdateGrasslandEnd(curPlayer):
    ## 检查更新草园已拜访完成
    grasslandMapIDList = [ChConfig.Def_FBMapID_CrossGrasslandLing, ChConfig.Def_FBMapID_CrossGrasslandXian]
    crossMapID = PlayerControl.GetCrossMapID(curPlayer)
    clientCustomSceneMapID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneMapID)
    if crossMapID in grasslandMapIDList:
        mapID = crossMapID
        lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBFuncLine)
    elif clientCustomSceneMapID in grasslandMapIDList:
        mapID = clientCustomSceneMapID
        lineID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneLineID)
    else:
        return
    # 采集次数是否已用完
    collNPCIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog("MapRefreshNPC", mapID)
    if not collNPCIpyDataList:
        return
    for collIpyData in collNPCIpyDataList:
        npcIDList = collIpyData.GetNPCIDList()
        for npcID in npcIDList:
            collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
            if not collectNPCIpyData:
                return
            limitMaxTime = collectNPCIpyData.GetMaxCollectCount()
            totalCollTime = NPCCommon.GetTodayCollectCount(curPlayer, npcID)
            if totalCollTime < limitMaxTime:
                GameWorld.DebugLog("草园NPC采集次数未用完! npcID=%s,totalCollTime=%s < limitMaxTime=%s" % (npcID, totalCollTime, limitMaxTime))
                return
    # 宝箱怪攻击次数是否已用完
    if mapID == ChConfig.Def_FBMapID_CrossGrasslandXian:
        boxNPCID = IpyGameDataPY.GetFuncCfg("CrossGrasslandCfg", 1)
        boxNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("TreasureNPC", boxNPCID)
        if not boxNPCIpyData:
            return
        attackCountDropWeightInfo = boxNPCIpyData.GetAttackCountDropWeightInfo()
        if not attackCountDropWeightInfo:
            return
        maxAttackCount = max(attackCountDropWeightInfo)
        attackCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NPCAttackCount % boxNPCID)
        if attackCount < maxAttackCount:
            GameWorld.DebugLog("草园宝箱怪攻击次数未用完! boxNPCID=%s,attackCount=%s < maxAttackCount=%s" % (boxNPCID, attackCount, maxAttackCount))
            return
    __SetGrasslandVisitState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visited)
    overDict = {}
    return overDict
    GameWorld.DebugLog("设置草园已完成!mapID=%s, lineID=%s" % (mapID, lineID))
    return