From 2eb39c9fe42c1ee32500f81c4bf7d735c6116d9d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 30 七月 2019 00:26:20 +0800
Subject: [PATCH] 8180 【后端】【主干】优化打boss掉落套装体验
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 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 5b31ada..66b9ac2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -1079,7 +1079,10 @@
continue
if color in colorMaxDropCntDict:
colorDropCntDict[color] = dropCount + 1
- randItemID = random.choice(randEquipIDList)
+ if isSuit and len(jobList) > 1:
+ randItemID = __GetRandDropSuitEquipID(dropPlayer, randEquipIDList)
+ else:
+ randItemID = random.choice(randEquipIDList)
dropIDList.append(randItemID)
GameWorld.DebugLog("掉落装备: npcID=%s,itemID=%s,classLV=%s,color=%s,isSuit=%s,placeKey=%s,jobList=%s,randEquipIDList=%s"
% (npcID, randItemID, classLV, color, isSuit, placeKey, jobList, randEquipIDList), playerID)
@@ -1143,6 +1146,19 @@
GameWorld.ErrLog("Boss没有掉落物品,NPCID=%s" % (npcID), dropPlayer.GetPlayerID())
return dropIDList, auctionIDList, dropMoneyCnt, moneyValue
+def __GetRandDropSuitEquipID(curPlayer, randEquipIDList):
+ ## 获取随机掉落的套装ID,为了玩家掉落体验, 当非本职业套装时可至多重新随机X次
+ randItemID = 0
+ suitRandCountEx = IpyGameDataPY.GetFuncCfg("EquipSuitDrop", 1) + 1
+ for _ in xrange(suitRandCountEx):
+ randItemID = random.choice(randEquipIDList)
+ itemData = GameWorld.GetGameData().GetItemByTypeID(randItemID)
+ if not itemData:
+ continue
+ if ItemCommon.CheckJob(curPlayer, itemData):
+ break
+ return randItemID
+
def GetAllEquipPlaceByPlaceKey(placeKey):
placeKeyRateListDict = IpyGameDataPY.GetFuncEvalCfg("EquipDropPartSets", 2, {}) # {集合数字key1:[[概率1,部位1],...],...}
if placeKey in placeKeyRateListDict:
--
Gitblit v1.8.0