| | |
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import Operate_EquipStone
|
| | | import OpenServerCampaign
|
| | | import PlayerWeekParty
|
| | | import PlayerFairyDomain
|
| | | import GameFuncComm
|
| | | import PlayerActLogin
|
| | | import PlayerHorse
|
| | | import FBCommon
|
| | |
| | | value = int(curActionNode.GetAttribute("value"))
|
| | | curPlayerFreePoint = curPlayer.GetFreePoint()
|
| | | curPlayer.SetFreePoint(curPlayerFreePoint + value)
|
| | | |
| | | # 更新开服活动灵根数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignLingGenData(curPlayer)
|
| | | DataRecordPack.DR_Freepoint(curPlayer, "Event", value, {"MissionID":curMission.GetMissionID()})
|
| | | return
|
| | |
|
| | |
| | | QuestCommon.SetPlayerMissionState(curPlayer, curMission, -1)
|
| | | curMission.SetDescriptionIndex(len(curMissionData.QuestDescriptionList) - 1)
|
| | | EventShell.NotifyOneMission(curPlayer, curMission, isNotifyAll=False)
|
| | | |
| | | # 完成任务事件 (配合前端,在通知任务状态后再触发)
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer, [missionID])
|
| | | #删除这个任务
|
| | | #第一个任务决定是否要触发OnEnter事件, 所以不能删除
|
| | | if missionID != 1 and diff_event == 0:
|
| | |
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_DailyRunMission, addCnt)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_TaskCRun, addCnt)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TaskCRun, addCnt)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_RunTask, addCnt)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RunTask, addCnt)
|
| | | PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RunTask, addCnt)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_RunTask, addCnt)
|
| | | PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_RunTask, 1)
|
| | | elif missionType == QuestCommon.Def_Mission_Type_RunFamily:
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_RunTask, addCnt)
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRunMission, addCnt)
|
| | | PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Task, addCnt)
|
| | | else:
|
| | |
| | | expPoint = curMission.GetProperty(Def_Run_Around_Reward_ExpPoint)
|
| | | exp = expPoint * ChConfig.Def_PerPointValue + exp
|
| | | money = curMission.GetProperty(Def_Run_Around_Reward_Money)
|
| | | |
| | | moneyDict = {}
|
| | | if exp != 0:
|
| | | playerControl.AddExp(exp)
|
| | | #PlayerControl.NotifyCode(curPlayer, 'GeRen_lhs_0', [exp])
|
| | | |
| | | addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Run"}
|
| | | PlayerControl.GiveMoney(curPlayer, runAroundReward.MoneyType, money, ChConfig.Def_GiveMoney_Mission, addDataDict, False)
|
| | | |
| | | if money:
|
| | | addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Run"}
|
| | | PlayerControl.GiveMoney(curPlayer, runAroundReward.MoneyType, money, ChConfig.Def_GiveMoney_Mission, addDataDict, False)
|
| | | moneyDict[runAroundReward.MoneyType] = money
|
| | | familyHornor = curMission.GetProperty(Def_Run_Around_Reward_FamilyHornor)
|
| | | if familyHornor:
|
| | | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, familyHornor, True, ShareDefine.Def_AddFAVReason_DoFamilyMisson, True)
|
| | |
|
| | | moneyDict[ShareDefine.TYPE_Price_Family_Contribution] = familyHornor
|
| | | item_id = curMission.GetProperty(Def_Day_Event_Reward_Item_Id)
|
| | | item_count = curMission.GetProperty(Def_Day_Event_Reward_Item_Count)
|
| | |
|
| | |
| | | GameWorld.DebugLog("任务:%d 获得经验:%d,钱=%s,物品ID=%s,物品数量=%s"
|
| | | % (curMission.GetMissionID(), exp, money, item_id, item_count))
|
| | |
|
| | | FBLogic.DoFB_OnFinishRunAroundTask(curPlayer, curMissionID, exp, {runAroundReward.MoneyType:money}, itemInfo)
|
| | | FBLogic.DoFB_OnFinishRunAroundTask(curPlayer, curMissionID, exp, moneyDict, itemInfo)
|
| | |
|
| | | #触发OSS记录
|
| | | if GameWorld.IsMissonDR(curPlayer):
|
| | |
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classLV"), 0)
|
| | | if not classLV:
|
| | | return
|
| | | equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
|
| | | classlVList = [classLV] if classLV else range(1, equipMaxClasslv+1)
|
| | |
|
| | | needPlusLV = GameWorld.ToIntDef(curActionNode.GetAttribute("plusLV"), 0)
|
| | | totalCnt = 0
|
| | | equipPlaceList = ChConfig.Pack_EquipPart_CanPlusStar[IPY_GameWorld.rptEquip]
|
| | | for equipPlace in equipPlaceList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, ipyData.GetGridIndex())
|
| | | if partStarLV >= needPlusLV:
|
| | | totalCnt += 1
|
| | | for classLV in classlVList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, ipyData.GetGridIndex())
|
| | | if partStarLV >= needPlusLV:
|
| | | totalCnt += 1
|
| | |
|
| | | curMission.SetProperty(key, totalCnt)
|
| | | return
|
| | |
| | | curQualityLV = funcDict[attrID](curPlayer)
|
| | | return curQualityLV >= qualityLV
|
| | |
|
| | |
|
| | | ##X条灵根品级达到X级
|
| | | # @param None
|
| | | # @return None <Linggenqualitylvcnt qualitylv="品级" value="条数"/>
|
| | | def ConditionType_Linggenqualitylvcnt(curPlayer, curMission, curActionNode):
|
| | | qualityLV = GameWorld.ToIntDef(curActionNode.GetAttribute("qualitylv"), 0)
|
| | | cnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return GetLinggenQualitylvCnt(curPlayer, qualityLV) >= cnt
|
| | |
|
| | | ##设置达到X品灵根数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Linggenqualitylvcnt key="" qualitylv="品级"/>
|
| | | def DoType_Set_Linggenqualitylvcnt(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | qualityLV = GameWorld.ToIntDef(curActionNode.GetAttribute("qualitylv"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, GetLinggenQualitylvCnt(curPlayer, qualityLV))
|
| | | return
|
| | |
|
| | | def GetLinggenQualitylvCnt(curPlayer, qualityLV):
|
| | | # 获取达到X品的灵根数量
|
| | | funcDict = {ShareDefine.Def_Effect_Metal: lambda curObj: PlayerControl.GetMetalQualityLV(curObj),
|
| | | ShareDefine.Def_Effect_Wood: lambda curObj: PlayerControl.GetWoodQualityLV(curObj),
|
| | | ShareDefine.Def_Effect_Water: lambda curObj: PlayerControl.GetWaterQualityLV(curObj),
|
| | | ShareDefine.Def_Effect_Fire: lambda curObj: PlayerControl.GetFireQualityLV(curObj),
|
| | | ShareDefine.Def_Effect_Earth: lambda curObj: PlayerControl.GetEarthQualityLV(curObj),
|
| | | }
|
| | | curCnt = 0
|
| | | for attrID, func in funcDict.items():
|
| | | if func(curPlayer) >= qualityLV:
|
| | | curCnt += 1
|
| | | return curCnt
|
| | |
|
| | |
|
| | | ##X级通关X层娲皇遗迹
|
| | | # @param None
|
| | | # @return None <Passqueenrelecs value="lineID" grade="grade"/>
|
| | |
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return PlayerMagicWeapon.GetMWActiveCntTotal(curPlayer) >= totalcnt
|
| | |
|
| | | ##总强化进化等级
|
| | | # @param None
|
| | | # @return None <Totalplusevolvelv value="cnt"/>
|
| | | def ConditionType_Totalplusevolvelv(curPlayer, curMission, curActionNode):
|
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return ChEquip.GetTotalPlusEvolveLV(curPlayer) >= totalcnt
|
| | | ##总强化等级
|
| | | # @param None
|
| | | # @return None <Totalpluslv value="cnt"/>
|
| | |
| | | # @return None <Classlvpluslv classLV="" plusLV="" value="cnt"/>
|
| | | def ConditionType_Classlvpluslv(curPlayer, curMission, curActionNode):
|
| | | classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classLV"), 0)
|
| | | if not classLV:
|
| | | return
|
| | | classLVList = [classLV] if classLV else xrange(1, IpyGameDataPY.GetFuncCfg('EquipMaxClasslv') + 1)
|
| | | needPlusLV = GameWorld.ToIntDef(curActionNode.GetAttribute("plusLV"), 0)
|
| | | totalCnt = 0
|
| | | equipPlaceList = ChConfig.Pack_EquipPart_CanPlusStar[IPY_GameWorld.rptEquip]
|
| | | for equipPlace in equipPlaceList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, ipyData.GetGridIndex())
|
| | | if partStarLV >= needPlusLV:
|
| | | totalCnt += 1
|
| | | for classLV in classLVList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, ipyData.GetGridIndex())
|
| | | if partStarLV >= needPlusLV:
|
| | | totalCnt += 1
|
| | | return totalCnt >= GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | |
|
| | | ##装备总星级
|
| | |
| | | def ConditionType_Equiptotalstone(curPlayer, curMission, curActionNode):
|
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return Operate_EquipStone.GetTotalStoneLV(curPlayer) >= totalcnt
|
| | |
|
| | | ##已镶嵌X等级宝石数量
|
| | | # @param None
|
| | | # @return None <Equipstonecnt value="cnt" stoneLV=""/>
|
| | | def ConditionType_Equipstonecnt(curPlayer, curMission, curActionNode):
|
| | | totalCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | stoneLV = GameWorld.ToIntDef(curActionNode.GetAttribute("stoneLV"), 0)
|
| | | return Operate_EquipStone.GetStoneCntByLV(curPlayer, stoneLV) >= totalCnt
|
| | |
|
| | | ##设置已镶嵌X等级宝石数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Equipstonecnt key="" stoneLV="宝石等级"/>
|
| | | def DoType_Set_Equipstonecnt(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | stoneLV = GameWorld.ToIntDef(curActionNode.GetAttribute("stoneLV"), 1)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, Operate_EquipStone.GetStoneCntByLV(curPlayer, stoneLV))
|
| | | return
|
| | |
|
| | | ##技能总等级
|
| | | # @param None
|
| | |
| | | def DoType_Visible(curPlayer, curMission, curActionNode):
|
| | | visible = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if visible:
|
| | | curPlayer.SetVisible(True)
|
| | | curPlayer.SetSight(ChConfig.Def_PlayerSight_Default)
|
| | | PlayerControl.SetPlayerSightLevel(curPlayer, 0)
|
| | | else:
|
| | | curPlayer.SetVisible(False)
|
| | | curPlayer.SetSight(0)
|
| | | PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | |
|
| | | def DoType_Setfairydomain(curPlayer, curMission, curActionNode):
|
| | | GameWorld.DebugLog("DoType_Setfairydomain", curPlayer.GetID())
|
| | | ## 任务开启缥缈仙域 (做标记可寻访) <Setfairydomain/>
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState):
|
| | | #若已在寻访中则先结束寻访
|
| | |
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 2)
|
| | | PlayerFairyDomain.NotifyVisitFairyDomainInfo(curPlayer)
|
| | | return |
| | | return
|
| | |
|
| | | ##神兵等级判断
|
| | | # @param None
|
| | | # @return None <Godweaponlv value="lv" weapontype=""/>
|
| | | def ConditionType_Godweaponlv(curPlayer, curMission, curActionNode):
|
| | | lv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | weapontype = GameWorld.ToIntDef(curActionNode.GetAttribute("weapontype"), 0)
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % weapontype) >= lv
|
| | |
|
| | | ##设置今日活跃度
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Dayactivity key=""/>
|
| | | def DoType_Set_Dayactivity(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Activity_TotalPoint, 0))
|
| | | return
|
| | |
|
| | | ##今日活跃度判断
|
| | | # @param None
|
| | | # @return None <Check_Dayactivity value="活跃度"/>
|
| | | def ConditionType_Check_Dayactivity(curPlayer, curMission, curActionNode):
|
| | | value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Activity_TotalPoint, 0) >= value
|
| | |
|
| | |
|
| | | ##设置历史活跃度
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Historyactivity key=""/>
|
| | | def DoType_Set_Historyactivity(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityHistoryPoint, 0))
|
| | | return
|
| | |
|
| | | ##历史活跃度判断
|
| | | # @param None
|
| | | # @return None <Check_Historyactivity value="活跃度"/>
|
| | | def ConditionType_Check_Historyactivity(curPlayer, curMission, curActionNode):
|
| | | value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityHistoryPoint, 0) >= value
|
| | |
|
| | | ##设置仙宝寻主领奖进度
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Xbxz key="" mwid="法宝ID"/>
|
| | | def DoType_Set_Xbxz(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | mwID = GameWorld.ToIntDef(curActionNode.GetAttribute("mwid"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, PlayerMagicWeapon.GetXBXZAwardProgress(curPlayer, mwID))
|
| | | return
|
| | |
|
| | | ##仙宝寻主进度判断
|
| | | # @param None
|
| | | # @return None <Check_Xbxz value="数量" mwid="法宝ID"/>
|
| | | def ConditionType_Check_Xbxz(curPlayer, curMission, curActionNode):
|
| | | value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | mwID = GameWorld.ToIntDef(curActionNode.GetAttribute("mwid"), 0)
|
| | | return PlayerMagicWeapon.GetXBXZAwardProgress(curPlayer, mwID) >= value
|
| | |
|
| | | ##商城表商品购买记录判断(只适用购买次数不重置的)
|
| | | # @param None
|
| | | # @return None <Check_Buyshopitem value="数量" index="商城表唯一ID"/>
|
| | | def ConditionType_Check_Buyshopitem(curPlayer, curMission, curActionNode):
|
| | | value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | itemIndex = GameWorld.ToIntDef(curActionNode.GetAttribute("index"), 0)
|
| | | curDayBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopItemDayBuyCnt % itemIndex)
|
| | | return curDayBuyCnt >= value |