92 【主界面】主线任务-服务端(修改官职、主线的副本过关任务改为过关主线任务; 完善官职、主线任务支持;)
| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import PlayerTask
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import PlayerControl
|
| | |
| | | clientPack.ObjID = objID
|
| | | clientPack.KillerObjID = killerObjID
|
| | | clientPack.SkillID = skillID
|
| | | turnFight.addBatPack(clientPack) |
| | | turnFight.addBatPack(clientPack)
|
| | | |
| | | curPlayer = turnFight.curPlayer
|
| | | # 暂时只算主线小怪
|
| | | if curPlayer and turnFight.mapID == ChConfig.Def_FBMapID_Main and gameObj.GetFaction() != ChConfig.Def_FactionA:
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_KillNPC, 1) |
| | | return True
|
| | |
|
| | | def OnTurnAllOver(guid):
|
| | |
| | |
|
| | | # 任务类型定义
|
| | | TaskTypeList = (
|
| | | TaskType_FBPass, # 副本过关到xxx 1
|
| | | TaskType_MainLevel, # 主线过关到xxx 1
|
| | | TaskType_TreeLV, # 仙树达到X级 2
|
| | | TaskType_EquipDecompose, # 分解装备x次 3
|
| | | TaskType_CutTree, # 消耗X个战锤 4
|
| | |
| | | TaskType_RealmLV, # 境界达到X级 6
|
| | | TaskType_KillNPC, # 击败X只怪物 7
|
| | | TaskType_GetMoney, # 累计获得xx货币 8
|
| | | ) = range(1, 1 + 8)
|
| | | TaskType_EquipColor, # 穿戴x件x品质及以上装备 9
|
| | | ) = range(1, 1 + 9)
|
| | |
|
| | | # 任务分组
|
| | | TaskGroupList = (
|
| | |
| | | import IPY_GameWorld
|
| | | import NetPackCommon
|
| | | import ItemCommon
|
| | | import PlayerTask
|
| | | import NPCCommon
|
| | | import ChEquip
|
| | | import ObjPool
|
| | |
| | |
|
| | | # 刷属性
|
| | | ChEquip.RefreshRoleEquipAttr(curPlayer)
|
| | | |
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_EquipColor)
|
| | | return
|
| | |
|
| | | def __doDecomposeMainEquip(curPlayer, itemIndexList):
|
| | |
| | |
|
| | | moneyTotal = 0
|
| | |
|
| | | decomposeCnt = 0
|
| | | decomposeIndexList = []
|
| | | for itemIndex in itemIndexList:
|
| | | if itemIndex < 0 or itemIndex >= IdentifyPack.GetCount():
|
| | |
| | |
|
| | | ItemCommon.DelItem(curPlayer, curEquip, curEquip.GetCount(), True, ChConfig.ItemDel_EquipDecompose)
|
| | | decomposeIndexList.append(itemIndex)
|
| | | decomposeCnt += 1
|
| | |
|
| | | if not moneyTotal:
|
| | | return
|
| | |
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyTotal, "DecomposeMainEquip", isSysHint=False)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_EquipDecompose, decomposeCnt)
|
| | | return
|
| | |
|
| | | def __doPickupMainItem(curPlayer, itemIndexList):
|
| | |
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntBooty % itemID, unXiantaoCntBooty + price)
|
| | |
|
| | | PlayerPrestigeSys.AddRealmTaskValue(curPlayer, PlayerPrestigeSys.RealmTaskType_UseXiantao, price)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_CutTree, price)
|
| | | |
| | | |
| | | unitPrice = price if quantity == 1 else int(math.ceil(price * 1.0 / quantity)) # 单价
|
| | | #reason_name = "Unknown" if not costType else costType
|
| | | reason_name = costType
|
| | |
| | | # @param wave: 第x波
|
| | | value = ComMainLevelValue(chapterID, levelNum, wave)
|
| | | SetMainLevelPassValue(curPlayer, value)
|
| | | if wave == 0:
|
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_MainLevel)
|
| | | return value
|
| | | def GetMainLevelPassInfo(curPlayer):
|
| | | ## 获取主线关卡过关进度信息
|
| | |
| | | import PlayerBillboard
|
| | | import PlayerTongTianLing
|
| | | import PlayerGubao
|
| | | import PlayerTask
|
| | |
|
| | | #------------------------------------------------------------------------------
|
| | |
|
| | | # 渡劫任务类型
|
| | | RealmTaskTypeList = (
|
| | | RealmTaskType_LV, # 等级 1
|
| | | RealmTaskType_PassMap, # 过关关卡 2
|
| | | RealmTaskType_MainLevel, # 主线关卡 2
|
| | | RealmTaskType_UseXiantao, # 消耗战锤 3
|
| | | RealmTaskType_TreeLV, # 仙树等级 4
|
| | | ) = range(1, 1 + 4)
|
| | |
| | | % (realmLV, taskID, taskType, playerLV, needValueA), playerID)
|
| | | return
|
| | |
|
| | | # 过关副本
|
| | | elif taskType == RealmTaskType_PassMap:
|
| | | mapID = needValueA
|
| | | lineID = GetRealmTaskNeedValue(needValueList, 1)
|
| | | # 主线关卡
|
| | | elif taskType == RealmTaskType_MainLevel:
|
| | | mapID = ChConfig.Def_FBMapID_Main
|
| | | lineID = needValueA
|
| | | if not FBCommon.IsFBPass(curPlayer, mapID, lineID):
|
| | | GameWorld.DebugLog('境界任务领奖,未过关! realmLV=%s,taskID=%s,taskType=%s,mapID=%s,lineID=%s'
|
| | | % (realmLV, taskID, taskType, mapID, lineID), playerID)
|
| | |
| | | #境界提升成就
|
| | | PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_RealmlvUp, nextRealmLv)
|
| | | PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_RealmUp, 1)
|
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_RealmLV)
|
| | | #更新排行榜
|
| | | PlayerBillboard.UpdateRealmBillboard(curPlayer)
|
| | | # 记录开服活动
|
| | |
| | | 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
|
| | |
|
| | | def UpdTaskValue(curPlayer, taskType):
|