From 02f8c83ffab335d63d18bdde30e61bd2233f1f87 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期四, 09 五月 2019 16:58:57 +0800 Subject: [PATCH] 6501 【后端】【2.0】仙盟任务(增加多个任务接口) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py | 66 +++++++++++++++------ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py | 33 ++++++----- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SkyTower.py | 6 - ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py | 7 +- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py | 9 +- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py | 11 +++ 6 files changed, 86 insertions(+), 46 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py index 44eefe3..52e704f 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py @@ -1911,9 +1911,9 @@ RunQuestEvent(curPlayer, "thinkfabao", 'thinkfabao', Def_RunQuestType_Normal) return -def EventRespons_ElementSkill(curPlayer): - #选择五行专精 - RunQuestEvent(curPlayer, "elementskill", 'elementskill', Def_RunQuestType_Normal) +def EventRespons_ElementSkill(curPlayer, mainSkillID, updSelectSkillLV): + #激活五行专精 主技能ID_激活等级.xml + RunQuestEvent(curPlayer, "elementskill", '%s_%s'%(mainSkillID, updSelectSkillLV), Def_RunQuestType_Normal) return def EventRespons_EquipStarUp(curPlayer): @@ -1931,9 +1931,10 @@ RunQuestEvent(curPlayer, "equipitem", 'equipitem', Def_RunQuestType_Normal) return -def EventRespons_SkillUp(curPlayer, FuncType): +def EventRespons_SkillUp(curPlayer, FuncType, skillLV): #升级技能 RunQuestEvent(curPlayer, "skillup", FuncType, Def_RunQuestType_Normal) + RunQuestEvent(curPlayer, "skillup", '%s_%s' % (FuncType, skillLV), Def_RunQuestType_Normal) return #--------------------------------------------------------------------- diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py index 8201199..8de16f7 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py @@ -7092,25 +7092,31 @@ totallv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0) return PlayerHorse.GetHorseSumLV(curPlayer) >= totallv -##已选择的专精技能数量是否达到 +##某主技能对应专精技能达到激活X等级的数量是否达到 # @param None -# @return None <Elementskillcnt value="cnt"/> +# @return None <Elementskillcnt value="cnt" mainskill="[]" activelv=""/> def ConditionType_Elementskillcnt(curPlayer, curMission, curActionNode): cnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0) - return SkillShell.GetElementSkillCnt(curPlayer) >= cnt + mainskill = curActionNode.GetAttribute("mainskill") + mainSkillIDList = eval(mainskill) if mainskill else [] + activeLV = GameWorld.ToIntDef(curActionNode.GetAttribute("activelv"), 1) + return SkillShell.GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV) >= cnt ##设置已选择的专精技能数量 # @param curPlayer 玩家实例 # @param curMission 任务实例 # @param curActionNode节点信息 # @return 返回值无意义 -# @remarks <Set_Elementskillcnt key="" /> +# @remarks <Set_Elementskillcnt key="" mainskill="[]" activelv=""/> def DoType_Set_Elementskillcnt(curPlayer, curMission, curActionNode): key = curActionNode.GetAttribute("key") questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0) + mainskill = curActionNode.GetAttribute("mainskill") + mainSkillIDList = eval(mainskill) if mainskill else [] + activeLV = GameWorld.ToIntDef(curActionNode.GetAttribute("activelv"), 1) if questID != 0: curMission = curPlayer.FindMission(questID) - curMission.SetProperty(key, SkillShell.GetElementSkillCnt(curPlayer)) + curMission.SetProperty(key, SkillShell.GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV)) return ##设置符合条件的已穿基础装备数量 @@ -7134,21 +7140,26 @@ curMission.SetProperty(key, haveCnt) return def __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList): + #classLV 为0代表任意阶 haveCnt = 0 + equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv') + classlVList = [classLV] if classLV else range(1, equipMaxClasslv+1) + 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 + for classlv in classlVList: + ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, place) + if not ipyData: + continue + 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 ##判断符合条件的已穿基础装备数量 @@ -7212,11 +7223,28 @@ ##技能总等级 # @param None -# @return None <Totalskilllv value="" funcType=""/> +# @return None <Totalskilllv value="" funcType="" skilllv=""/> 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 + skilllv = GameWorld.ToIntDef(curActionNode.GetAttribute("skilllv"), 0) + return SkillShell.GetSkillCntByFunc(curPlayer, funcType, skilllv) >= totalcnt + +##设置已达到X等级的技能数量 +# @param curPlayer 玩家实例 +# @param curMission 任务实例 +# @param curActionNode节点信息 +# @return 返回值无意义 +# @remarks <Set_Skillcnt key="" funcType="" skilllv=""/> +def DoType_Set_Skillcnt(curPlayer, curMission, curActionNode): + key = curActionNode.GetAttribute("key") + funcType = GameWorld.ToIntDef(curActionNode.GetAttribute("funcType"), 0) + skilllv = GameWorld.ToIntDef(curActionNode.GetAttribute("skilllv"), 0) + questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0) + if questID != 0: + curMission = curPlayer.FindMission(questID) + curMission.SetProperty(key, SkillShell.GetSkillCntByFunc(curPlayer, funcType, skilllv)) + return ##激活法宝,确认与成就逻辑后使用 # @param None diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SkyTower.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SkyTower.py index 8462085..c063bfe 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SkyTower.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SkyTower.py @@ -63,7 +63,7 @@ def GetTowerIpyData(floor): return IpyGameDataPY.GetIpyGameData('SkyTower', floor) -def OnFBPlayerLogin(curPlayer): +def OnFBPlayerOnLogin(curPlayer): SyncSkyTowerInfo(curPlayer) return @@ -73,7 +73,7 @@ def SyncSkyTowerInfo(curPlayer): ttInfo = ChPyNetSendPack.tagMCSkyTowerInfo() ttInfo.Clear() - ttInfo.floorID = __GetSkyTowerCurFloor(curPlayer) + ttInfo.Floor = __GetSkyTowerCurFloor(curPlayer) NetPackCommon.SendFakePack(curPlayer, ttInfo) return @@ -325,8 +325,6 @@ SyncSkyTowerInfo(curPlayer) # 同步最新关卡信息 __SetFBToFreeTime(tick) - #每日任务 - PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_Tower) return diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py index 2bcdc4d..496f886 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py @@ -449,4 +449,13 @@ ipyData = IpyGameDataPY.GetIpyGameDataByCondition('FairyDomainAppoint', {'Cnt':visitCnt, 'EventID':fdEventID}, False, False) if not ipyData: return - return ipyData.GetAward() + job = curPlayer.GetJob() + itemList = [] + for itemInfo in ipyData.GetAward(): + if type(itemInfo[0]) == dict: + if job not in itemInfo[0]: + continue + itemList.append([itemInfo[0][job], itemInfo[1], itemInfo[2]]) + else: + itemList.append(itemInfo) + return itemList diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py index b99a6f8..2af2986 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRefineStove.py @@ -192,7 +192,9 @@ notNotifyItemIDList = IpyGameDataPY.GetFuncEvalCfg("AlchemyNotify", 3) if alchemyItemID not in notNotifyItemIDList and (alchemyItemID in needNotifyItemIDList or makeItemData.GetItemColor() >= notifyColor): PlayerControl.WorldNotify(0, "AchemyGreatSuccess", [curPlayer.GetPlayerName(), alchemyItemID]) - + + #任务 + EventShell.EventRespons_RefineItem(curPlayer, alchemyIpyData.GetNeedAlchemyLV()) #重置 PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyItemID % alchemType, 0) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AlchemyStartTime % alchemyID, 0) @@ -207,8 +209,7 @@ PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_RefineItem, 1) #完成1次X品质物品炼丹成就 #PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_RefineStoveColor, 1, [makeItemData.GetItemColor()]) - #任务 - #EventShell.EventRespons_RefineItem(curPlayer, alchemyIpyData.GetNeedAlchemyLV()) + PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RefineStove, 1) PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RefineStove, 1) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py index 5478a20..de1bdf3 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py @@ -1866,7 +1866,7 @@ #获得技能等级 curSkillLV = curSkill.GetSkillLV() DataRecordPack.DR_LearnORUPSkill(curPlayer, curSkillID, curSkillLV) - EventShell.EventRespons_SkillUp(curPlayer, curSkill.GetFuncType()) + EventShell.EventRespons_SkillUp(curPlayer, curSkill.GetFuncType(), curSkillLV) GameWorld.Log("升级技能名 = %s 成功, 当前等级 = %s"%(curSkill.GetSkillName(), curSkill.GetSkillLV()), curPlayer.GetPlayerID()) return True @@ -2095,6 +2095,7 @@ isChangeSkill = False #是否变更生效的技能 if updSelectSkillLV != activeSkillLV: #可升级则激活升一级 + EventShell.EventRespons_ElementSkill(curPlayer, mainSkillID, updSelectSkillLV) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementLV % selectSkillID, updSelectSkillLV) if curElementSkillID == selectSkillID: #正在使用的专精技能,则立即生效 @@ -2113,8 +2114,7 @@ if curElementSkillID != selectSkillID: #原技能删除 skillManager.DeleteSkillBySkillTypeID(curElementSkillID) - else: - EventShell.EventRespons_ElementSkill(curPlayer) + # 重刷被动技能 PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer) @@ -2201,20 +2201,23 @@ NotifyElementSkillInfo(curPlayer) return -def GetElementSkillCnt(curPlayer): +def GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV): ##获取已选择的专精技能数量 cnt = 0 skillManager = curPlayer.GetSkillManager() for i in xrange(skillManager.GetSkillCount()): hasSkill = skillManager.GetSkillByIndex(i) hasSkillID = hasSkill.GetSkillTypeID() - ipyData = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, False, False) - if not ipyData: + if hasSkillID not in mainSkillIDList: continue - curElementSkillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % hasSkillID) - if not curElementSkillID: + ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, True, False) + if not ipyDataList: continue - cnt +=1 + for ipyData in ipyDataList: + elementSkillID = ipyData.GetElementSkillID() + curActiveLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementLV % elementSkillID) + if curActiveLV >= activeLV: + cnt += 1 return cnt def __InitElementSkillInfo(): @@ -3770,11 +3773,11 @@ -## 获取技能总等级 +## 获取某类型技能达到X等级的个数 # @param curPlayer # @return allSkillLV:总技能等级 -def GetAllSkillLV(curPlayer, funcType): - allSkillLV = 0 +def GetSkillCntByFunc(curPlayer, funcType, skilllv=0): + allSkillCnt = 0 skillManager = curPlayer.GetSkillManager() for i in xrange(skillManager.GetSkillCount()): curPlayerSkill = skillManager.GetSkillByIndex(i) @@ -3782,9 +3785,9 @@ continue if curPlayerSkill.GetFuncType() != funcType: continue - skillLV = curPlayerSkill.GetSkillLV() - allSkillLV += skillLV + if curPlayerSkill.GetSkillLV() >= skilllv: + allSkillCnt += 1 - return allSkillLV + return allSkillCnt -- Gitblit v1.8.0