|  |  | 
 |  |  | import PlayerMagicWeapon
 | 
 |  |  | import PlayerBossReborn
 | 
 |  |  | import PlayerFairyCeremony
 | 
 |  |  | import PlayerWeekParty
 | 
 |  |  | import PlayerHorse
 | 
 |  |  | import FBCommon
 | 
 |  |  | import PyGameData
 | 
 |  |  | 
 |  |  | Def_Run_Around_Reward_Exp = "run_around_exp"              #跑环任务的奖励
 | 
 |  |  | Def_Run_Around_Reward_ExpPoint = "run_around_exp_point"     #跑环任务的奖励
 | 
 |  |  | Def_Run_Around_Reward_Money = "run_around_money"          #跑环任务的给钱
 | 
 |  |  | 
 | 
 |  |  | Def_Run_Around_Reward_FamilyHornor = "run_around_familyhornor"     #跑环任务的仙盟贡献奖励
 | 
 |  |  | Def_Run_Around_Reward_Multiple = "run_around_multiple"     #跑环任务的奖励翻倍数
 | 
 |  |  | 
 | 
 |  |  | Def_Task_Reward_Per = "reward_per"     #领取任务奖励倍数百分比; 150代表1.5倍
 | 
 |  |  | 
 |  |  | def __RunAnswerAction(curPlayer, curMission, answersNode):
 | 
 |  |  |     actionsNode = __FindAnswerActionNode(curPlayer, curMission, answersNode)
 | 
 |  |  |     if actionsNode == None or actionsNode.IsEmpty():
 | 
 |  |  |         GameWorld.Log('__RunAnswerAction找不到回答节点')
 | 
 |  |  |         GameWorld.DebugLog('__RunAnswerAction找不到回答节点--%s'%curMission.GetMissionID())
 | 
 |  |  |         return
 | 
 |  |  |     
 | 
 |  |  |     __DoAnswerActionNode(curPlayer, curMission, actionsNode)
 | 
 |  |  | 
 |  |  |     value = 1
 | 
 |  |  |     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)
 | 
 |  |  | 
 | 
 |  |  | ##判断是否穿戴某部位(非时效)
 | 
 |  |  | # @param curPlayer 玩家实例
 | 
 |  |  | # @param curMission 任务实例
 | 
 |  |  | # @param curConditionNode 节点信息
 | 
 |  |  | # @return 返回值, 是否判断成功
 | 
 |  |  | # @remarks <have_equip value="装备位"/>
 | 
 |  |  | def ConditionType_Have_Equip(curPlayer, curMission, curConditionNode):
 | 
 |  |  |     equipPlace = int(curConditionNode.GetAttribute("value"))
 | 
 |  |  |     roleEquipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
 | 
 |  |  |     curEquip = roleEquipPack.GetAt(equipPlace)
 | 
 |  |  |     if curEquip.IsEmpty():
 | 
 |  |  |         return False
 | 
 |  |  |     if curEquip.GetEndureReduceType():
 | 
 |  |  |         return False
 | 
 |  |  |     return True
 | 
 |  |  |      | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | ##增加家族相关值 
 | 
 |  |  | # @param curPlayer 玩家实例
 | 
 |  |  | 
 |  |  | # @param curMission 任务实例
 | 
 |  |  | # @param curConditionNode 节点信息
 | 
 |  |  | # @return 返回值, 是否判断成功
 | 
 |  |  | # @remarks  <Have_Money value="期望值" check="查找对话中的货币" moneytype="货币类型 1元宝2礼券3银两" type="__Eval+替换的名字"/>
 | 
 |  |  | # @remarks  <Have_Money value="期望值" check="查找对话中的货币" moneytype="货币类型 1元宝2礼券3银两" type="__Eval+替换的名字" maxItem="需要物品数量" itemID="20410"/>
 | 
 |  |  | def ConditionType_Have_Money(curPlayer, curMission, curConditionNode):
 | 
 |  |  |     #格式<have_money value="" type="" moneytype=""/>
 | 
 |  |  |     value = curConditionNode.GetAttribute("value")
 | 
 |  |  | 
 |  |  |         conditionValue = int(value)
 | 
 |  |  |     elif check != "":
 | 
 |  |  |         conditionValue = int(QuestRunnerValue.GetNPCTalkReplaceValue(curPlayer, curMission, check))
 | 
 |  |  |      | 
 |  |  |     maxItemCnt = GameWorld.ToIntDef(curConditionNode.GetAttribute("maxItem"), 0)
 | 
 |  |  |     itemID = GameWorld.ToIntDef(curConditionNode.GetAttribute("itemID"), 0)
 | 
 |  |  |     if maxItemCnt and itemID: #未收集的道具个数乘以单价
 | 
 |  |  |         haveCnt = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, itemID)
 | 
 |  |  |         conditionValue = max(0, maxItemCnt-haveCnt)*conditionValue
 | 
 |  |  |          | 
 |  |  |     conditionType = curConditionNode.GetAttribute("type")
 | 
 |  |  |     moneyType = int(curConditionNode.GetAttribute("moneytype"))
 | 
 |  |  |      | 
 |  |  |     #GameWorld.Log('    conditionValue=%s,maxItemCnt=%s,itemID=%s'%(conditionValue,maxItemCnt,itemID))
 | 
 |  |  |      | 
 |  |  |     goldValue = curPlayer.GetGold()
 | 
 |  |  |     goldPaperValue = curPlayer.GetGoldPaper()
 | 
 |  |  |     silverValue = PlayerControl.GetSilver(curPlayer)
 | 
 |  |  | 
 |  |  |         return QuestRunnerValue.GetEval(conditionType, goldPaperValue, conditionValue)
 | 
 |  |  |     elif moneyType == IPY_GameWorld.TYPE_Price_Silver_Money:
 | 
 |  |  |         return QuestRunnerValue.GetEval(conditionType, silverValue, conditionValue)
 | 
 |  |  |     elif moneyType == ShareDefine.TYPE_Price_Gold_Paper_Money:
 | 
 |  |  |         return QuestRunnerValue.GetEval(conditionType, goldValue + goldPaperValue, conditionValue)
 | 
 |  |  |     else:
 | 
 |  |  |         GameWorld.Log("任务 = %s , moneytype = %s填错拉" % (curMission.GetMissionID() , moneyType) , curPlayer.GetPlayerID())
 | 
 |  |  |         return
 | 
 |  |  | 
 |  |  |                  packList=[IPY_GameWorld.rptItem], isSuite=False,
 | 
 |  |  |                  addAttrLV=0, isLucky=False, skillBoostEff=[], holeCount=0,
 | 
 |  |  |                  equipIndex= -1, isGreat=0, baseAttrRate=ShareDefine.Def_MaxRateValue, greatAttrList=[]):
 | 
 |  |  |     if PlayerFamily.DoAddFamilyBossFoodEx(curPlayer, itemID, itemCount, ShareDefine.Def_AddFAVReason_DoFamilyMisson):
 | 
 |  |  |         #仙盟兽粮自动使用
 | 
 |  |  |         return
 | 
 |  |  | #    if PlayerFamily.DoAddFamilyBossFoodEx(curPlayer, itemID, itemCount, ShareDefine.Def_AddFAVReason_DoFamilyMisson):
 | 
 |  |  | #        #仙盟兽粮自动使用
 | 
 |  |  | #        return
 | 
 |  |  |         
 | 
 |  |  |     #任务给予物品应该只能放入万能背包和背包
 | 
 |  |  |     itemControl = ItemControler.PlayerItemControler(curPlayer)
 | 
 |  |  | 
 |  |  | # @param curMission 任务实例
 | 
 |  |  | # @param curActionNode节点信息
 | 
 |  |  | # @return 返回值无意义
 | 
 |  |  | # @remarks  <Del_Money form_value="是否取对话的值" value="form_value为空取" moneytype="1元宝2礼券3银两" />  | 
 |  |  | # @remarks  <Del_Money form_value="是否取对话的值" value="form_value为空取" moneytype="1元宝2礼券3银两" maxItem="需要物品数量" itemID="20410"/>  | 
 |  |  | def DoType_Del_Money(curPlayer, curMission, curActionNode):
 | 
 |  |  |     #扣钱
 | 
 |  |  |     #格式<del_money form_value = ""value="" moneytype=""/>
 | 
 |  |  | 
 |  |  |     else:
 | 
 |  |  |         value = int(curActionNode.GetAttribute("value"))    
 | 
 |  |  |     
 | 
 |  |  |     maxItemCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("maxItem"), 0)
 | 
 |  |  |     itemID = GameWorld.ToIntDef(curActionNode.GetAttribute("itemID"), 0)
 | 
 |  |  |     if maxItemCnt and itemID: #未收集的道具个数乘以单价
 | 
 |  |  |         haveCnt = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, itemID)
 | 
 |  |  |         value = max(0, maxItemCnt-haveCnt)*value
 | 
 |  |  |      | 
 |  |  |     moneytype = int(curActionNode.GetAttribute("moneytype"))
 | 
 |  |  |     
 | 
 |  |  |     if moneytype not in ChConfig.Def_MoneyType_All:
 | 
 |  |  |         GameWorld.Log("##异常moneytype = %s填错拉" % (moneytype))
 | 
 |  |  |         return
 | 
 |  |  | #    if moneytype not in ChConfig.Def_MoneyType_All:
 | 
 |  |  | #        GameWorld.Log("##异常moneytype = %s填错拉" % (moneytype))
 | 
 |  |  | #        return
 | 
 |  |  |     
 | 
 |  |  |     curMissionID = 0
 | 
 |  |  |     if curMission == None:
 | 
 |  |  |         curMissionID = 0
 | 
 |  |  |     else:
 | 
 |  |  |         curMissionID = curMission.GetMissionID()
 | 
 |  |  |          | 
 |  |  |     #付钱
 | 
 |  |  |     if not PlayerControl.PayMoney(curPlayer, moneytype, value, ChConfig.Def_Cost_MissionDel, {"MissionID":curMissionID}):
 | 
 |  |  |     costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, moneytype, value)
 | 
 |  |  |     if not costMoneyList:
 | 
 |  |  |         GameWorld.Log("##付费异常,玩家金钱不足,任务missionID = %s" % (curMissionID) , curPlayer.GetPlayerID())
 | 
 |  |  |         EventShell.DoExitEvent(curPlayer)
 | 
 |  |  |         return
 | 
 |  |  |     #付钱
 | 
 |  |  |     for moneyType, moneyNum in costMoneyList:
 | 
 |  |  |         if not PlayerControl.PayMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_Cost_MissionDel, {"MissionID":curMissionID}):
 | 
 |  |  |             GameWorld.Log("##付费异常,玩家金钱不足,任务missionID = %s" % (curMissionID) , curPlayer.GetPlayerID())
 | 
 |  |  |             EventShell.DoExitEvent(curPlayer)
 | 
 |  |  |             return
 | 
 |  |  |     
 | 
 |  |  |     GameWorld.Login_Interface_GoldRec(curPlayer , 0 , 0 , 'MissionID_%s_Cost' % (curMissionID), moneytype, value)
 | 
 |  |  |     return
 | 
 |  |  | 
 |  |  |     
 | 
 |  |  |     mission_1.SetProperty(Def_Around_AllCount, allCount)
 | 
 |  |  |     EventShell.EventRespons_RunTaskAllCnt(curPlayer, curMissionData.Type, allCount)
 | 
 |  |  |     GameWorld.DebugLog("删除任务allCount %s, RUNCOUNT=%s" % (allCount, RUNCOUNT))
 | 
 |  |  |     GameWorld.Log("删除任务allCount %s, RUNCOUNT=%s" % (allCount, RUNCOUNT))
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  |     if allCount < RUNCOUNT:
 | 
 |  |  | 
 |  |  | # @return 无
 | 
 |  |  | # @remarks 跑环任务结束处理,删除或者随机下一个
 | 
 |  |  | def __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode):
 | 
 |  |  |     GameWorld.Log("__RunAroundMission----%s"%missionID, curPlayer.GetID())
 | 
 |  |  |     #任务完成,触发随机跑环
 | 
 |  |  |     run_event = GameWorld.ToIntDef(curActionNode.GetAttribute("run_around"), 0)
 | 
 |  |  |     firstMissionID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
 | 
 |  |  | 
 |  |  |     
 | 
 |  |  |     
 | 
 |  |  |     #总跑环次数已满,不可再做
 | 
 |  |  |     if run_event == Def_Run_Around_Over_1 and allCount >= RUNCOUNT:
 | 
 |  |  |         return
 | 
 |  |  |     if run_event == Def_Run_Around_Over_1:
 | 
 |  |  |         if allCount >= RUNCOUNT or aroundCount >= AROUNDCOUNT:
 | 
 |  |  |             return
 | 
 |  |  |     
 | 
 |  |  |     nextMissionID = 0
 | 
 |  |  |     nextMission = None
 | 
 |  |  | 
 |  |  |         
 | 
 |  |  |         if curMissionData.Type == QuestCommon.Def_Mission_Type_RunFamily:
 | 
 |  |  |             PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TaskFRun, 1)
 | 
 |  |  |         if allCount < RUNCOUNT:
 | 
 |  |  |             nextMissionID = __OverRandRunAround(curPlayer, curMissionData)
 | 
 |  |  |             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RunTaskNextMissionID % curMissionData.Type, nextMissionID)
 | 
 |  |  | #        if allCount < RUNCOUNT:
 | 
 |  |  | #            nextMissionID = __OverRandRunAround(curPlayer, curMissionData)
 | 
 |  |  | #            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RunTaskNextMissionID % curMissionData.Type, nextMissionID)
 | 
 |  |  |         
 | 
 |  |  |                 
 | 
 |  |  |             
 | 
 |  |  | 
 |  |  | def OnAroundMissionFinish(curPlayer, missionType, addCnt=1):
 | 
 |  |  |     #跑环任务id列表
 | 
 |  |  |     # 活跃度
 | 
 |  |  |     GameWorld.Log('    跑环完成触发活跃度 missionType=%s'%missionType, curPlayer.GetPlayerID())
 | 
 |  |  |     if missionType == QuestCommon.Def_Mission_Type_RunDaily:
 | 
 |  |  |         PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_DailyRunMission, addCnt)
 | 
 |  |  |         PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TaskCRun, addCnt)
 | 
 |  |  |         PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_RunTask, addCnt)
 | 
 |  |  |         PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RunTask, addCnt)
 | 
 |  |  |         PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_RunTask, addCnt)
 | 
 |  |  |     elif missionType == QuestCommon.Def_Mission_Type_RunFamily:
 | 
 |  |  |         PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRunMission, addCnt)
 | 
 |  |  |         PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Task, addCnt)
 | 
 |  |  |     else:
 | 
 |  |  |         GameWorld.Log('    跑环完成触发活跃度异常 missionType=%s'%missionType, curPlayer.GetPlayerID())
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  | # @return 返回值无意义
 | 
 |  |  | # @remarks 设置跑环任务奖励 <set_run_around_reward multiple="指定倍数" id_name="任务ID存储key" /> 
 | 
 |  |  | def DoType_Set_Run_Around_Reward(curPlayer, curMission, curActionNode):
 | 
 |  |  |     curMissionID = curMission.GetMissionID()
 | 
 |  |  |     GameWorld.Log("DoType_Set_Run_Around_Reward---%s"%curMissionID, curPlayer.GetID())
 | 
 |  |  |     idNameStr = curActionNode.GetAttribute("id_name")
 | 
 |  |  |     if curMission and idNameStr != "":
 | 
 |  |  |         questID = GameWorld.ToIntDef(curMission.GetProperty(idNameStr), 0)
 | 
 |  |  | 
 |  |  |             if curMission == None:
 | 
 |  |  |                 curMission = QuestCommon.AddNewMission(curPlayer, questID)
 | 
 |  |  |             
 | 
 |  |  |     curMissionID = curMission.GetMissionID()
 | 
 |  |  |     curMissionData = FindQuestFunc(curMissionID)
 | 
 |  |  |     if not curMissionData:
 | 
 |  |  |         return
 | 
 |  |  |  
 | 
 |  |  |     rewardList = __GetRunAroundReward(curPlayer, curMission)
 | 
 |  |  |     if rewardList:
 | 
 |  |  |         curExp, curMoney, itemID, itemCount = rewardList
 | 
 |  |  |         curExp, curMoney, curFamilyHornor, itemID, itemCount = rewardList
 | 
 |  |  |     else:
 | 
 |  |  |         curExp, curMoney, itemID, itemCount = 0, 0, 0, 0
 | 
 |  |  |         curExp, curMoney, curFamilyHornor, itemID, itemCount = 0, 0, 0, 0
 | 
 |  |  |     
 | 
 |  |  |     curMission.SetProperty(Def_Run_Around_Reward_Exp, curExp % ChConfig.Def_PerPointValue)
 | 
 |  |  |     curMission.SetProperty(Def_Run_Around_Reward_ExpPoint, curExp / ChConfig.Def_PerPointValue)
 | 
 |  |  | 
 |  |  |     
 | 
 |  |  |     curMission.SetProperty(Def_Day_Event_Reward_Item_Id, itemID)
 | 
 |  |  |     curMission.SetProperty(Def_Day_Event_Reward_Item_Count, itemCount)
 | 
 |  |  |     curMission.SetProperty(Def_Run_Around_Reward_FamilyHornor, curFamilyHornor)
 | 
 |  |  |      | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |     curExp = eval(IpyGameDataPY.GetFuncCfg('RunTaskExp'))
 | 
 |  |  |     curExp += curLVRunAroundReward.AddExp
 | 
 |  |  |     curMoney = baseMoney
 | 
 |  |  |      | 
 |  |  |     curFamilyHornor = curLVRunAroundReward.PlayerFamilyHornor
 | 
 |  |  |     itemInfo = curLVRunAroundReward.Item
 | 
 |  |  |     if itemInfo:
 | 
 |  |  |         itemID, itemCount = eval(itemInfo)
 | 
 |  |  |     else:
 | 
 |  |  |         itemID, itemCount = 0, 0
 | 
 |  |  |    
 | 
 |  |  |     return (curExp, curMoney, itemID, itemCount)
 | 
 |  |  |     return (curExp, curMoney, curFamilyHornor, itemID, itemCount)
 | 
 |  |  |   
 | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | ##给予跑环奖励
 | 
 |  |  | 
 |  |  |     addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Run"}
 | 
 |  |  |     PlayerControl.GiveMoney(curPlayer, runAroundReward.MoneyType, money, ChConfig.Def_GiveMoney_Mission, addDataDict, False)
 | 
 |  |  |     
 | 
 |  |  |     familyHornor = curMission.GetProperty(Def_Run_Around_Reward_FamilyHornor)
 | 
 |  |  |     if familyHornor:  | 
 |  |  |         PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, familyHornor, True, ShareDefine.Def_AddFAVReason_DoFamilyMisson, True)
 | 
 |  |  | 
 | 
 |  |  |     item_id = curMission.GetProperty(Def_Day_Event_Reward_Item_Id)
 | 
 |  |  |     item_count = curMission.GetProperty(Def_Day_Event_Reward_Item_Count)
 | 
 |  |  |     
 | 
 |  |  |     #给物品奖励
 | 
 |  |  |     itemInfo = []
 | 
 |  |  |     if item_id and item_count:
 | 
 |  |  |         AddEventItem(curPlayer, curMission, item_id, item_count, bind=True)
 | 
 |  |  |         itemInfo = [[item_id, item_count, True]]
 | 
 |  |  |         packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1)
 | 
 |  |  |         if 1 > packSpace:
 | 
 |  |  |             PlayerControl.NotifyCode(curPlayer, "UnionTask_Reward")
 | 
 |  |  |             PlayerControl.SendMailByKey("UnionTaskReward", [curPlayer.GetID()], itemInfo)
 | 
 |  |  |         else:
 | 
 |  |  |             AddEventItem(curPlayer, curMission, item_id, item_count, bind=True)
 | 
 |  |  |          | 
 |  |  |     GameWorld.DebugLog("任务:%d  获得经验:%d,钱=%s,物品ID=%s,物品数量=%s" 
 | 
 |  |  |                        % (curMission.GetMissionID(), exp, money, item_id, item_count))
 | 
 |  |  |     
 | 
 |  |  | 
 |  |  |     #记录副本对应的任务ID
 | 
 |  |  |     if FBCommon.GetRecordMapID(mapID) in [ChConfig.Def_FBMapID_ClearDevil, ChConfig.Def_FBMapID_MagicWeapon]:
 | 
 |  |  |         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ReqFBMissionID, curMission.GetMissionID())
 | 
 |  |  |         missionID = curMission.GetMissionID()
 | 
 |  |  |         curMissionData = FindQuestFunc(missionID)
 | 
 |  |  |         if curMissionData:
 | 
 |  |  |             missionType = curMissionData.Type
 | 
 |  |  |             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ReqFBMissionType, missionType)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | 
 |  |  | def DoType_Set_Mwcnt(curPlayer, curMission, curActionNode):
 | 
 |  |  |     key = curActionNode.GetAttribute("key")
 | 
 |  |  |     curMission.SetProperty(key, PlayerMagicWeapon.GetMWActiveCntTotal(curPlayer))
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | ##设置坐骑总等级
 | 
 |  |  | # @param curPlayer 玩家实例
 | 
 |  |  | # @param curMission 任务实例
 | 
 |  |  | # @param curActionNode节点信息
 | 
 |  |  | # @return 返回值无意义
 | 
 |  |  | # @remarks <Set_Horsetotallv key="" />
 | 
 |  |  | def DoType_Set_Horsetotallv(curPlayer, curMission, curActionNode):
 | 
 |  |  |     key = curActionNode.GetAttribute("key")
 | 
 |  |  |     questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
 | 
 |  |  |     if questID != 0:
 | 
 |  |  |         curMission = curPlayer.FindMission(questID)
 | 
 |  |  |     curMission.SetProperty(key, PlayerHorse.GetHorseSumLV(curPlayer))
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | ##设置强化总等级
 | 
 |  |  | # @param curPlayer 玩家实例
 | 
 |  |  | # @param curMission 任务实例
 | 
 |  |  | # @param curActionNode节点信息
 | 
 |  |  | # @return 返回值无意义
 | 
 |  |  | # @remarks <Set_Totalpluslv key="" />
 | 
 |  |  | def DoType_Set_Totalpluslv(curPlayer, curMission, curActionNode):
 | 
 |  |  |     key = curActionNode.GetAttribute("key")
 | 
 |  |  |     questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
 | 
 |  |  |     if questID != 0:
 | 
 |  |  |         curMission = curPlayer.FindMission(questID)
 | 
 |  |  |     curMission.SetProperty(key, ChEquip.GetTotalPlusLV(curPlayer, False))
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | ##设置装备总星级
 | 
 |  |  | # @param curPlayer 玩家实例
 | 
 |  |  | # @param curMission 任务实例
 | 
 |  |  | # @param curActionNode节点信息
 | 
 |  |  | # @return 返回值无意义
 | 
 |  |  | # @remarks <Set_Equiptotalstar key="" />
 | 
 |  |  | def DoType_Set_Equiptotalstar(curPlayer, curMission, curActionNode):
 | 
 |  |  |     key = curActionNode.GetAttribute("key")
 | 
 |  |  |     questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
 | 
 |  |  |     if questID != 0:
 | 
 |  |  |         curMission = curPlayer.FindMission(questID)
 | 
 |  |  |     curMission.SetProperty(key, ChEquip.GetTotalEquipStars(curPlayer))
 | 
 |  |  |     return
 | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | ##DoType_调度器
 | 
 |  |  | 
 |  |  |     alchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
 | 
 |  |  |     return alchemyLV >= stoveLV
 | 
 |  |  | 
 | 
 |  |  | ##境界是否达到X级
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Realmlv value="Realmlv"/>
 | 
 |  |  | def ConditionType_Realmlv(curPlayer, curMission, curActionNode):
 | 
 |  |  |     realmlv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |     return curPlayer.GetOfficialRank() >= realmlv
 | 
 |  |  | 
 | 
 |  |  | ##法宝之魂是否激活
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Mwsoul value="id"/>
 | 
 |  |  | def ConditionType_Mwsoul(curPlayer, curMission, curActionNode):
 | 
 |  |  |     soulID = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |     return bool(PlayerMagicWeapon.GetIsActiveMWSoul(curPlayer, soulID))
 | 
 |  |  | 
 | 
 |  |  | ##X级通关X层娲皇遗迹
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Passqueenrelecs value="lineID" grade="grade"/>
 | 
 |  |  | def ConditionType_Passqueenrelecs(curPlayer, curMission, curActionNode):
 | 
 |  |  |     lineID = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |     grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [ChConfig.Def_FBMapID_QueenRelics])
 | 
 |  |  |     needGrade = GameWorld.ToIntDef(curActionNode.GetAttribute("grade"), 0)
 | 
 |  |  |     return grade >=needGrade
 | 
 |  |  | 
 | 
 |  |  | ##坐骑总等级
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Horsetotallv value="lv"/>
 | 
 |  |  | def ConditionType_Horsetotallv(curPlayer, curMission, curActionNode):
 | 
 |  |  |     totallv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |     return PlayerHorse.GetHorseSumLV(curPlayer) >= totallv
 | 
 |  |  | 
 | 
 |  |  | ##2阶强化防具套装件数
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Suitplus value="cnt"/>
 | 
 |  |  | def ConditionType_Suitplus(curPlayer, curMission, curActionNode):
 | 
 |  |  |     needCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |      | 
 |  |  |     equipSuitTypeDict = IpyGameDataPY.GetFuncEvalCfg('EquipSuitType')
 | 
 |  |  |     groupCnt = 0 #2阶强化防具套装件数
 | 
 |  |  |     for groupType, equipIndexList in equipSuitTypeDict.items():
 | 
 |  |  |         for i in equipIndexList:
 | 
 |  |  |             suiteInfo = ChEquip.GetSuiteInfoByPlace(curPlayer, i)
 | 
 |  |  |             for suiteType, lv in suiteInfo.items():
 | 
 |  |  |                 if lv >= 2 and int(groupType) == 1 and suiteType == 2:
 | 
 |  |  |                     groupCnt +=1
 | 
 |  |  |     return groupCnt >= needCnt
 | 
 |  |  | 
 | 
 |  |  | ##法宝激活个数
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Mwcnt value="cnt"/>
 | 
 |  |  | def ConditionType_Mwcnt(curPlayer, curMission, curActionNode):
 | 
 |  |  |     totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |     return PlayerMagicWeapon.GetMWActiveCntTotal(curPlayer) >= totalcnt
 | 
 |  |  | 
 | 
 |  |  | ##总强化等级
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Totalpluslv value="cnt"/>
 | 
 |  |  | def ConditionType_Totalpluslv(curPlayer, curMission, curActionNode):
 | 
 |  |  |     totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |     return ChEquip.GetTotalPlusLV(curPlayer, False) >= totalcnt
 | 
 |  |  | 
 | 
 |  |  | ##装备总星级
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Equiptotalstar value="cnt"/>
 | 
 |  |  | def ConditionType_Equiptotalstar(curPlayer, curMission, curActionNode):
 | 
 |  |  |     totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |     return ChEquip.GetTotalEquipStars(curPlayer) >= totalcnt
 | 
 |  |  | 
 | 
 |  |  | ##激活法宝,确认与成就逻辑后使用
 | 
 |  |  | # @param None
 | 
 |  |  | # @return None <Active_Magicweapon id="法宝ID"/>
 | 
 |  |  | 
 |  |  |     else:
 | 
 |  |  |         curPlayer.SetVisible(False)
 | 
 |  |  |         curPlayer.SetSight(0)
 | 
 |  |  |     return | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  | # 被动技能孔
 | 
 |  |  | def DoType_Open_Skill_Slots(curPlayer, curMission, curActionNode):
 | 
 |  |  |     # 开孔
 | 
 |  |  |     slotIndex = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
 | 
 |  |  |     mission_1 = QuestCommon.GetCommonMission(curPlayer)
 | 
 |  |  |     if not mission_1:
 | 
 |  |  |         return
 | 
 |  |  | 
 | 
 |  |  |     mission_1.SetProperty("OpenSkillSlots", pow(2, slotIndex)|mission_1.GetProperty("OpenSkillSlots"))
 | 
 |  |  |      | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | 
 |