| | |
| | | import PlayerControl
|
| | | import ChConfig
|
| | | import FBCommon
|
| | | import ItemControler
|
| | |
|
| | | FBDict_SyncFBNPC = 'SyncFBNPC' #是否需要同步副本NPC
|
| | |
|
| | |
| | |
|
| | | if mapID == ChConfig.Def_FBMapID_CrossGrasslandXian:
|
| | | FBCommon.DelFBEnterTicket(curPlayer, mapID, lineID)
|
| | | |
| | | else:
|
| | | DoCheckUpdateGrasslandEnd(curPlayer)
|
| | | |
| | | SyncCustomSceneNPCCount(curPlayer, mapID, lineID)
|
| | | if mapID == ChConfig.Def_FBMapID_CrossGrasslandXian:
|
| | | boxNPCID = IpyGameDataPY.GetFuncCfg("CrossGrasslandCfg", 1)
|
| | |
| | | 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 == PlayerControl.GetCustomMapID(curPlayer):
|
| | | refreshMapNPCDict = IpyGameDataPY.GetFuncEvalCfg("CrossGrasslandCfg", 2)
|
| | | npcCountDict = refreshMapNPCDict.get((mapID, lineID), {})
|
| | | npcIDList = npcCountDict.keys()
|
| | | else:
|
| | | collNPCIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog("MapRefreshNPC", mapID)
|
| | | if not collNPCIpyDataList:
|
| | | return
|
| | | |
| | | npcIDList = []
|
| | | 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
|
| | |
|
| | | # 宝箱怪攻击次数是否已用完
|
| | | boxNPCID = IpyGameDataPY.GetFuncCfg("CrossGrasslandCfg", 1)
|
| | |
| | | isAuctionItem = 0
|
| | | itemID, itemCount = itemCountInfo/100, itemCountInfo%100
|
| | | awardItemList.append([itemID, itemCount, isAuctionItem])
|
| | | extraAward = [] #额外物品奖励
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("FairyDomain", {"MapID":mapID, "LineID":lineID})
|
| | | if ipyData:
|
| | | fdEventID = ipyData.GetID()
|
| | | extraAward = PlayerFairyDomain.GetFairyAppointAward(curPlayer, fdEventID)
|
| | | if not extraAward:
|
| | | extraAward = FBCommon.GetFBLineReward(mapID, lineID)
|
| | | if extraAward:
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, extraAward)
|
| | | awardItemList += extraAward
|
| | | overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(awardItemList)}
|
| | | FBCommon.NotifyFBOver(curPlayer, mapID, lineID, 1, overDict)
|
| | | ResetGrasslandAwardRecord(curPlayer)
|