From fd929faf55ab49f558ee2f7b5ef9adcba0de82c6 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 30 八月 2018 19:26:25 +0800
Subject: [PATCH] fix:3101 【后端】仙盟贡献物品效果

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 4ce8874..e5e9691 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -1205,6 +1205,48 @@
         msgInfo = str([itemID, updKilledCnt])
         GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "GlobalDropRate", msgInfo, len(msgInfo))
          
+    # 4. 指定全服击杀次数必掉,算额外掉落
+    globalKillDropDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD", 2) # {NPCID:{击杀次数:[是否本职业, [物品ID, ...], [随机物品ID, ...]]}, ...}
+    if npcID in globalKillDropDict:
+        killCountDropDict = globalKillDropDict[npcID]
+        updNPCKilledCount = min(gw.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_NPCKilledCount % npcID) + 1, ShareDefine.Def_UpperLimit_DWord)
+        GameWorld.DebugLog("更新全服击杀次数: %s" % updNPCKilledCount)
+        # 通知GameServer记录
+        msgInfo = str([npcID, updNPCKilledCount])
+        GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "GlobalKillCount", msgInfo, len(msgInfo))
+        if updNPCKilledCount in killCountDropDict:
+            isJobLimit, itemIDList, randItemIDList = killCountDropDict[updNPCKilledCount]
+            for itemID in itemIDList:
+                if isJobLimit:
+                    itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
+                    if not itemData:
+                        continue
+                    itemJob = itemData.GetJobLimit() / 100
+                    if itemJob and itemJob != curPlayer.GetJob():
+                        # 非本职业可用,不掉落
+                        GameWorld.DebugLog("全服击杀次数必掉,非本职业可用,不掉落! itemID=%s" % itemID)
+                        continue
+                dropItemIDList.append(itemID)
+                GameWorld.DebugLog("全服击杀次数必掉物品: itemID=%s" % itemID)
+            if randItemIDList:
+                if isJobLimit:
+                    randJobItemList = []
+                    for rItemID in randItemIDList:
+                        itemData = GameWorld.GetGameData().GetItemByTypeID(rItemID)
+                        if not itemData:
+                            continue
+                        itemJob = itemData.GetJobLimit() / 100
+                        if itemJob and itemJob != curPlayer.GetJob():
+                            # 非本职业可用,不掉落
+                            GameWorld.DebugLog("全服击杀次数必掉随机,非本职业可用,不掉落! rItemID=%s" % rItemID)
+                            continue
+                        randJobItemList.append(rItemID)
+                    randItemID = random.choice(randJobItemList)
+                else:
+                    randItemID = random.choice(randItemIDList)
+                dropItemIDList.append(randItemID)
+                GameWorld.DebugLog("全服击杀次数必掉随机物品: randItemID=%s" % randItemID)
+                
     return dropItemIDList
 
 def __GetEquipIDList(npcID, classLV, color, placeList, star, itemJobList, tagPlace=None):

--
Gitblit v1.8.0