6778 【后端】【2.0】任务接口开发(技能专精升级改为指定专精类型,判断专精技能个数及设置专精技能个数增加支持指定专精类型)
| | |
| | | RunQuestEvent(curPlayer, "thinkfabao", 'thinkfabao', Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_ElementSkill(curPlayer, mainSkillID, updSelectSkillLV):
|
| | | #激活五行专精 主技能ID_激活等级.xml
|
| | | RunQuestEvent(curPlayer, "elementskill", '%s_%s'%(mainSkillID, updSelectSkillLV), Def_RunQuestType_Normal)
|
| | | def EventRespons_ElementSkill(curPlayer, mainSkillID, skillElementType, updSelectSkillLV):
|
| | | #激活五行专精 主技能ID_专精类型_激活等级.xml
|
| | | RunQuestEvent(curPlayer, "elementskill", '%s_%s_%s'%(mainSkillID, skillElementType, updSelectSkillLV), Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_EquipStarUp(curPlayer):
|
| | |
| | |
|
| | | ##某主技能对应专精技能达到激活X等级的数量是否达到
|
| | | # @param None
|
| | | # @return None <Elementskillcnt value="cnt" mainskill="[]" activelv=""/>
|
| | | # @return None <Elementskillcnt value="cnt" mainskill="[]" activelv="" elementtype="专精类型"/>
|
| | | def ConditionType_Elementskillcnt(curPlayer, curMission, curActionNode):
|
| | | cnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | mainskill = curActionNode.GetAttribute("mainskill")
|
| | | mainSkillIDList = eval(mainskill) if mainskill else []
|
| | | activeLV = GameWorld.ToIntDef(curActionNode.GetAttribute("activelv"), 1)
|
| | | return SkillShell.GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV) >= cnt
|
| | | elementType = GameWorld.ToIntDef(curActionNode.GetAttribute("elementtype"), 0)
|
| | | return SkillShell.GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV, elementType) >= cnt
|
| | |
|
| | | ##设置已选择的专精技能数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Elementskillcnt key="" mainskill="[]" activelv=""/>
|
| | | # @remarks <Set_Elementskillcnt key="" mainskill="[]" activelv="" elementtype="专精类型"/>
|
| | | def DoType_Set_Elementskillcnt(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | |
| | | activeLV = GameWorld.ToIntDef(curActionNode.GetAttribute("activelv"), 1)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, SkillShell.GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV))
|
| | | elementType = GameWorld.ToIntDef(curActionNode.GetAttribute("elementtype"), 0)
|
| | | curMission.SetProperty(key, SkillShell.GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV, elementType))
|
| | | return
|
| | |
|
| | | ##设置符合条件的已穿基础装备数量
|
| | |
| | |
|
| | | ## 获取技能升级属性需求 rutrun attrID, attrvalue
|
| | | def GetSkillUpNeedAttr(stateSkillLV):return stateSkillLV /100000, stateSkillLV%100000
|
| | | ## 获取技能专精类型
|
| | | def GetSkillElementType(curSkill): return curSkill.GetStateSkillLV() /100000
|
| | |
|
| | | #// A5 16 选择技能五行专精 #tagCMSelectSkillElement
|
| | | #
|
| | |
| | | if nextSkill:
|
| | | if CheckLearnSkillNeedAttr(curPlayer, nextSkill):
|
| | | updSelectSkillLV = activeSkillLV + 1
|
| | | skillElementType = GetSkillElementType(nextSkill)
|
| | | isChangeSkill = False #是否变更生效的技能
|
| | | if updSelectSkillLV != activeSkillLV:
|
| | | #可升级则激活升一级
|
| | | EventShell.EventRespons_ElementSkill(curPlayer, mainSkillID, updSelectSkillLV)
|
| | | EventShell.EventRespons_ElementSkill(curPlayer, mainSkillID, skillElementType, updSelectSkillLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementLV % selectSkillID, updSelectSkillLV)
|
| | | if curElementSkillID == selectSkillID:
|
| | | #正在使用的专精技能,则立即生效
|
| | |
| | | NotifyElementSkillInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV):
|
| | | def GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV, elementType=0):
|
| | | ##获取已选择的专精技能数量
|
| | | # @param elementType: 专精类型,对应灵根ID
|
| | | gameData = GameWorld.GetGameData()
|
| | | cnt = 0
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | |
| | | continue
|
| | | for ipyData in ipyDataList:
|
| | | elementSkillID = ipyData.GetElementSkillID()
|
| | | if elementType:
|
| | | elementSkillData = gameData.GetSkillBySkillID(elementSkillID)
|
| | | if GetSkillElementType(elementSkillData) != elementType:
|
| | | continue
|
| | | curActiveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementLV % elementSkillID)
|
| | | if curActiveLV >= activeLV:
|
| | | cnt += 1
|