From 2aefdb232d9d635d82dc64516e66fd79b582c9bb Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期六, 25 五月 2019 11:31:17 +0800
Subject: [PATCH] 6501 增加宝石任务接口

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py |   23 ++++++++++++++++++++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py        |   23 +++++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py                  |    5 +++++
 3 files changed, 50 insertions(+), 1 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 a181458..bfe27db 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -1940,6 +1940,11 @@
     RunQuestEvent(curPlayer, "inlaystone", 'inlaystone', Def_RunQuestType_Normal)
     return
 
+def EventRespons_StoneChange(curPlayer):
+    # 宝石变更
+    RunQuestEvent(curPlayer, "stonechange", 'stonechange', Def_RunQuestType_Normal)
+    return
+
 def EventRespons_EquipItem(curPlayer):
     #穿脱装备
     RunQuestEvent(curPlayer, "equipitem", 'equipitem', Def_RunQuestType_Normal)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
index e34e150..fc67321 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
@@ -311,6 +311,26 @@
     ##宝石总等级
     return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalStoneLV)
 
+def GetStoneCntByLV(curPlayer, stoneLV):
+    ##指定等级的宝石数量
+    cnt = 0
+    holeIndexList = GetAllEquipPlaceHoleIndex()
+    maxHoleCount = len(holeIndexList)
+    equipIndexList = GetAllStoneEquipIndexList()
+    gameData = GameWorld.GetGameData()
+    for equipIndex in equipIndexList:
+        for holeIndex in xrange(maxHoleCount):
+            curGemID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)[0]
+            if curGemID == 0:
+                continue
+            curGem = gameData.GetItemByTypeID(curGemID)
+            if not curGem:
+                continue
+            gemLV = curGem.GetEffectByIndex(0).GetEffectValue(1)
+            if gemLV >= stoneLV:
+                cnt += 1
+    return cnt
+
 #// A3 06 宝石升级 #tagCMEquipStoneUpgrade
 #struct    tagCMEquipStoneUpgrade
 #{
@@ -477,7 +497,8 @@
         else:
             PlayerControl.SendMailByKey("GemToPlayer", [curPlayer.GetPlayerID()], [[stoneID, 1, stoneIsBind]])
             
-    DataRecordPack.DR_StoneItemChange(curPlayer, eventName, {'equipPackIndex':equipPackIndex,"holeIndex":holeIndex, "stoneID":stoneID, 'changeStoneID':changeStoneID})    
+    DataRecordPack.DR_StoneItemChange(curPlayer, eventName, {'equipPackIndex':equipPackIndex,"holeIndex":holeIndex, "stoneID":stoneID, 'changeStoneID':changeStoneID})
+    EventShell.EventRespons_StoneChange(curPlayer)
     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 bd95d5b..87965e4 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
@@ -7233,6 +7233,29 @@
     totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
     return Operate_EquipStone.GetTotalStoneLV(curPlayer) >= totalcnt
 
+##已镶嵌X等级宝石数量
+# @param None
+# @return None <Equiptotalstone value="cnt" stoneLV=""/>
+def ConditionType_Equipstonecnt(curPlayer, curMission, curActionNode):
+    totalCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
+    stoneLV = GameWorld.ToIntDef(curActionNode.GetAttribute("lv"), 0)
+    return Operate_EquipStone.GetStoneCntByLV(curPlayer, stoneLV) >= totalCnt
+
+##设置已镶嵌X等级宝石数量
+# @param curPlayer 玩家实例
+# @param curMission 任务实例
+# @param curActionNode节点信息
+# @return 返回值无意义
+# @remarks <Set_Equiptotalstone key="" stoneLV="[]"/>
+def DoType_Set_Equiptotalstone(curPlayer, curMission, curActionNode):
+    key = curActionNode.GetAttribute("key")
+    questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
+    stoneLV = GameWorld.ToIntDef(curActionNode.GetAttribute("lv"), 1)
+    if questID != 0:
+        curMission = curPlayer.FindMission(questID)
+    curMission.SetProperty(key, Operate_EquipStone.GetStoneCntByLV(curPlayer, stoneLV))
+    return
+
 ##技能总等级
 # @param None
 # @return None <Totalskilllv value="" funcType="" skilllv=""/>

--
Gitblit v1.8.0