From 9cc23ba064d9daf14a9085685f961b10d4f379f3 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 28 三月 2019 17:15:23 +0800
Subject: [PATCH] 6373 【后端】【2.0】删除无用功能代码、封包、配置(召回系统)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py |   51 +++++++++++++++++++++++++++++++++++----------------
 1 files changed, 35 insertions(+), 16 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 20ff038..15d6446 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -37,7 +37,6 @@
 import ShareDefine
 import ChItem
 #import AICommon
-import PlayerAction
 import ChPyNetSendPack
 import DataRecordPack
 import NetPackCommon
@@ -586,6 +585,27 @@
     #                   % (mapID, npcCountDict, exp_rate, mailTypeKey, isMail, extraItemList))
     #GameWorld.DebugLog("    totalExp=%s,totalMoney=%s,needSpace=%s,jsonItemList=%s" % (totalExp, totalMoney, needSpace, jsonItemList))
     return jsonItemList, totalExp, totalMoney
+
+def DoVirtualItemDrop(curPlayer, dropItemList, dropPosX, dropPosY):
+    ##前端假掉落表现
+    gameMap = GameWorld.GetMap()
+    index = 0
+    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
+        itemInfo = dropItemList[index]
+        index += 1
+        itemID, itemCount, isAuctionItem = itemInfo
+        curItem = ItemControler.GetOutPutItemObj(itemID, itemCount, isAuctionItem)
+        dropItemDataStr = ChItem.GetMapDropItemDataStr(curItem)
+        SendVirtualItemDrop(curPlayer, itemID, resultX, resultY, dropItemDataStr)
+        curItem.Clear()
+    return
 
 ################################### NPC掉落 ###################################
 Def_NPCMaxDropRate = 1000000 # NPC掉落相关的最大概率, 数值设定
@@ -4156,7 +4176,7 @@
             if mapID == ChConfig.Def_FBMapID_GatherSoul:#聚魂副本特殊处理
                 GameLogic_GatherSoul.KillGatherSoulNPCDropAward(itemID, itemCnt, isAuctionItem)
                 dropItemDataStr = ChItem.GetMapDropItemDataStr(curItem)
-                self.SendVirtualItemDrop(ownerPlayer, itemID, resultX, resultY, dropItemDataStr)
+                SendVirtualItemDrop(ownerPlayer, itemID, resultX, resultY, dropItemDataStr)
                 curItem.Clear()
                 continue
             
@@ -4166,21 +4186,10 @@
                 #可以放入背包
                 if ItemControler.DoLogic_PutItemInPack(ownerPlayer, curItem, event=["NPCDrop", False, {"npcID":npcID}]):
                     #通知客户端
-                    self.SendVirtualItemDrop(ownerPlayer, itemID, resultX, resultY, dropItemDataStr)
+                    SendVirtualItemDrop(ownerPlayer, itemID, resultX, resultY, dropItemDataStr)
                     
             else:
                 self.__MapCreateItem(curItem, resultX, resultY, ownerType, ownerID)
-        return
-    
-    def SendVirtualItemDrop(self, player, itemID, posX, posY, userDataStr):
-        #通知客户端
-        vItemDrop = ChPyNetSendPack.tagMCVirtualItemDrop()
-        vItemDrop.ItemTypeID = itemID
-        vItemDrop.PosX = posX
-        vItemDrop.PosY = posY
-        vItemDrop.UserData = userDataStr
-        vItemDrop.UserDataLen = len(vItemDrop.UserData)
-        NetPackCommon.SendFakePack(player, vItemDrop)
         return
     #---------------------------------------------------------------------
     ## NPC被杀死逻辑处理
@@ -4410,8 +4419,7 @@
         lastTimeHurtObj = self.__FindLastTimeHurtObj()
         if lastTimeHurtObj[0] == None and lastTimeHurtObj[1] == None:
             return
-        
-        PlayerAction.GetAwardOnKillNPC(lastTimeHurtObj, curNPC)   
+         
         return
     
     ## 最后一击处理
@@ -5080,6 +5088,17 @@
         return curItem
     
 #---------------------------------------------------------------------
+def SendVirtualItemDrop(player, itemID, posX, posY, userDataStr):
+    #通知客户端假物品掉落
+    vItemDrop = ChPyNetSendPack.tagMCVirtualItemDrop()
+    vItemDrop.ItemTypeID = itemID
+    vItemDrop.PosX = posX
+    vItemDrop.PosY = posY
+    vItemDrop.UserData = userDataStr
+    vItemDrop.UserDataLen = len(vItemDrop.UserData)
+    NetPackCommon.SendFakePack(player, vItemDrop)
+    return
+    
 def GetNPCExp(curPlayer, npcID):
     npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
     if not npcData:

--
Gitblit v1.8.0