From c781de652a5b0a3356bdc2bbd6351411495d2a2f Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期五, 31 五月 2019 19:21:55 +0800
Subject: [PATCH] 6501 仙宝寻主任务接口

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py |   25 ++++++++++++++++++++++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py   |   13 ++++++++++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py           |    5 +++++
 3 files changed, 39 insertions(+), 4 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 223b063..ece3922 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -1991,6 +1991,11 @@
     RunQuestEvent(curPlayer, "usemissionitem", missionID, Def_RunQuestType_RunAll)
     return
 
+def EventRespons_XBXZ(curPlayer, MWID):
+    # 仙宝寻主领奖
+    RunQuestEvent(curPlayer, "xbxz", MWID, 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 967c13b..1dabaaf 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
@@ -7372,4 +7372,27 @@
 # @return None <Check_Historyactivity value="活跃度"/>
 def ConditionType_Check_Historyactivity(curPlayer, curMission, curActionNode):
     value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
-    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityHistoryPoint, 0) >= value
\ No newline at end of file
+    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityHistoryPoint, 0) >= value
+
+##设置仙宝寻主领奖进度
+# @param curPlayer 玩家实例
+# @param curMission 任务实例
+# @param curActionNode节点信息
+# @return 返回值无意义
+# @remarks <Set_Xbxz key="" mwid="法宝ID"/>
+def DoType_Set_Xbxz(curPlayer, curMission, curActionNode):
+    key = curActionNode.GetAttribute("key")
+    questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
+    mwID = GameWorld.ToIntDef(curActionNode.GetAttribute("mwid"), 0)
+    if questID != 0:
+        curMission = curPlayer.FindMission(questID)
+    curMission.SetProperty(key, PlayerMagicWeapon.GetXBXZAwardProgress(curPlayer, mwID))
+    return
+
+##仙宝寻主进度判断
+# @param None
+# @return None <Check_Xbxz value="数量" mwid="法宝ID"/>
+def ConditionType_Check_Xbxz(curPlayer, curMission, curActionNode):
+    value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
+    mwID = GameWorld.ToIntDef(curActionNode.GetAttribute("mwid"), 0)
+    return PlayerMagicWeapon.GetXBXZAwardProgress(curPlayer, mwID) >= value
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
index 734ea0d..55e0e60 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
@@ -332,9 +332,6 @@
         #扣消耗
         ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, ChConfig.ItemDel_MagicWeapon)
     elif ipyDataList:
-        ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('XBXZ', {'MWID':mwID}, True, False)
-        if not ipyDataList:
-            return
         for ipyData in ipyDataList:
             if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_XBXZAwardRecord, ipyData.GetID()):
                 return
@@ -346,6 +343,15 @@
     DoActiveMW(curPlayer, mwID)
     return
 
+def GetXBXZAwardProgress(curPlayer, mwID):
+    # 获取仙宝寻主进度
+    ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('XBXZ', {'MWID': mwID}, True, False)
+    cnt = 0
+    if ipyDataList:
+        for ipyData in ipyDataList:
+            if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_XBXZAwardRecord, ipyData.GetID()):
+                cnt += 1
+    return cnt
 #-------------------------------------------------------------------------------
 
 
@@ -408,6 +414,7 @@
     SyncXBXZAwardRecord(curPlayer, [index])
     #成就
     PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_XBXZ, 1, [ipyData.GetMWID()])
+    EventShell.EventRespons_XBXZ(curPlayer, ipyData.GetMWID())
     GameWorld.DebugLog('    仙宝寻主领奖OK, ID=%s, cnt=%s' % (index, cnt))
     return
 

--
Gitblit v1.8.0