| | |
| | | import PlayerControl
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import NPCCommon
|
| | | import ChConfig
|
| | | import ChItem
|
| | |
|
| | |
| | | PlayerFairyDomain.SetFairyDomainFBEventState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visiting)
|
| | | return
|
| | |
|
| | | ## 客户端发送刷新自定义副本奖励
|
| | | def OnRefreshCustomFBPrize(curPlayer, mapID, lineID):
|
| | | visitCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
|
| | | fakeImmortalCount = IpyGameDataPY.GetFuncCfg("FakeImmortalCount", 1)
|
| | | if visitCount > fakeImmortalCount:
|
| | | GameWorld.DebugLog("当前寻访次数不能获取自定义副本奖励!visitCount=%s" % visitCount)
|
| | | return []
|
| | | if not PlayerFairyDomain.SetFairyDomainFBEventState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visiting):
|
| | | GameWorld.DebugLog("寻访状态异常不能获取自定义副本奖励!")
|
| | | return []
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("FairyDomain", {"MapID":mapID, "LineID":lineID})
|
| | | ## 自定义场景副本击杀NPC
|
| | | def DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID):
|
| | | |
| | | bossID = curNPC.GetNPCID()
|
| | | funcLineID = lineID
|
| | | curBossID = GetCurFBLineBOSSID(lineID=funcLineID)
|
| | | curState = PlayerFairyDomain.GetFairyDomainFBEventState(curPlayer, mapID, lineID)
|
| | | GameWorld.DebugLog("自定义场景击杀NPC: mapID=%s,lineID=%s,bossID=%s,curBossID=%s,eventState=%s" |
| | | % (mapID, lineID, bossID, curBossID, curState))
|
| | | if bossID != curBossID:
|
| | | return
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("FairyDomain", {"MapID":mapID, "LineID":funcLineID})
|
| | | if not ipyData:
|
| | | return []
|
| | | return
|
| | | eventID = ipyData.GetID()
|
| | | eventFBType = ipyData.GetEventFBType()
|
| | | if eventFBType != PlayerFairyDomain.FDEventFBType_Client:
|
| | | GameWorld.DebugLog(" 非前端本,不能掉落!", playerID)
|
| | | return
|
| | | if curState != PlayerFairyDomain.FDEventState_Visiting:
|
| | | GameWorld.DebugLog(" 非寻访中,不能掉落!", playerID)
|
| | | return
|
| | | PlayerFairyDomain.SetFairyDomainFBEventState(curPlayer, mapID, funcLineID, PlayerFairyDomain.FDEventState_Visited)
|
| | | |
| | | isOwner = True
|
| | | giveItemList = __GetDemonKingPrizeItemList(curPlayer, mapID, lineID, eventID, isOwner)
|
| | | return giveItemList
|
| | |
|
| | | ## 给自定义副本奖励后续处理
|
| | | ## @return: 返回结算副本over信息字典,不含jsonItem信息
|
| | | def OnGiveCustomFBPrizeOK(curPlayer, mapID, lineID):
|
| | | PlayerFairyDomain.SetFairyDomainFBEventState(curPlayer, mapID, lineID, PlayerFairyDomain.FDEventState_Visited)
|
| | | ownerID, ownerName = curPlayer.GetPlayerID(), curPlayer.GetPlayerName()
|
| | | overDict = {FBCommon.Over_ownerID:ownerID, FBCommon.Over_ownerName:ownerName}
|
| | | return overDict
|
| | | giveItemList = __GetDemonKingPrizeItemList(curPlayer, mapID, funcLineID, eventID, isOwner)
|
| | | NPCCommon.DoGiveItemByVirtualDrop(curPlayer, giveItemList, bossID)
|
| | | |
| | | isPass = 1
|
| | | overDict = {FBCommon.Over_ownerID:playerID, FBCommon.Over_ownerName:curPlayer.GetPlayerName(), |
| | | FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
|
| | | FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
|
| | | return
|
| | |
|
| | | def __GetDemonKingPrizeItemList(curPlayer, mapID, lineID, eventID, isOwner):
|
| | | giveItemList = PlayerFairyDomain.GetFairyAppointAward(curPlayer, eventID)
|
| | |
| | | return giveItemList
|
| | |
|
| | | # 没有定制奖励则取常规奖励
|
| | | # {物品ID:[归属者获得个数饼图[[概率, 个数], ...], 非归属者获得个数饼图[[概率, 个数], ...], 是否拍品], ...}
|
| | | # [[归属者随机次数, 非归属随机次数, [[权重,[物品ID,个数,是否拍品]], ...]], ...]
|
| | | |
| | | giveItemList = []
|
| | | awardDict = FBCommon.GetFBLineReward(mapID, lineID)
|
| | | for itemID, itemInfo in awardDict.items():
|
| | | ownerCountRateList, notOwnerCountRateList, isAuctionItem = itemInfo
|
| | | awardList = FBCommon.GetFBLineReward(mapID, lineID)
|
| | | for awardInfo in awardList:
|
| | | ownerCount, otherCount, itemWeightList = awardInfo
|
| | | if isOwner:
|
| | | itemCount = GameWorld.GetResultByRandomList(ownerCountRateList)
|
| | | if not ownerCount:
|
| | | continue
|
| | | randCount = ownerCount
|
| | | else:
|
| | | itemCount = GameWorld.GetResultByRandomList(notOwnerCountRateList)
|
| | | if not itemCount:
|
| | | if not otherCount:
|
| | | continue
|
| | | randCount = otherCount
|
| | | realWeightList = ItemCommon.GetWeightItemListByAlchemyDiffLV(curPlayer, itemWeightList, 1)
|
| | | if not realWeightList:
|
| | | continue
|
| | | giveItemList.append([itemID, itemCount, isAuctionItem])
|
| | |
|
| | | for _ in xrange(randCount):
|
| | | itemInfo = GameWorld.GetResultByWeightList(realWeightList)
|
| | | itemID, itemCount, isAuctionItem = itemInfo
|
| | | giveItemList.append([itemID, itemCount, isAuctionItem])
|
| | | |
| | | return giveItemList
|
| | |
|
| | |
|