| | |
| | | import IpyGameDataPY
|
| | | import PlayerActivity
|
| | | import ItemControler
|
| | | import ItemCommon
|
| | | import PyGameData
|
| | | import EventShell
|
| | | import FBCommon
|
| | | import NPCCommon
|
| | |
|
| | | import copy
|
| | | import random
|
| | | import FBCommon
|
| | |
|
| | | #0-奇遇 1-宝藏 2-仙草 3-妖王 4-灵草
|
| | | (
|
| | |
| | |
|
| | |
|
| | | def EndFairyDomain(curPlayer):
|
| | | GameWorld.DebugLog("EndFairyDomain", curPlayer.GetID())
|
| | | ##结束寻访
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 0)
|
| | | otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
|
| | |
| | | eventID = ipyData.GetID()
|
| | | appearCntInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventAppearCnt % eventID)
|
| | | hourAppearCntPri, dayAppearCntPri = appearCntInfo % 1000, appearCntInfo / 1000
|
| | | if hourAppearCntPri >= ipyData.GetHourCntPriLimit() or dayAppearCntPri >= ipyData.GetDayCntPriLimit():
|
| | | #超过今日或本小时个人可出现次数上限
|
| | | hourCntPriLimit, dayCntPriLimit = ipyData.GetHourCntPriLimit(), ipyData.GetDayCntPriLimit()
|
| | | if hourCntPriLimit and hourAppearCntPri >= hourCntPriLimit:
|
| | | #超过本小时个人可出现次数上限
|
| | | continue
|
| | | if dayCntPriLimit and dayAppearCntPri >= dayCntPriLimit:
|
| | | #超过今日个人可出现次数上限
|
| | | continue
|
| | | if eventID in PyGameData.g_fairyDomainLimit:
|
| | | #超过全服可出现次数
|
| | |
| | | GameLogic_CrossGrassland.DoResetCrossGrassland(curPlayer, ipyData.GetEventType(), fdeventID)
|
| | |
|
| | | elif state == FDEventState_Visited:
|
| | | if curState != FDEventState_Visiting:
|
| | | GameWorld.Log('缥缈仙域事件状态设置错误,fdeventID=%s, state=%s, curState=%s' % (fdeventID, state, curState))
|
| | | return
|
| | | #设置结束,暂不做限制,防止异常导致无法结束
|
| | | # if curState != FDEventState_Visiting:
|
| | | # GameWorld.Log('缥缈仙域事件状态设置错误,fdeventID=%s, state=%s, curState=%s' % (fdeventID, state, curState))
|
| | | # return
|
| | | EventShell.EventRespons_FairyDomain(curPlayer)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdeventID, state)
|
| | | NotifyVisitFairyDomainInfo(curPlayer, [fdeventID], 0)
|
| | |
| | | if not gearAwardList:
|
| | | return
|
| | | itemRateList = gearAwardList[index] if index < len(gearAwardList) else gearAwardList[-1]
|
| | | itemRateList = ItemCommon.GetWeightItemListByAlchemyDiffLV(curPlayer, itemRateList, 1)
|
| | | giveItemList = [GameWorld.GetResultByWeightList(itemRateList)]
|
| | | else:
|
| | | giveItemList = [ipyData.GetBasicAward()]
|
| | |
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList)
|
| | | for itemInfo in giveItemList:
|
| | | NPCCommon.SendVirtualItemDrop(curPlayer, itemInfo[0], 0, 0, '')
|
| | | msgDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
|
| | | FBCommon.Notify_FB_Over(curPlayer, msgDict)
|
| | | GameWorld.DebugLog('缥缈奇遇领奖 msgDict=%s, fdeventID=%s' % (msgDict, fdeventID))
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomainAppoint', {'Cnt':visitCnt, 'EventID':fdEventID}, False, False)
|
| | | if not ipyData:
|
| | | return
|
| | | return ipyData.GetAward()
|
| | | job = curPlayer.GetJob()
|
| | | itemList = []
|
| | | for itemInfo in ipyData.GetAward():
|
| | | if type(itemInfo[0]) == dict:
|
| | | if job not in itemInfo[0]:
|
| | | continue
|
| | | itemList.append([itemInfo[0][job], itemInfo[1], itemInfo[2]])
|
| | | else:
|
| | | itemList.append(itemInfo)
|
| | | |
| | | for itemRateList in ipyData.GetRandomAward():
|
| | | itemRateList = ItemCommon.GetWeightItemListByAlchemyDiffLV(curPlayer, itemRateList, 1)
|
| | | giveItem = GameWorld.GetResultByWeightList(itemRateList)
|
| | | if not giveItem:
|
| | | continue
|
| | | itemList.append(giveItem)
|
| | | return itemList
|