| | |
| | | FDEventState_Visited, #已拜访3
|
| | | ) = range(4)
|
| | |
|
| | | #1-等级奇遇 2-境界奇遇 3-战力奇遇 4-气运奇遇
|
| | | AdventuresTypeList = (
|
| | | AdventuresType1,
|
| | | AdventuresType2,
|
| | | AdventuresType3,
|
| | | AdventuresType4,
|
| | | ) = range(1, 5)
|
| | |
|
| | |
|
| | | def OnLogin(curPlayer):
|
| | | NotifyVisitFairyDomainInfo(curPlayer)
|
| | |
| | |
|
| | | otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
|
| | | maxEventCnt = max([info[1] for info in otherCntRateList]) + 1 #最大可出现事件个数
|
| | | fairyDomainState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState) #是否寻访中 0未寻访 1寻访中 2任务标记可寻访
|
| | | fairyDomainState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState) #是否寻访中 0未寻访 1寻访中 2任务标记可寻访
|
| | | if clientData.Type == 1: #结束寻访
|
| | | if fairyDomainState != 1:
|
| | | GameWorld.DebugLog(" 未开始寻访仙域, 无法结束")
|
| | |
| | |
|
| | | #随机事件 重置事件状态
|
| | | visitCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainVisitCnt)
|
| | | appointIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog('FairyDomainAppoint', visitCnt+1)
|
| | | appointIpyDataList = IpyGameDataPY.GetIpyGameDataListNotLog('FairyDomainAppoint', visitCnt + 1)
|
| | | if appointIpyDataList:
|
| | | fdEventIDList = []
|
| | | for appointIpyData in appointIpyDataList:
|
| | |
| | | #奇遇事件 随机档位数据
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | for fdEventID in fdEventIDList:
|
| | | if fdEventID not in AdventuresTypeList:
|
| | | continue
|
| | | ipyData = IpyGameDataPY.InterpolationSearch('FairyAdventures', 'OpenServerDay', openServerDay, {'EventID':fdEventID})
|
| | | if not ipyData:
|
| | | #GameWorld.ErrLog('寻访仙域, 奇遇事件没有随机出对应档位 randomList=%s,openServerDay=%s' % (randomList, openServerDay))
|
| | |
| | | condition = random.choice(conditionList)
|
| | | index = conditionList.index(condition)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % fdEventID, ipyData.GetID() * 100 + index)
|
| | |
|
| | |
|
| | | if not fdEventIDList:
|
| | | GameWorld.Log('寻访仙域, 没有随机出事件!!')
|
| | |
| | | #丹炉等级不足
|
| | | continue
|
| | | lvLimit = ipyData.GetNeedLV()
|
| | | if lvLimit and not (lvLimit[0]<=curLV<=lvLimit[1]):
|
| | | if lvLimit and not (lvLimit[0] <= curLV <= lvLimit[1]):
|
| | | #等级范围不满足
|
| | | continue
|
| | |
|
| | |
| | | return
|
| | | EventShell.EventRespons_FairyDomain(curPlayer)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdeventID, state)
|
| | | NotifyVisitFairyDomainInfo(curPlayer, [fdeventID])
|
| | | NotifyVisitFairyDomainInfo(curPlayer, [fdeventID], 0)
|
| | | return True
|
| | |
|
| | |
|
| | | def NotifyVisitFairyDomainInfo(curPlayer, fdEventList=[]):
|
| | | isAll = 0
|
| | | def NotifyVisitFairyDomainInfo(curPlayer, fdEventList=[], isAll=1):
|
| | | if not fdEventList:
|
| | | isAll = 1
|
| | | otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
|
| | | maxEventCnt = max([info[1] for info in otherCntRateList]) + 1 #最大可出现事件个数
|
| | | for i in xrange(maxEventCnt):
|
| | |
| | | conditionList = ipyData.GetCondition()
|
| | | index = adventuresdata % 100
|
| | | if IpyGameDataPY.GetIpyGameDataByCondition('FairyDomainAppoint', {'Cnt':visitCnt, 'EventID':fdEventID}, False, False):
|
| | | condition = 0 #定制的条件为0
|
| | | condition = 0 #定制的条件为0
|
| | | else:
|
| | | condition = conditionList[index] if index < len(conditionList) else 0
|
| | | adventuresdata = ChPyNetSendPack.tagMCFairyAdventuresData()
|
| | |
| | | giveItemList = GetFairyAppointAward(curPlayer, fdeventID)
|
| | | if not giveItemList:
|
| | | #1-等级奇遇 2-境界奇遇 3-战力奇遇 4-气运奇遇
|
| | | if fdeventID == 1:
|
| | | if fdeventID == AdventuresType1:
|
| | | curData = curPlayer.GetLV()
|
| | | elif fdeventID == 2:
|
| | | elif fdeventID == AdventuresType2:
|
| | | curData = curPlayer.GetOfficialRank()
|
| | | elif fdeventID == 3:
|
| | | elif fdeventID == AdventuresType3:
|
| | | curData = curPlayer.GetFightPower()
|
| | | elif fdeventID == 4:
|
| | | elif fdeventID == AdventuresType4:
|
| | | curData = curPlayer.GetLuckValue()
|
| | | else:
|
| | | return
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomainAppoint', {'Cnt':visitCnt, 'EventID':fdEventID}, False, False)
|
| | | if not ipyData:
|
| | | return
|
| | | return ipyData.GetAward() |
| | | return ipyData.GetAward()
|