| | |
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerNewFairyCeremony
|
| | | import Operate_EquipStone
|
| | | import PlayerWeekParty
|
| | | import PlayerFairyDomain
|
| | | import PlayerActLogin
|
| | | import PlayerHorse
|
| | | import FBCommon
|
| | | import NPCCommon
|
| | |
|
| | | import math
|
| | | import time
|
| | |
| | | def DoType_Add_Player_Xp(curPlayer, curMission, curActionNode):
|
| | | #增加玩家相关值<Add_Player_XP value="玩家xp值"/>
|
| | |
|
| | | xpValue = curActionNode.GetAttribute("value")
|
| | | |
| | | if xpValue != "":
|
| | | #设置玩家xp值
|
| | | openLV, addXPValue, maxXPValue = ReadChConfig.GetEvalChConfig('PlayerXP')
|
| | | curXp = min(int(xpValue), maxXPValue)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, curXp)
|
| | | curPlayer.SetXP(curXp)
|
| | | |
| | | #===========================================================================
|
| | | # xpValue = curActionNode.GetAttribute("value")
|
| | | # |
| | | # if xpValue != "":
|
| | | # #设置玩家xp值
|
| | | # openLV, addXPValue, maxXPValue = ReadChConfig.GetEvalChConfig('PlayerXP')
|
| | | # curXp = min(int(xpValue), maxXPValue)
|
| | | # curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, curXp)
|
| | | # curPlayer.SetXP(curXp)
|
| | | # |
| | | #===========================================================================
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
|
| | | conditionType = curConditionNode.GetAttribute("type")
|
| | | maxPassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV) # 历史最大过关数
|
| | | return QuestRunnerValue.GetEval(conditionType, maxPassLV, conditionValue)
|
| | |
|
| | | ##通关诛仙塔第X层
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curConditionNode 节点信息
|
| | | # @return 返回值, 是否判断成功
|
| | | # @remarks <Check_Zhuxiantower type="类型" value="值"/> |
| | | def ConditionType_Check_Zhuxiantower(curPlayer, curMission, curConditionNode):
|
| | | conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
|
| | | conditionType = curConditionNode.GetAttribute("type")
|
| | | maxPassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ZhuXianTowerPassLV) # 历史最大过关数
|
| | | return QuestRunnerValue.GetEval(conditionType, maxPassLV, conditionValue)
|
| | |
|
| | | def ConditionType_Get_Player_Coin(curPlayer, curMission, curConditionNode):
|
| | |
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Drop_Item id="物品ID" count="物品数量" starLV="星级" bind="是否绑定" isAuctionItem="是否拍品"
|
| | | # suite="是否套装化" addAttrLV="追加等级",isLucky="是否有幸运"
|
| | | # suite="是否套装化" addAttrLV="追加等级",isLucky="是否有幸运" isFakeDrop="是否假掉落"
|
| | | # skillBoostEff="[技能效果增强索引, 值]", holeCount="孔数", isGreat="1", effIndex="1" , dropDist="掉落范围默认3"
|
| | | # aroundPlayer="1" baseAttrRate="可强化的装备基础属性随机加强比例默认10000" greatAttr="[卓越属性列表]" />
|
| | | def DoType_Drop_Item(curPlayer, curMission, curActionNode):
|
| | |
| | | if not curItem:
|
| | | GameWorld.Log('###创建地上物品异常,无此ID物品 = %s' % (curItemID))
|
| | | return
|
| | | |
| | | isFakeDrop = GameWorld.ToIntDef(curActionNode.GetAttribute("isFakeDrop"), 0)
|
| | | if isFakeDrop:#假掉落表现
|
| | | dropItemDataStr = ChItem.GetMapDropItemDataStr(curItem)
|
| | | #通知客户端
|
| | | NPCCommon.SendVirtualItemDrop(curPlayer, curItemID, 0, 0, dropItemDataStr)
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, [[curItemID, count, isAuctionItem]])
|
| | | curItem.Clear()
|
| | | return
|
| | | if curActionNode.GetAttribute("aroundPlayer") == "1" or not curNPC:
|
| | | posX, posY = curPlayer.GetPosX(), curPlayer.GetPosY()
|
| | | else:
|
| | |
| | | PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Task, addCnt)
|
| | | else:
|
| | | GameWorld.Log(' 跑环完成触发活跃度异常 missionType=%s'%missionType, curPlayer.GetPlayerID())
|
| | | return
|
| | | EventShell.EventRespons_AroundMission(curPlayer, missionType)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | totallv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return PlayerHorse.GetHorseSumLV(curPlayer) >= totallv
|
| | |
|
| | | ##已选择的专精技能数量是否达到
|
| | | # @param None
|
| | | # @return None <Elementskillcnt value="cnt"/>
|
| | | def ConditionType_Elementskillcnt(curPlayer, curMission, curActionNode):
|
| | | cnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return SkillShell.GetElementSkillCnt(curPlayer) >= cnt
|
| | |
|
| | | ##设置已选择的专精技能数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Elementskillcnt key="" />
|
| | | def DoType_Set_Elementskillcnt(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, SkillShell.GetElementSkillCnt(curPlayer))
|
| | | return
|
| | |
|
| | | ##设置符合条件的已穿基础装备数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Baseequipcnt key="" classlv="" color="" suite="[suiteID,..]"/>
|
| | | def DoType_Set_Baseequipcnt(curPlayer, curMission, curActionNode):
|
| | | classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classlv"), 0)
|
| | | color = GameWorld.ToIntDef(curActionNode.GetAttribute("color"), 0)
|
| | | suite = curActionNode.GetAttribute("suite")
|
| | | suiteIDList = eval(suite) if suite else []
|
| | |
|
| | | haveCnt = __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList)
|
| | | |
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, haveCnt)
|
| | | return
|
| | | def __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList):
|
| | | haveCnt = 0
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | for place in ChConfig.EquipPlace_Base:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, place)
|
| | | if not ipyData:
|
| | | break
|
| | | gridIndex = ipyData.GetGridIndex()
|
| | | curEquip = equipPack.GetAt(gridIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | continue
|
| | | if curEquip.GetItemColor() < color:
|
| | | continue
|
| | | if suiteIDList and curEquip.GetSuiteID() not in suiteIDList:
|
| | | continue
|
| | | haveCnt += 1
|
| | | return haveCnt
|
| | | |
| | | ##判断符合条件的已穿基础装备数量
|
| | | # @param None
|
| | | # @return None <Baseequipcnt cnt="cnt" classlv="" color="" suite="[suiteID,..]"/>
|
| | | def ConditionType_Baseequipcnt(curPlayer, curMission, curActionNode):
|
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("cnt"), 0)
|
| | | classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classlv"), 0)
|
| | | color = GameWorld.ToIntDef(curActionNode.GetAttribute("color"), 0)
|
| | | suite = curActionNode.GetAttribute("suite")
|
| | | suiteIDList = eval(suite) if suite else []
|
| | | haveCnt = __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList)
|
| | | return haveCnt >= 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
|
| | | return ChEquip.GetTotalEquipStars(curPlayer) >= totalcnt
|
| | |
|
| | | ##装备宝石总等级
|
| | | # @param None
|
| | | # @return None <Equiptotalstone value="cnt"/>
|
| | | def ConditionType_Equiptotalstone(curPlayer, curMission, curActionNode):
|
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return Operate_EquipStone.GetTotalStoneLV(curPlayer) >= totalcnt
|
| | |
|
| | | ##技能总等级
|
| | | # @param None
|
| | | # @return None <Totalskilllv value="" funcType=""/>
|
| | | def ConditionType_Totalskilllv(curPlayer, curMission, curActionNode):
|
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | funcType = GameWorld.ToIntDef(curActionNode.GetAttribute("funcType"), 0)
|
| | | return SkillShell.GetAllSkillLV(curPlayer, funcType) >= totalcnt
|
| | |
|
| | | ##激活法宝,确认与成就逻辑后使用
|
| | | # @param None
|