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 +++++++++++++++++++++++---------
 1 files changed, 47 insertions(+), 19 deletions(-)

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

--
Gitblit v1.8.0