From 57d60ef7648868c76189d3a127dc3e5f0800f6f3 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 27 六月 2019 14:27:31 +0800
Subject: [PATCH] 7589 【2.0.100】【后端】资源找回优化

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_196.py |   71 -----------------------------------
 1 files changed, 1 insertions(+), 70 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_196.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_196.py
index d77b4ee..3242144 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_196.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_196.py
@@ -20,12 +20,8 @@
 import GameWorld
 import NPCCommon
 import IPY_GameWorld
-import PlayerControl
-import IpyGameDataPY
-import AttackCommon
-import ItemCommon
+import AICommon
 import GameObj
-import ChItem
 
 import random
 
@@ -246,14 +242,10 @@
 #  @param tick 
 #  @return 具体伤害值
 def OnAttacked(atkObj, curNPC, skill, tick):
-    npcControl = NPCCommon.NPCControl(curNPC)
     if GameObj.GetHP(curNPC) < GameObj.GetMaxHP(curNPC) / 2:
         GameObj.SetHP(curNPC, GameObj.GetMaxHP(curNPC))
         GameWorld.DebugLog("半血回满血!")
     curNPC.SetDict(Def_NPCKey_Goblin_AttackedTick, tick) # 设置被攻击时间
-    
-    # 每次被攻击掉落物品
-    __OnAttackedDropItem(atkObj, curNPC, npcControl)
     return
 
 def OnCheckCanDie(atkObj, curNPC, skill, tick):
@@ -261,65 +253,4 @@
     GameObj.SetHP(curNPC, GameObj.GetMaxHP(curNPC))
     GameWorld.DebugLog("死亡回满血!")
     return False
-
-
-## 每次被攻击掉落物品
-#  @param atkObj 攻击发起者
-#  @param curNPC 被攻击NPC
-#  @return None
-def __OnAttackedDropItem(atkObj, curNPC, npcControl):
-    attackPlayer, npcObjType = AttackCommon.GetAttackPlayer(atkObj)
-    if npcObjType:
-        return
-    if not attackPlayer:
-        return
-    npcID = curNPC.GetNPCID()
-    ipyData = IpyGameDataPY.GetIpyGameDataNotLog("TreasureNPC", npcID)
-    if not ipyData:
-        return
-    attackCountDropWeightInfo = ipyData.GetAttackCountDropWeightInfo()
-    attackDropWeightList = ipyData.GetAttackDropWeightList()
-    attackDropWeightListEx = ipyData.GetAttackDropWeightListEx()
-    dropCountEx = ipyData.GetDropCountEx()
-    alchemyDiffLV = ipyData.GetAlchemyDiffLV()
-    
-    mainItemWeightList = []
-    if attackCountDropWeightInfo:
-        maxCount = max(attackCountDropWeightInfo)
-        attackCount = attackPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NPCAttackCount % npcID) + 1
-        if attackCount <= maxCount:
-            if attackCount in attackCountDropWeightInfo:
-                mainItemWeightList = attackCountDropWeightInfo[attackCount]
-            NPCCommon.UpdateNPCAttackCount(attackPlayer, npcID, attackCount, maxCount)
-    
-    if mainItemWeightList:
-        mainItemWeightList = ItemCommon.GetWeightItemListByAlchemyDiffLV(attackPlayer, mainItemWeightList, alchemyDiffLV)
-    elif attackDropWeightList:
-        mainItemWeightList = ItemCommon.GetWeightItemListByAlchemyDiffLV(attackPlayer, attackDropWeightList, alchemyDiffLV)
-        
-    mainItemInfo = GameWorld.GetResultByWeightList(mainItemWeightList)
-    
-    if not mainItemInfo:
-        notDropNotify = ipyData.GetNotDropNotify()
-        if notDropNotify:
-            PlayerControl.NotifyCode(attackPlayer, notDropNotify)
-        return
-    
-    dropItemList = []
-    if mainItemInfo:
-        dropItemList.append(mainItemInfo)
-        
-    if attackDropWeightListEx and dropCountEx:
-        weightListEx = ItemCommon.GetWeightItemListByAlchemyDiffLV(attackPlayer, attackDropWeightListEx, alchemyDiffLV)
-        for _ in xrange(dropCountEx):
-            itemInfo = GameWorld.GetResultByWeightList(weightListEx)
-            if itemInfo:
-                dropItemList.append(itemInfo)
-                
-    if not dropItemList:
-        return
-    
-    dropPosX, dropPosY = curNPC.GetPosX(), curNPC.GetPosY()
-    ChItem.DoMapDropItem(attackPlayer, dropItemList, npcID, dropPosX, dropPosY, isOnlySelfSee=False)
-    return
 

--
Gitblit v1.8.0