92 【主界面】主线任务-服务端(增加任务类型11~19;优化任务类型10创角后挑战过就算;)
| | |
| | | Def_PDict_UnXiantaoCntBooty = "UnXiantaoCntBooty_%s" # 累计未结算战利品掉落的战锤数,参数(itemID)
|
| | | Def_PDict_BootyDropToday = "BootyDropToday_%s" # 今日已累计掉落战利品数量,参数(itemID)
|
| | | Def_PDict_AppointDropEquipCnt = "AppointDropEquipCnt" # 定制掉落装备掉落第x次,只记录到配置的最高次数
|
| | | Def_PDict_ChallengeLVID = "ChallengeLVID" # 最后一次挑战的关卡ID,无论胜负
|
| | |
|
| | | #天子考验
|
| | | Def_PDict_TianziHisHurt = "TianziHisHurt_%s" # 历史最高伤害,求余亿部分,参数(bossID)
|
| | |
| | | TaskType_GetMoney, # 累计获得xx货币 8
|
| | | TaskType_EquipColor, # 穿戴x件x品质及以上装备 9
|
| | | TaskType_MainLevelChallenge, # 主线挑战xxx 10
|
| | | ) = range(1, 1 + 10)
|
| | | TaskType_ArenaBattle, # 演武场战斗x次 11
|
| | | TaskType_HorseLVUP, # 坐骑升级x次 12
|
| | | TaskType_FBZhanchui, # 白骨盈野击败xx 13
|
| | | TaskType_HeroLVUP, # 武将升级X次 14
|
| | | TaskType_HeroStarUP, # 武将升星x次 15
|
| | | TaskType_GoldRush, # 淘金采集x次 16
|
| | | TaskType_GoldRushWorkers, # 拥有x名监工 17
|
| | | TaskType_ReqOrJoinFamily, # 创建或者申请加入公会 18
|
| | | TaskType_FBTianzi, # 挑战天子的考验x次 19
|
| | | ) = range(1, 1 + 19)
|
| | |
|
| | | # 任务分组
|
| | | TaskGroupList = (
|
| | |
| | | PlayerTask.__giveNewTask(curPlayer, taskGroup)
|
| | | return
|
| | |
|
| | | taskValue = paramList[1] if len(paramList) > 1 else 0
|
| | | taskValue = paramList[1] if len(paramList) > 1 else None
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Task", taskID)
|
| | | if not ipyData:
|
| | | GameWorld.DebugAnswer(curPlayer, "该任务ID不存在:%s" % taskID)
|
| | | return
|
| | | taskGroup = ipyData.GetTaskGroup()
|
| | | taskType = ipyData.GetTaskType()
|
| | | needValue = ipyData.GetNeedValue()
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskID % taskGroup, taskID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskValue % taskGroup, taskValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskState % taskGroup, ChConfig.TaskState_Doing)
|
| | | PlayerTask.SetTaskValue(curPlayer, ipyData, taskValue)
|
| | | |
| | | if taskValue == None:
|
| | | PlayerTask.UpdTaskValue(curPlayer, taskType)
|
| | | else:
|
| | | PlayerTask.SetTaskValue(curPlayer, ipyData, taskValue)
|
| | | |
| | | curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskValue % taskGroup)
|
| | | GameWorld.DebugAnswer(curPlayer, "设置任务ID:%s 进度:%s/%s" % (taskID, curValue, needValue))
|
| | | return
|
| | |
| | | import PlayerArena
|
| | | import PlayerGubao
|
| | | import PyGameData
|
| | | import PlayerTask
|
| | | import FBCommon
|
| | | import ChConfig
|
| | |
|
| | |
| | | if not PlayerControl.HaveMoney(curPlayer, ShareDefine.TYPE_Price_ArenaTicket, 1):
|
| | | return
|
| | |
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_ArenaBattle)
|
| | | |
| | | return True, funcLineID
|
| | |
|
| | | def GetFBPlayerLineupID(curPlayer, mapID, funcLineID):
|
| | |
| | | GameWorld.DebugLog("最后一波未通过,无法挑战本关boss! passWave=%s < %s" % (wave, waveMax))
|
| | | return
|
| | |
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_MainLevelChallenge, 1, [levelID])
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ChallengeLVID, levelID)
|
| | | |
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_MainLevelChallenge)
|
| | |
|
| | | return True, levelID
|
| | |
|
| | |
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import PlayerTask
|
| | | import PlayerMail
|
| | | import DBDataMgr
|
| | | import TurnSkill
|
| | |
| | | GameWorld.DebugLog("非今日天子考验! mapID=%s,funcLineID=%s != %s,bossID=%s" % (mapID, funcLineID, lineID, bossID))
|
| | | return
|
| | |
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_FBTianzi)
|
| | | return True, funcLineID
|
| | |
|
| | | def GetFBNPCInitAttr(curPlayer, turnFight, npcObj):
|
| | |
| | | import ItemControler
|
| | | import PlayerBeauty
|
| | | import FBCommon
|
| | | import PlayerTask
|
| | | import ChConfig
|
| | |
|
| | | def OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList):
|
| | | ## 回合战斗请求
|
| | |
| | | FBCommon.AddEnterFBCount(curPlayer, mapID, isFree=True)
|
| | | FBCommon.SetFBPass(curPlayer, mapID, funcLineID)
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Zhanchui", False, {}], isNotifyAward=False)
|
| | | |
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_FBZhanchui)
|
| | | return
|
| | |
|
| | | def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, dataEx):
|
| | |
| | | import IPY_GameWorld
|
| | | import ItemControler
|
| | | import GameFuncComm
|
| | | import PlayerTask
|
| | | import DBDataMgr
|
| | | import DirtyList
|
| | | import ObjPool
|
| | |
| | | familyMgr.DelPlayerReqJoinFamilyIDAll(curPlayer.GetPlayerID())
|
| | | Sync_RequestAddFamilyInfo(curPlayer)
|
| | | PlayerFamilyTaofa.OnPlayerEnterFamily(curPlayer)
|
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_ReqOrJoinFamily)
|
| | | return
|
| | |
|
| | | def __OnLeaveFamily(curPlayer, isVoluntarily, tick):
|
| | |
| | |
|
| | | # 申请加入
|
| | | if requestType == 0:
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_ReqOrJoinFamily, 1)
|
| | | if not tagFamilyID:
|
| | | AutoJoinFamily(curPlayer)
|
| | | else:
|
| | |
| | | import GameFuncComm
|
| | | import PlayerGubao
|
| | | import ShareDefine
|
| | | import PlayerTask
|
| | | import ObjPool
|
| | |
|
| | | import time
|
| | |
| | | campInfo = SetCampInfo(curPlayer, campID, refreshCnt, goldID, updWorkerCnt)
|
| | | GameWorld.DebugLog(" updWorkerCnt=%s,realNeedSeconds=%s,endTime=%s,campInfo=%s"
|
| | | % (updWorkerCnt, realNeedSeconds, GameWorld.ChangeTimeNumToStr(endTime), campInfo))
|
| | | |
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_GoldRush, 1)
|
| | | return
|
| | |
|
| | | def GetWorkerTotal(curPlayer):
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GoldRushWorkerState, workerState)
|
| | | GameWorld.DebugLog("解锁淘金监工: workerID=%s,workerState=%s" % (workerID, workerState))
|
| | | SyncGoldRushInfo(curPlayer)
|
| | | |
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_GoldRushWorkers)
|
| | | return
|
| | |
|
| | | #// B0 38 淘金仓库领奖 #tagCSGoldRushWarehouseAward
|
| | |
| | | import NetPackCommon
|
| | | import PlayerControl
|
| | | import PlayerOnline
|
| | | import PlayerTask
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | |
| | | PlayerOnline.GetOnlinePlayer(curPlayer).OnHeroItemUpate([itemIndex])
|
| | |
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_HeroLVUP, 1)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_HeroLVUP)
|
| | | return
|
| | |
|
| | | def GetHeroLVMax(heroItem):
|
| | |
| | | if addStar > 0:
|
| | | __DoHeroStarTalentUp(item, addStar)
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_HeroStarUP, addStar)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_HeroStarUP, addStar)
|
| | | |
| | | if isSync:
|
| | | heroItem.Sync_Item()
|
| | |
|
| | |
| | | import IpyGameDataPY
|
| | | import GameFuncComm
|
| | | import PlayerOnline
|
| | | import PlayerTask
|
| | | import GameWorld
|
| | | import ObjPool
|
| | |
|
| | |
| | | # 有升级额外处理
|
| | | if updHorseLV > horseLV:
|
| | | RefreshHorseAttr(curPlayer)
|
| | | |
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_HorseLVUP, costItemCount)
|
| | | return
|
| | |
|
| | | #// B2 02 坐骑进阶 #tagCSHorseClassUP
|
| | |
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import NetPackCommon
|
| | | import PlayerGoldRush
|
| | | import ChPyNetSendPack
|
| | | import ItemControler
|
| | | import IPY_GameWorld
|
| | |
| | | lineID = conds[0]
|
| | | taskValue = 1 if FBCommon.IsFBPass(curPlayer, mapID, lineID) else 0
|
| | |
|
| | | # 挑战主线关
|
| | | elif taskType == ChConfig.TaskType_MainLevelChallenge:
|
| | | if not conds:
|
| | | return 0
|
| | | mapID = ChConfig.Def_FBMapID_Main
|
| | | lvID = conds[0]
|
| | | taskValue = 1 if PlayerControl.IsMainLevelPass(curPlayer, lvID) else 0
|
| | | if not taskValue:
|
| | | challengeLVID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ChallengeLVID)
|
| | | taskValue = 1 if challengeLVID >= lvID else 0
|
| | | |
| | | elif taskType == ChConfig.TaskType_FBZhanchui:
|
| | | if not conds:
|
| | | return 0
|
| | | mapID = ChConfig.Def_FBMapID_Zhanchui
|
| | | lineID = conds[0]
|
| | | taskValue = 1 if FBCommon.IsFBPass(curPlayer, mapID, lineID) else 0
|
| | | |
| | | elif taskType == ChConfig.TaskType_GoldRushWorkers:
|
| | | taskValue = PlayerGoldRush.GetWorkerTotal(curPlayer)
|
| | | |
| | | elif taskType == ChConfig.TaskType_ReqOrJoinFamily:
|
| | | taskValue = 1 if curPlayer.GetFamilyID() else 0
|
| | | |
| | | elif taskType == ChConfig.TaskType_TreeLV:
|
| | | taskValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreeLV)
|
| | |
|
| | |
| | | return
|
| | | if conds[0] != taskConds[0]:
|
| | | return
|
| | | |
| | | # 挑战主线关
|
| | | elif taskType == ChConfig.TaskType_MainLevelChallenge:
|
| | | taskConds = ipyData.GetTaskConds()
|
| | | if not conds or len(conds) != len(taskConds):
|
| | | return
|
| | | if conds[0] < taskConds[0]:
|
| | | #GameWorld.DebugLog("挑战小于的不算完成: %s < TaskCond:%s" % (conds[0], taskConds[0]))
|
| | | return
|
| | | #GameWorld.DebugLog("挑战大于等于都算完整: %s >= TaskCond:%s" % (conds[0], taskConds[0]))
|
| | |
|
| | | return True
|
| | |
|