| | |
| | | if taskType == ChConfig.TaskType_LV:
|
| | | taskValue = curPlayer.GetLV()
|
| | |
|
| | | elif taskType == ChConfig.TaskType_FBPass:
|
| | | if len(conds) != 2:
|
| | | elif taskType == ChConfig.TaskType_MainLevel:
|
| | | if not conds:
|
| | | return 0
|
| | | mapID, lineID = conds
|
| | | mapID = ChConfig.Def_FBMapID_Main
|
| | | lineID = conds[0]
|
| | | taskValue = 1 if FBCommon.IsFBPass(curPlayer, mapID, lineID) else 0
|
| | |
|
| | | elif taskType == ChConfig.TaskType_TreeLV:
|
| | |
| | |
|
| | | elif taskType == ChConfig.TaskType_RealmLV:
|
| | | taskValue = curPlayer.GetOfficialRank()
|
| | | |
| | | elif taskType == ChConfig.TaskType_EquipColor:
|
| | | if not conds:
|
| | | return 0
|
| | | needColor = conds[0]
|
| | | equipCnt = 0
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | for equipPlace in ChConfig.Def_MainEquipPlaces:
|
| | | equipIndex = equipPlace - 1
|
| | | if equipIndex < 0 or equipIndex >= equipPack.GetCount():
|
| | | continue
|
| | | curEquip = equipPack.GetAt(equipIndex)
|
| | | if not curEquip or curEquip.IsEmpty():
|
| | | continue
|
| | | itemColor = curEquip.GetItemColor()
|
| | | if itemColor >= needColor:
|
| | | equipCnt += 1
|
| | | taskValue = equipCnt
|
| | |
|
| | | return taskValue
|
| | |
|
| | |
| | | if curState != ChConfig.TaskState_CanGet:
|
| | | GameWorld.DebugLog("任务未完成无法领奖: taskID=%s,curValue=%s/%s,curState=%s" % (taskID, curValue, needValue, curState), playerID)
|
| | | return
|
| | | if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList):
|
| | | return
|
| | | #if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList):
|
| | | # return
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskIDLast % taskGroup, taskID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskID % taskGroup, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskValue % taskGroup, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskState % taskGroup, 0)
|
| | |
|
| | | for itemID, itemCount, isAuctionItem in awardItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem])
|
| | | |
| | | ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["Task", False, {}])
|
| | | |
| | | if not __giveNewTask(curPlayer, taskGroup):
|
| | | SyncTaskInfo(curPlayer, [taskGroup])
|
| | |
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer, [taskID])
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | | return
|
| | |
|
| | | def SyncTaskInfo(curPlayer, taskGroupList=None):
|