| | |
| | | def OnGetFBEnterPos(curPlayer, mapID, lineId, ipyEnterPosInfo, tick):
|
| | | return ipyEnterPosInfo
|
| | |
|
| | | def GetCurFBLineBOSSID(lineID=-1):
|
| | | def GetCurFBLineBOSSID(mapID=-1, lineID=-1):
|
| | | #该分线刷的BOSSID
|
| | | if mapID == -1:
|
| | | mapID = ChConfig.Def_FBMapID_CrossDemonKing if GameWorld.IsCrossServer() else ChConfig.Def_FBMapID_DemonKing
|
| | | if lineID == -1:
|
| | | lineID = GetCurFBFuncLineID()
|
| | | if lineID == -1:
|
| | | if mapID == -1 or lineID == -1:
|
| | | return 0
|
| | | mapID = ChConfig.Def_FBMapID_CrossDemonKing if GameWorld.IsCrossServer() else ChConfig.Def_FBMapID_DemonKing
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("FairyDomain", {"MapID":mapID, "LineID":lineID})
|
| | | if not ipyData:
|
| | | return 0
|
| | |
| | | def GetCurFBFuncLineID():
|
| | | ## 获取本线路功能线路ID
|
| | | if GameWorld.IsCrossServer():
|
| | | return GameWorld.GetGameWorld().GetPropertyID() % 1000
|
| | | return GameWorld.GetGameWorld().GetPropertyID() % 10000 / 10
|
| | | return GameWorld.GetGameWorld().GetPropertyID() - 1
|
| | |
|
| | | def GetCurFBLineZoneID():
|
| | | ## 获取本线路所属跨服分区
|
| | | if GameWorld.IsCrossServer():
|
| | | return GameWorld.GetGameWorld().GetPropertyID() / 1000
|
| | | return GameWorld.GetGameWorld().GetPropertyID() / 10000
|
| | | return 0
|
| | |
|
| | | ## 进副本
|
| | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | zoneID = GetCurFBLineZoneID()
|
| | | funcLineID = GetCurFBFuncLineID()
|
| | | bossID = GetCurFBLineBOSSID(funcLineID)
|
| | | bossID = GetCurFBLineBOSSID(lineID=funcLineID)
|
| | | visitCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
|
| | | GameWorld.Log("DoEnterFB zoneID=%s,funcLineID=%s,bossID=%s,visitCount=%s" % (zoneID, funcLineID, bossID, visitCount), playerID)
|
| | | PyGameData.g_fbPickUpItemDict.pop(playerID, 0)
|
| | |
| | | def __FBNPCOnKilled(curNPC, tick):
|
| | | bossID = curNPC.GetNPCID()
|
| | | funcLineID = GetCurFBFuncLineID()
|
| | | if bossID != GetCurFBLineBOSSID(funcLineID):
|
| | | if bossID != GetCurFBLineBOSSID(lineID=funcLineID):
|
| | | return
|
| | |
|
| | | zoneID = GetCurFBLineZoneID()
|
| | |
| | | ownerName = curPlayer.GetPlayerName()
|
| | | giveItemList = __GetDemonKingPrizeItemList(curPlayer, mapID, funcLineID, eventID, isOwner)
|
| | | GameWorld.Log("玩家奖励: %s" % giveItemList, playerID)
|
| | | ChItem.DropItem(curPlayer, giveItemList, bossID, dropPosX, dropPosY, isOnlySelfSee=True, isDropDisperse=True)
|
| | | ChItem.DoMapDropItem(curPlayer, giveItemList, bossID, dropPosX, dropPosY, isOnlySelfSee=True, isDropDisperse=True)
|
| | | #curPlayer.Sync_TimeTick(ChConfig.tttPickupItem, 0, ChConfig.Def_FBPickupItemTime, True)
|
| | | if not isCrossServer:
|
| | | __SetDemonKingVisitState(curPlayer, mapID, funcLineID, PlayerFairyDomain.FDEventState_Visited)
|
| | |
| | | return giveItemList
|
| | |
|
| | | ## 给自定义副本奖励后续处理
|
| | | ## @return: 返回结算副本over信息字典,不含jsonItem信息
|
| | | def OnGiveCustomFBPrizeOK(curPlayer, mapID, lineID):
|
| | | __SetDemonKingVisitState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visited)
|
| | | return
|
| | | ownerID, ownerName = curPlayer.GetPlayerID(), curPlayer.GetPlayerName()
|
| | | overDict = {FBCommon.Over_ownerID:ownerID, FBCommon.Over_ownerName:ownerName}
|
| | | return overDict
|
| | |
|
| | | def __GetDemonKingPrizeItemList(curPlayer, mapID, lineID, eventID, isOwner):
|
| | | giveItemList = PlayerFairyDomain.GetFairyAppointAward(curPlayer, eventID)
|