From 11e82d25c1aa5b91706689d0414fdc893ed52627 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 13 四月 2019 11:11:38 +0800
Subject: [PATCH] 6459 【后端】【2.0】缥缈仙域开发单(妖王初版)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
index e2e458c..d6ece9a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
@@ -1780,6 +1780,53 @@
     return
 
 #---------------------------------------------------------------------
+
+def DropItem(curPlayer, itemList, npcID, dropPosX, dropPosY, isOnlySelfSee=True, isDropDisperse=True):
+    if not itemList:
+        return
+    if isDropDisperse:
+        dropItemList = []
+        for itemInfo in itemList:
+            if isinstance(itemInfo, list):
+                itemID, itemCount, isAuctionItem = itemInfo
+                # 拍品不拆
+                if isAuctionItem:
+                    dropItemList.append(itemInfo)
+                    continue
+                for _ in xrange(itemCount):
+                    dropItemList.append([itemID, 1, isAuctionItem])
+            else:
+                dropItemList.append(itemInfo)
+    else:
+        dropItemList = itemList
+        
+    index = 0
+    playerID = curPlayer.GetPlayerID()
+    gameMap = GameWorld.GetMap()
+    for posX, posY in ChConfig.Def_DropItemAreaMatrix:
+        resultX = dropPosX + posX
+        resultY = dropPosY + posY
+        
+        if not gameMap.CanMove(resultX, resultY):
+            #玩家不可移动这个点
+            continue
+        
+        if index > len(dropItemList) - 1:
+            break
+        
+        curItem = dropItemList[index]
+        index += 1
+        if isinstance(curItem, list):
+            itemID, itemCount, isAuctionItem = curItem
+            curItem = ItemControler.GetOutPutItemObj(itemID, itemCount, isAuctionItem, curPlayer=curPlayer)
+            
+        if not curItem:
+            continue
+        
+        AddMapDropItem(resultX, resultY, curItem, ownerInfo=[ChConfig.Def_NPCHurtTypePlayer, playerID], 
+                       dropNPCID=npcID, isOnlySelfSee=isOnlySelfSee)    
+    return
+
 ## 在地上添加物品(统一接口)
 #  @param itemPosX 位置x
 #  @param itemPosY 位置y

--
Gitblit v1.8.0