From 868c939723928a1dc6ba1f0b89f501848b8db75a Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期五, 26 四月 2019 14:55:07 +0800
Subject: [PATCH] 6501 【后端】【2.0】仙盟任务(新增接口)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py |   19 +++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py           |   24 ++++++++++++++++++++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py           |    5 +++++
 3 files changed, 46 insertions(+), 2 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 788f9d4..9c40386 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -1907,6 +1907,11 @@
     #感应法宝
     RunQuestEvent(curPlayer, "thinkfabao", 'thinkfabao', Def_RunQuestType_Normal)
     return
+
+def EventRespons_ElementSkill(curPlayer):
+    #选择五行专精
+    RunQuestEvent(curPlayer, "elementskill", 'elementskill', 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 9334fd4..6638a45 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
@@ -7069,7 +7069,26 @@
     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 None
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 3511579..7f720e3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -46,6 +46,7 @@
 import FBCommon
 import IpyGameDataPY
 import PyGameData
+import EventShell
 #import EquipZhuXian
 #---------------------------------------------------------------------
 GameWorld.ImportAll("Script\\Skill\\" , "GameSkills")
@@ -2061,8 +2062,11 @@
         GameWorld.DebugLog('主技能未学习,无法选专精mainSkillID=%s'%mainSkillID)
         return
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, selectSkillID)
-    #原技能删除
-    skillManager.DeleteSkillBySkillTypeID(curElementSkillID)
+    if curElementSkillID:
+        #原技能删除
+        skillManager.DeleteSkillBySkillTypeID(curElementSkillID)
+    else:
+        EventShell.EventRespons_ElementSkill(curPlayer)
     #更新新技能
     RefreshElementSkill(curPlayer, selectSkillID)
     # 重刷被动技能
@@ -2137,6 +2141,22 @@
         PlayerControl.PlayerControl(curPlayer).RefreshAllSkill()
     return
 
+def GetElementSkillCnt(curPlayer):
+    ##获取已选择的专精技能数量
+    cnt = 0
+    skillManager = curPlayer.GetSkillManager()
+    for i in xrange(skillManager.GetSkillCount()):
+        hasSkill = skillManager.GetSkillByIndex(i)
+        hasSkillID = hasSkill.GetSkillID()
+        ipyData = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, False, False)
+        if not ipyData:
+            continue
+        curElementSkillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % hasSkillID)
+        if not curElementSkillID:
+            continue
+        cnt +=1
+    return cnt
+
 def __InitElementSkillInfo():
     #缓存技能专精信息{skillID:[attrID*10000+needValue,..]}
     if not PyGameData.g_elemntSkillDict:

--
Gitblit v1.8.0