| | |
| | | if hasGotAward:
|
| | | GameWorld.DebugLog('领取环任务每轮奖励 已奖励 类型 %s'%taskType)
|
| | | return
|
| | | runTaskAwardDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskAward')
|
| | | if taskType not in runTaskAwardDict:
|
| | | GameWorld.DebugLog('领取环任务每轮奖励 RunTaskAward 没有配置类型的奖励 类型 %s'%taskType)
|
| | | return
|
| | | moneyNum = 0
|
| | | specialAwardDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskAward', 2)
|
| | | if taskType in specialAwardDict:
|
| | | rate, moneyCnt = specialAwardDict[taskType]
|
| | | if GameWorld.CanHappen(rate):
|
| | | moneyNum = moneyCnt
|
| | | if taskType == QuestCommon.Def_Mission_Type_RunDaily:
|
| | | PlayerControl.WorldNotify(0, 'CoinTaskReward', [curPlayer.GetName()])
|
| | | moneyType, minMoney, maxMoney = runTaskAwardDict[taskType]
|
| | | if not moneyNum:
|
| | | moneyNum = random.randint(minMoney, maxMoney)
|
| | | if moneyType == ShareDefine.TYPE_Price_Family_Contribution:
|
| | | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, moneyNum, True, ShareDefine.Def_AddFAVReason_DoFamilyMisson)
|
| | | else:
|
| | | addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Run"}
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_GiveMoney_Mission, addDataDict, False)
|
| | | #物品奖励
|
| | | itemList = []
|
| | | itemAwardDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskAward', 3, {})
|
| | | if str(taskType) in itemAwardDict:
|
| | | itemList = itemAwardDict[str(taskType)]
|
| | | # 检查背包
|
| | | needSpace = len(itemList)
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
|
| | | if needSpace > packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | | for itemID, itemCount, isBind in itemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem])
|
| | |
|
| | | #给经验
|
| | | giveExp = 0
|
| | | expAwardDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskAward', 4, {})
|
| | | if str(taskType) in expAwardDict:
|
| | | reExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | giveExp = eval(expAwardDict[str(taskType)])
|
| | | PlayerControl.PlayerControl(curPlayer).AddExp(giveExp)
|
| | | |
| | | #给钱
|
| | | moneyType = 0
|
| | | moneyNum = 0
|
| | | runTaskMoneyAwardDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskAward')
|
| | | if taskType in runTaskMoneyAwardDict:
|
| | | specialAwardDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskAward', 2, {})
|
| | | if taskType in specialAwardDict:
|
| | | rate, moneyCnt = specialAwardDict[taskType]
|
| | | if GameWorld.CanHappen(rate):
|
| | | moneyNum = moneyCnt
|
| | | if taskType == QuestCommon.Def_Mission_Type_RunDaily:
|
| | | PlayerControl.WorldNotify(0, 'CoinTaskReward', [curPlayer.GetName()])
|
| | | moneyType, minMoney, maxMoney = runTaskMoneyAwardDict[taskType]
|
| | | if not moneyNum:
|
| | | moneyNum = random.randint(minMoney, maxMoney)
|
| | | if moneyType == ShareDefine.TYPE_Price_Family_Contribution:
|
| | | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, moneyNum, True, ShareDefine.Def_AddFAVReason_DoFamilyMisson)
|
| | | else:
|
| | | addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Run"}
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_GiveMoney_Mission, addDataDict, False)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RunTaskAwardRecord % taskType, moneyNum)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RunTaskAwardState % taskType, 1)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RunTaskAwardRecord % taskType, moneyNum)
|
| | | GameWorld.DebugLog('领取环任务每轮奖励成功 moneyType=%s, moneyNum=%s'%(moneyType, moneyNum))
|
| | | GameWorld.DebugLog('领取环任务每轮奖励成功 moneyType=%s, moneyNum=%s, itemList=%s, giveExp=%s'%(moneyType, moneyNum, itemList, giveExp))
|
| | |
|
| | | #通知客户端
|
| | | NotifyRunEndAward(curPlayer, taskType)
|