From 818774d25af38005782d7d46914a229e725ea8c7 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 08 十一月 2019 16:50:54 +0800
Subject: [PATCH] 8333 【主干】【后端】boss之家死亡在复活点复活,不退出副本(死亡不退出副本,支持地图内复活,支持地图内传送到其他副本)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetNPCKillDrop.py |   45 +++++++++++++++++++++------------------------
 1 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetNPCKillDrop.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetNPCKillDrop.py
index b20f7ce..31dbf78 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetNPCKillDrop.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetNPCKillDrop.py
@@ -19,6 +19,7 @@
 import IpyGameDataPY
 import GameWorld
 import ChConfig
+import ShareDefine
 
 #---------------------------------------------------------------------
 #逻辑实现
@@ -30,7 +31,7 @@
 #  @remarks 函数详细说明.
 def OnExec(curPlayer, msgList):
     if not msgList:
-        GameWorld.DebugAnswer(curPlayer, "SetNPCKillDrop npcID 击杀次数")
+        GameWorld.DebugAnswer(curPlayer, "设置次数: SetNPCKillDrop npcID 击杀次数")
         GameWorld.DebugAnswer(curPlayer, "重置所有: SetNPCKillDrop 0")
         return
     
@@ -40,12 +41,21 @@
         for i in xrange(ipyDataMgr.GetNPCDropItemCount()):
             ipyData = ipyDataMgr.GetNPCDropItemByIndex(i)
             npcID = ipyData.GetNPCID()
-            if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NPCKillCountDrop % npcID) \
-                and not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NPCKillCount % npcID):
+            if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NPCKillCount % npcID):
                 continue
-            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCountDrop % npcID, 0)
             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCount % npcID, 0)
             resetNPCIDList.append(npcID)
+            
+        gw = GameWorld.GetGameWorld()
+        globalKillDropDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD", 2)
+        for npcID in globalKillDropDict.keys():
+            killedCount = gw.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_NPCKilledCount % npcID)
+            if not killedCount:
+                continue
+            msgInfo = str([npcID, 0])
+            GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "GlobalKillCount", msgInfo, len(msgInfo))
+            resetNPCIDList.append(npcID)
+            
         GameWorld.DebugAnswer(curPlayer, "重置OK: %s" % resetNPCIDList)
         return
     
@@ -54,27 +64,14 @@
     if not ipyData:
         GameWorld.DebugAnswer(curPlayer, "没有配置掉落:%s" % npcID)
         return
-    killCountDropInfo = ipyData.GetKillCountDrop()
-    if killCountDropInfo:
-        needKillCount = killCountDropInfo[0]
-        killCount = min(msgList[1], needKillCount - 1) if len(msgList) > 1 else (needKillCount - 1)
-        setValue = killCount * 10
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCountDrop % npcID, setValue)
-        GameWorld.DebugAnswer(curPlayer, "击杀掉落值(%s)=%s" % (npcID, setValue))
-        
-    killCountDropEquipEx = ipyData.GetKillCountDropEquipEx()
-    killCountDropEquipEx2 = ipyData.GetKillCountDropEquipEx2()
-    if killCountDropEquipEx or killCountDropEquipEx2:
-        if killCountDropEquipEx:
-            needKillCount = killCountDropEquipEx[0]
-        if killCountDropEquipEx2:
-            needKillCount = min(needKillCount, killCountDropEquipEx2[0])
-        killCount = min(msgList[1], needKillCount - 1) if len(msgList) > 1 else (needKillCount - 1)
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCount % npcID, killCount)
-        GameWorld.DebugAnswer(curPlayer, "击杀次数=%s" % (npcID, killCount))
-        
-    if not killCountDropInfo and not killCountDropEquipEx and not killCountDropEquipEx2:
+    
+    if not ipyData.GetKillCountDropPri() and not ipyData.GetKillCountDropEquipPub() and not ipyData.GetKillCountDropPub():
         GameWorld.DebugAnswer(curPlayer, "不需要设置击杀掉落次数信息!%s" % npcID)
+    else:
+        killCount = msgList[1] if len(msgList) > 1 else 0
+        setValue = killCount * 10000 + killCount * 100 + killCount
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCount % npcID, setValue)
+        GameWorld.DebugAnswer(curPlayer, "击杀掉落值(%s)=%s" % (npcID, killCount))
         
     return
 

--
Gitblit v1.8.0