| | |
| | | import ChEquip
|
| | | import PlayerActivity
|
| | | import PlayerSuccess
|
| | | import EventReport
|
| | | #import PlayerCostVIP
|
| | | import GameFuncComm
|
| | | import IpyGameDataPY
|
| | | import ShopItemManage
|
| | | import PlayerPet
|
| | | import PlayerArrestTask
|
| | | import PlayerMagicWeapon
|
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import PlayerWeekParty
|
| | | import PlayerActLogin
|
| | | import PlayerHorse
|
| | | import FBCommon
|
| | | import PyGameData
|
| | |
|
| | | import math
|
| | | import time
|
| | |
| | | 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)
|
| | |
| | | #特殊清空处理, 如果没有任务, state为0
|
| | | curValue = 0
|
| | | elif tagMission == None:
|
| | | GameWorld.Log("没有目标任务 %s" % conditionID , curPlayer.GetPlayerID())
|
| | | GameWorld.DebugLog("没有目标任务 %s" % conditionID , curPlayer.GetPlayerID())
|
| | | return
|
| | | else:
|
| | | curValue = QuestRunnerValue.GetValue(curPlayer, tagMission, conditionName)
|
| | |
| | | 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
|
| | |
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | for equipIndex in range(0, equipPack.GetCount()):
|
| | | #备用装备栏不处理
|
| | | if equipIndex not in ChConfig.Type_Equip_CanTake :
|
| | | if equipIndex not in ShareDefine.RoleEquipType:
|
| | | continue
|
| | | curEquip = equipPack.GetAt(equipIndex)
|
| | | if curEquip.IsEmpty():
|
| | |
| | | totalPlusLV = 0
|
| | | for packType, equipPartIndexList in ChConfig.Pack_EquipPart_CanPlusStar.items():
|
| | | for i in equipPartIndexList:
|
| | | partStarLV = ChEquip.GetEquipPartStarLV(curPlayer, packType, i)
|
| | | partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, i)
|
| | | totalPlusLV += partStarLV
|
| | |
|
| | |
|
| | |
| | | # equipPartIndexList = ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, [])
|
| | | # for i in equipPartIndexList:
|
| | | # #统计全身强化等级
|
| | | # partStarLV = ChEquip.GetEquipPartStarLV(curPlayer, IPY_GameWorld.rptEquip, i)
|
| | | # partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, i)
|
| | | # if partStarLV >= star:
|
| | | # partCnt +=1
|
| | | #GameWorld.Log('star=%s,conditionValue=%s,partCnt=%s,%s'%(star,conditionValue,partCnt,QuestRunnerValue.GetEval(conditionType, partCnt, conditionValue)))
|
| | |
| | | return False
|
| | | return petPack.GetCount() > 0
|
| | | return PlayerPet.GetPetDataItemByNPCID(curPlayer, checkPetID) != None
|
| | |
|
| | | def ConditionType_Is_Buy_Tehuiitem(curPlayer, curMission, curConditionNode):
|
| | | # 判断是否购买过特惠商店物品
|
| | | # <Is_Buy_Tehuiitem shopID="1007" itemShopIndex="0,1,2"/> shopID暂定需指定商店ID, itemShopIndex可指定多个索引, 中间英文逗号隔开
|
| | | shopID = GameWorld.ToIntDef(curConditionNode.GetAttribute("shopID"), 0)
|
| | | if not shopID:
|
| | | return False
|
| | | indexList = []
|
| | | indexInfo = curConditionNode.GetAttribute("itemShopIndex")
|
| | | if indexInfo != '':
|
| | | indexList = eval('[' + indexInfo + ']')
|
| | | if not indexList:
|
| | | shopItemList = ShopItemManage.GetShopItemList(shopID)
|
| | | indexList = range(len(shopItemList))
|
| | | if not indexList:
|
| | | GameWorld.DebugLog("需指定判断的特惠商店物品索引编号!indexInfo=%s" % indexInfo)
|
| | | return False
|
| | | for i in indexList:
|
| | | buyCnt = ShopItemManage.__GetPlayerShopItemBuyCnt(curPlayer, shopID, i)
|
| | | if buyCnt > 0:
|
| | | return True
|
| | | return False
|
| | |
|
| | | ##竞技场是否达到多少名
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curConditionNode 节点信息
|
| | | # @return 返回值, 是否判断成功
|
| | | # @remarks <Check_Jjcorder type="类型" value="值"/> |
| | | def ConditionType_Check_Jjcorder(curPlayer, curMission, curConditionNode):
|
| | | conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
|
| | | conditionType = curConditionNode.GetAttribute("type")
|
| | | maxOrder = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HighLadder_HistoryMaxOrder, 0,
|
| | | ChConfig.Def_PDictType_Default)
|
| | | |
| | | return QuestRunnerValue.GetEval(conditionType, maxOrder, conditionValue)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##执行 扣除玩家镖车押金
|
| | |
| | | # @param bind 绑定
|
| | | # @param packList 背包索引
|
| | | # @return 背包索引,-1表示没有可放的背包
|
| | | def GetCanPutInPackIndex(curPlayer, itemID, itemCount, bind, packList):
|
| | | def GetCanPutInPackIndex(curPlayer, itemID, itemCount, bind, packList, isAuctionItem=False):
|
| | | itemControl = ItemControler.PlayerItemControler(curPlayer)
|
| | | for index in packList:
|
| | | if not itemControl.CanPutInItem(index, itemID, itemCount, bind):
|
| | | if not itemControl.CanPutInItem(index, itemID, itemCount, isAuctionItem):
|
| | | continue
|
| | |
|
| | | return index
|
| | |
| | | itemStarLV=0, bind=False, property=None,
|
| | | 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
|
| | | equipIndex= -1, isGreat=0, baseAttrRate=ShareDefine.Def_MaxRateValue, greatAttrList=[], isAuctionItem=False):
|
| | | # if PlayerFamily.DoAddFamilyBossFoodEx(curPlayer, itemID, itemCount, ShareDefine.Def_AddFAVReason_DoFamilyMisson):
|
| | | # #仙盟兽粮自动使用
|
| | | # return
|
| | |
|
| | | #任务给予物品应该只能放入万能背包和背包
|
| | | itemControl = ItemControler.PlayerItemControler(curPlayer)
|
| | |
|
| | | #获得可放入的背包索引
|
| | | packIndex = GetCanPutInPackIndex(curPlayer, itemID, itemCount, bind, packList)
|
| | | packIndex = GetCanPutInPackIndex(curPlayer, itemID, itemCount, bind, packList, isAuctionItem)
|
| | | if packIndex == -1:
|
| | | return
|
| | |
|
| | | #设置物品属性
|
| | | curSingleItem = CreatMissionItem(itemID, itemStarLV, addAttrLV, isSuite, bind,
|
| | | isLucky, skillBoostEff, itemCount, holeCount, isGreat, baseAttrRate, greatAttrList)
|
| | | curSingleItem = CreatMissionItem(curPlayer, itemID, itemStarLV, addAttrLV, isSuite, bind,
|
| | | isLucky, skillBoostEff, itemCount, holeCount, isGreat, baseAttrRate, greatAttrList, isAuctionItem=isAuctionItem)
|
| | | if not curSingleItem:
|
| | | return
|
| | |
|
| | |
| | | if equipIndex == 0:
|
| | | GameWorld.ErrLog("任务赠送装备位置错误 equipIndex=-1")
|
| | | return
|
| | | |
| | | if ItemCommon.CheckHasEquip(curPlayer, IPY_GameWorld.rptEquip, equipIndex):
|
| | | equipPackIndex = ItemCommon.GetEquipPackIndex(curSingleItem)
|
| | | if ItemCommon.CheckHasEquip(curPlayer, IPY_GameWorld.rptEquip, equipPackIndex):
|
| | | #物品已存在直接给背包
|
| | | if not itemControl.PutInItem(IPY_GameWorld.rptItem, curSingleItem, event=["AddEventItem", False, {'MissionID':missionID}]):
|
| | | GameWorld.Log('###任务 = %s给予物品异常, %s, %s' % (missionID, itemID, itemCount), curPlayer.GetPlayerID())
|
| | | curSingleItem.Clear()
|
| | | return
|
| | | else:
|
| | | ChEquip.DoPlayerEquipItem(curPlayer, curSingleItem, equipIndex, 0)
|
| | | ChEquip.DoPlayerEquipItem(curPlayer, curSingleItem,equipPackIndex, 0)
|
| | |
|
| | | #ObtainRes01 <n>获得</n><Info Type="Item" Name="Name" ID="{%S1%}"/><n>×</n><n>{%S2%}!</n>
|
| | | elif not itemControl.PutInItem(packIndex, curSingleItem, event=["AddEventItem", False, {'MissionID':missionID}]):
|
| | |
| | | # @param itemCount: 物品数量
|
| | | # @param baseAttrRate: 任务创建的物品默认的基础属性随机值为10000
|
| | | # @return None
|
| | | def CreatMissionItem(itemID, starLV=0, addAttrLV=0, isSuite=False, bind=False,
|
| | | def CreatMissionItem(curPlayer, itemID, starLV=0, addAttrLV=0, isSuite=False, bind=False,
|
| | | isLucky=0, skillBoostEff=[], itemCount=1, holeCount=0,
|
| | | isGreat=0, baseAttrRate=ShareDefine.Def_MaxRateValue, greatAttrList=[]):
|
| | | isGreat=0, baseAttrRate=ShareDefine.Def_MaxRateValue, greatAttrList=[], isAuctionItem=False):
|
| | |
|
| | | curSingleItem = ItemControler.GetOutPutItemObj(itemID)
|
| | | curSingleItem = ItemControler.GetOutPutItemObj(itemID, itemCount, isAuctionItem, curPlayer=curPlayer)
|
| | |
|
| | | if not curSingleItem:
|
| | | GameWorld.Log('###创造任务物品失败, itemID = %s' % (itemID))
|
| | | return
|
| | |
|
| | | tmpEquipData = ItemControler.SingleEquipTmpData()
|
| | | tmpEquipData.starLV = starLV
|
| | | tmpEquipData.holeCnt = holeCount
|
| | | tmpEquipData.isSuite = isSuite
|
| | | tmpEquipData.isBind = bind
|
| | | #tmpEquipData = ItemControler.SingleEquipTmpData()
|
| | | #tmpEquipData.starLV = starLV
|
| | | #tmpEquipData.holeCnt = holeCount
|
| | | #tmpEquipData.isSuite = isSuite
|
| | | #tmpEquipData.isBind = bind
|
| | |
|
| | | ChItem.EquipAddAdditionEx(curSingleItem, tmpEquipData)
|
| | |
|
| | | #设置数量
|
| | | ItemControler.SetItemCount(curSingleItem, itemCount)
|
| | | #ChItem.EquipAddAdditionEx(curSingleItem, tmpEquipData)
|
| | |
|
| | | return curSingleItem
|
| | |
|
| | |
| | | # @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
|
| | |
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Add_Item id="物品ID" count="物品数量" starLV="星级" bind="是否绑定" |
| | | # @remarks <Add_Item id="物品ID" count="物品数量" starLV="星级" bind="是否绑定" isAuctionItem="是否拍品"
|
| | | # packtype="1,2背包索引" equipIndex="装备位置" suite="是否套装化" addAttrLV="追加等级",isLucky="是否有幸运"
|
| | | # skillBoostEff="[技能效果增强索引, 值]", holeCount="孔数" isGreat="1" baseAttrRate="可强化的装备基础属性随机加强比例默认10000"
|
| | | # greatAttr="[卓越属性列表]" />
|
| | |
| | | itemStarLV = GameWorld.ToIntDef(curActionNode.GetAttribute("starLV"), 0)
|
| | |
|
| | | #物品是否绑定
|
| | | bind = True if curActionNode.GetAttribute("bind") else False
|
| | | |
| | | bind = True if GameWorld.ToIntDef(curActionNode.GetAttribute("bind")) else False
|
| | |
|
| | | #物品是否套装化
|
| | | isSuite = True if curActionNode.GetAttribute("suite") else False
|
| | | |
| | | #是否拍品
|
| | | isAuctionItem = GameWorld.ToIntDef(curActionNode.GetAttribute("isAuctionItem"), 0)
|
| | |
|
| | | #追加
|
| | | addAttrLV = GameWorld.ToIntDef(curActionNode.GetAttribute("addAttrLV"), 0)
|
| | |
| | | baseAttrRate = GameWorld.ToIntDef(curActionNode.GetAttribute("baseAttrRate"), ShareDefine.Def_MaxRateValue)
|
| | | AddEventItem(curPlayer, curMission, curItemID, curItemCount, None, itemStarLV,
|
| | | bind, False, packTypeList, isSuite, addAttrLV, isLucky,
|
| | | skillBoostEff, holeCount, equipIndex, isGreat, baseAttrRate, greatAttrList)
|
| | | skillBoostEff, holeCount, equipIndex, isGreat, baseAttrRate, greatAttrList, isAuctionItem=isAuctionItem)
|
| | |
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Drop_Item id="物品ID" count="物品数量" starLV="星级" bind="是否绑定" |
| | | # @remarks <Drop_Item id="物品ID" count="物品数量" starLV="星级" bind="是否绑定" isAuctionItem="是否拍品"
|
| | | # suite="是否套装化" addAttrLV="追加等级",isLucky="是否有幸运"
|
| | | # skillBoostEff="[技能效果增强索引, 值]", holeCount="孔数", isGreat="1", effIndex="1" , dropDist="掉落范围默认3"
|
| | | # aroundPlayer="1" baseAttrRate="可强化的装备基础属性随机加强比例默认10000" greatAttr="[卓越属性列表]" />
|
| | |
| | | isSuite = GameWorld.ToIntDef((curActionNode.GetAttribute("suite")), 0)
|
| | |
|
| | | bind = GameWorld.ToIntDef((curActionNode.GetAttribute("bind")), 1)
|
| | | |
| | | isAuctionItem = GameWorld.ToIntDef((curActionNode.GetAttribute("isAuctionItem")), 0)
|
| | |
|
| | | #追加
|
| | | addAttrLV = GameWorld.ToIntDef(curActionNode.GetAttribute("addAttrLV"), 0)
|
| | |
| | | baseAttrRate = GameWorld.ToIntDef(curActionNode.GetAttribute("baseAttrRate"), ShareDefine.Def_MaxRateValue)
|
| | |
|
| | | #设置物品属性
|
| | | curItem = CreatMissionItem(curItemID, starLV, addAttrLV, isSuite, bind,
|
| | | isLucky, skillBoostEff, count, holeCount, isGreat, baseAttrRate, greatAttrList)
|
| | | curItem = CreatMissionItem(curPlayer, curItemID, starLV, addAttrLV, isSuite, bind,
|
| | | isLucky, skillBoostEff, count, holeCount, isGreat, baseAttrRate, greatAttrList, isAuctionItem=isAuctionItem)
|
| | |
|
| | | if not curItem:
|
| | | GameWorld.Log('###创建地上物品异常,无此ID物品 = %s' % (curItemID))
|
| | | return
|
| | |
|
| | | if curActionNode.GetAttribute("aroundPlayer") == "1":
|
| | | if curActionNode.GetAttribute("aroundPlayer") == "1" or not curNPC:
|
| | | posX, posY = curPlayer.GetPosX(), curPlayer.GetPosY()
|
| | | else:
|
| | | posX, posY = curNPC.GetPosX(), curNPC.GetPosY()
|
| | |
| | |
|
| | | 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_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:
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRunMission, addCnt)
|
| | | PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Task, addCnt)
|
| | | else:
|
| | | GameWorld.Log(' 跑环完成触发活跃度异常 missionType=%s'%missionType, curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | |
|
| | |
| | | randStarList = eval(ReadChConfig.GetChConfig('RunAround_Star'))
|
| | | aroundStar = GameWorld.GetResultByRandomList(randStarList, 1)
|
| | |
|
| | | #vipStar = PlayerCostVIP.GetRoundStar(curPlayer)
|
| | | vipStar = 0
|
| | | if vipStar > 0:
|
| | | aroundStar = vipStar
|
| | |
| | | # @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_Pluslvpartcnt key="" id="" classLV="" plusLV=""/>
|
| | | def DoType_Set_Pluslvpartcnt(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classLV"), 0)
|
| | | if not classLV:
|
| | | return
|
| | | 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
|
| | | |
| | | curMission.SetProperty(key, totalCnt)
|
| | | 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_调度器
|
| | |
| | | mwid = GameWorld.ToIntDef(curConditionNode.GetAttribute("mwid"), 0)
|
| | | conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
|
| | | return PlayerMagicWeapon.GetIsActiveMagicWeapon(curPlayer, mwid, conditionValue)
|
| | |
|
| | | ##判断魔族法宝通关关卡
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curConditionNode节点信息 |
| | | # @return 返回值, 是否通过检查
|
| | | # @remarks <Check_Magicweapon_Passfblv" mwid="法宝ID" value="期望值" /> |
| | | def ConditionType_Check_Magicweapon_Passfblv(curPlayer, curMission, curConditionNode):
|
| | | mwid = GameWorld.ToIntDef(curConditionNode.GetAttribute("mwid"), 0)
|
| | | conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
|
| | | fbpasslv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWFBPassLevel % mwid)
|
| | | return fbpasslv >= conditionValue
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##是否拥有足够的竞技点
|
| | |
| | | realmlv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return curPlayer.GetOfficialRank() >= realmlv
|
| | |
|
| | |
|
| | | ##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
|
| | |
|
| | |
|
| | |
|
| | | ##法宝激活个数
|
| | | # @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
|
| | |
|
| | | ##判断某阶强化等级达到X的件数是否达到
|
| | | # @param None
|
| | | # @return None <Classlvpluslv classLV="" plusLV="" value="cnt"/>
|
| | | def ConditionType_Classlvpluslv(curPlayer, curMission, curActionNode):
|
| | | classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classLV"), 0)
|
| | | if not classLV:
|
| | | return
|
| | | 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
|
| | | return totalCnt >= GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | |
|
| | | ##装备总星级
|
| | | # @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"/>
|
| | | def DoType_Active_Magicweapon(curPlayer, curMission, curActionNode):
|
| | | mwID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | PlayerMagicWeapon.DoActiveMW(curPlayer, mwID)
|
| | | PlayerMagicWeapon.NotifyMagicWeapon(curPlayer)
|
| | | |
| | | return
|
| | |
|
| | | ## 人物隐身 <Visible id="0隐身1现身"/>
|
| | |
| | | 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
|
| | |
|
| | |
|