From 7c43f25db5f9a04b99892c1efc8f0647f767c20e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 23 十月 2018 15:03:02 +0800
Subject: [PATCH] 2149 boss被击杀无归属玩家(暂时添加击杀boss相关详细日志、掉落日志、拾取日志);

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py                  |   17 +++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py                |   92 +++++++++++++++++++++---------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_186.py         |   50 ++++++++++++++--
 4 files changed, 119 insertions(+), 42 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
index f89257c..d02f52a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
@@ -136,7 +136,6 @@
 def OnPlayerHurtFamilyOwnerBoss(curPlayer, curBoss, hurtValue):
     ## 仙盟玩家对仙盟归属boss造成伤害
     
-    GameWorld.DebugLog("OnPlayerHurtFamilyOwnerBoss hurtValue=%s" % hurtValue)
     if hurtValue <= 0:
         return
     
@@ -154,6 +153,7 @@
     if NPCCommon.GetDropOwnerType(curBoss) != ChConfig.DropOwnerType_Family:
         return
     
+    GameWorld.DebugLog("OnPlayerHurtFamilyOwnerBoss hurtValue=%s" % hurtValue)
     lineID = GameWorld.GetGameWorld().GetLineID()
     objID = curBoss.GetID()
     bossID = curBoss.GetNPCID()
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 3451f16..ed2f6f1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
@@ -344,7 +344,7 @@
         mapID = curPlayer.GetMapID()
         fbIpyData = FBCommon.GetFBIpyData(mapID)
         if fbIpyData and not fbIpyData.GetGuardPick():
-            GameWorld.DebugLog("该地图守护无法拾取物品! mapID=%s" % mapID, curPlayer.GetPlayerID())
+            GameWorld.Log("该地图守护无法拾取物品! mapID=%s" % mapID, curPlayer.GetPlayerID())
             return
         
 #    #单人副本一键拾取
@@ -352,15 +352,18 @@
 #        SingleFBTPickUP(curPlayer, mapItemID, tick)
 #        return
     
-    GameWorld.DebugLog("请求拾取物品, isGuard=%s,mapItemIDList=%s" % (isGuard, mapItemIDList), curPlayer.GetPlayerID())
+    if not mapItemIDList:
+        GameWorld.ErrLog("没有指定要拾取的地图物品ID!", curPlayer.GetPlayerID())
+        return
     
     succMapItemIDList = [] # 成功拾取的地图物品
     for mapItemID in mapItemIDList:
         if __DoPickup(curPlayer, mapItemID, tick, isGuard):
             succMapItemIDList.append(mapItemID)
             
-    GameWorld.DebugLog("    成功拾取物品, succMapItemIDList=%s" % (succMapItemIDList), curPlayer.GetPlayerID())
-    
+    if succMapItemIDList:
+        GameWorld.Log("成功拾取地图物品, succMapItemIDList=%s" % (succMapItemIDList), curPlayer.GetPlayerID())
+        
     # 守护拾取的,附加同步守护拾取结果
     if isGuard and succMapItemIDList:
         guradPickupSucc = ChPyNetSendPack.tagMCGuradPickupItemSucc()
@@ -1783,8 +1786,10 @@
         curMapItem.SetOwnerType(ownerType)
         curMapItem.SetOwnerID(ownerID)
         
-    #GameWorld.DebugLog("AddMapDropItem ID=%s,ownerType=%s,ownerID=%s,GetDropTick=%s,isBind=%s" 
-    #                   % (curMapItem.GetID(), ownerType, ownerID, curMapItem.GetDropTick(), curItem.GetIsBind()))
+    if dropNPCID:
+        itemNoteDict = ItemCommon.GetItemNoteDict(curItem, curItem.GetCount())
+        GameWorld.Log("AddMapDropItem mapItemID=%s,ownerType=%s,ownerID=%s,mapItemDataStr=%s,itemNoteDict=%s" 
+                      % (curMapItem.GetID(), curMapItem.GetOwnerType(), curMapItem.GetOwnerID(), itemDataStr, itemNoteDict))
     return curMapItem
 
 def GetMapDropItemDataStr(curItem, effIndex=0, ownerInfo=[], dropNPCID=0, isOnlySelfSee=False):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_186.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_186.py
index 2c5e032..0df17e2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_186.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_186.py
@@ -40,6 +40,7 @@
 import PyGameData
 import BuffSkill
 import GameObj
+import ItemCommon
 
 ## 初始化
 #  @param curNPC 当前npc
@@ -102,12 +103,15 @@
     tagObj = None # 即将攻击的目标, 归属最大伤血取最大伤血玩家或队伍队员,其他取最大仇恨
     ownerType, ownerID = 0, 0
     dropOwnerType = NPCCommon.GetDropOwnerType(curNPC)
+    if isDead:
+        GameWorld.Log("Boss死亡: lineID=%s,objID=%s,npcID=%s,dropOwnerType=%s" 
+                      % (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), curNPC.GetNPCID(), dropOwnerType))
     if dropOwnerType == ChConfig.DropOwnerType_MaxHurt:
         maxHurtObj = npcControl.RefreshHurtList(tick, refreshInterval)
         if maxHurtObj:
             ownerType, ownerID = maxHurtObj.GetValueType(), maxHurtObj.GetValueID()
             if ownerType == ChConfig.Def_NPCHurtTypeTeam:
-                tagObj = __GetMaxHurtTeamPlayer(curNPC, npcControl, ownerID)
+                tagObj = __GetMaxHurtTeamPlayer(curNPC, npcControl, ownerID, isDead)
             elif ownerType == ChConfig.Def_NPCHurtTypePlayer:
                 tagObj = GameWorld.GetObj(ownerID, IPY_GameWorld.gotPlayer)
                 
@@ -116,6 +120,9 @@
         if ownerInfo:
             tagObj, ownerFamilyID = ownerInfo
             ownerType, ownerID = ChConfig.Def_NPCHurtTypeFamily, ownerFamilyID
+            
+    if isDead:
+        GameWorld.Log("ownerType=%s, ownerID=%s, tagObjID=%s" % (ownerType, ownerID, 0 if not tagObj else tagObj.GetPlayerID()))
             
     # 没有攻击目标,则刷新仇恨,支持主动怪
     if not tagObj:
@@ -135,22 +142,36 @@
                 ownerType, ownerID = ChConfig.Def_NPCHurtTypeTeam, teamID
             else:
                 ownerType, ownerID = ChConfig.Def_NPCHurtTypePlayer, maxAngryObj.GetPlayerID()
+        
+        if isDead:
+            GameWorld.Log("angryObj, ownerType=%s, ownerID=%s" % (ownerType, ownerID))
+            
     __RefreshBossDropOwnerObjBuff(curNPC, npcControl, tick, ownerType, ownerID, isDead)
     return tagObj
 
-def __GetMaxHurtTeamPlayer(curNPC, npcControl, teamID):
+def __GetMaxHurtTeamPlayer(curNPC, npcControl, teamID, isDead):
     ## 获取最大伤血队伍中攻击的目标队员
     curTeam = GameWorld.GetTeamManager().FindTeam(teamID)
     if curTeam:
         refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
+        if isDead:
+            GameWorld.Log("队伍成员数: teamID=%s,memberCount=%s" % (teamID, curTeam.GetMemberCount()))
         for i in xrange(curTeam.GetMemberCount()):
             curTeamPlayer = curTeam.GetMember(i)
             if curTeamPlayer == None or curTeamPlayer.GetPlayerID() == 0:
+                if isDead:
+                    GameWorld.Log("    i=%s, 队员为空!" % i)
                 continue
             if curTeamPlayer.GetHP() <= 0:
+                if isDead:
+                    GameWorld.Log("    i=%s, 队员血量为0!, memPlayerID=%s" % (i, curTeamPlayer.GetPlayerID()))
                 continue
+            if isDead:
+                GameWorld.Log("    i=%s, 队员坐标(%s, %s)! memPlayerID=%s" % (i, curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), curTeamPlayer.GetPlayerID()))
             if npcControl.GetIsInRefreshPoint(curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), refreshPoint):
                 return curTeamPlayer
+    else:
+        GameWorld.ErrLog("找不到该队伍: teamID=%s" % teamID)
     return
 
 def __RefreshBossDropOwnerObjBuff(curNPC, npcControl, tick, ownerType=0, ownerID=0, isDead=False):
@@ -163,9 +184,10 @@
     lastDropOwnerID = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_LastDropOwnerID)
     lastDropOwnerType = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_LastDropOwnerType)
     
+    key = (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), npcID)
     if lastDropOwnerID and (lastDropOwnerType != ownerType or lastDropOwnerID != ownerID):
-        GameWorld.DebugLog("归属变更, 清除旧归属! ownerType=%s,ownerID=%s,lastDropOwnerType=%s,lastDropOwnerID=%s" 
-                           % (ownerType, ownerID, lastDropOwnerType, lastDropOwnerID))
+        GameWorld.Log("归属变更, 清除旧归属! key=%s,ownerType=%s,ownerID=%s,lastDropOwnerType=%s,lastDropOwnerID=%s" 
+                      % (key, ownerType, ownerID, lastDropOwnerType, lastDropOwnerID))
         __DelBossDropOwnerBuff(curNPC, lastDropOwnerType, lastDropOwnerID, tick)
     
     killerDict, curTeam, hurtType, hurtID = {}, None, 0, 0
@@ -174,6 +196,9 @@
     curNPC.SetDict(ChConfig.Def_NPC_Dict_LastDropOwnerID, ownerID)
     curNPC.SetDict(ChConfig.Def_NPC_Dict_LastDropOwnerType, ownerType)
     
+    if isDead:
+        GameWorld.Log("Boss归属: key=%s,ownerType=%s,ownerID=%s" % (key, ownerType, ownerID))
+        
     # 刷新归属
     if ownerType == ChConfig.Def_NPCHurtTypePlayer:
         curPlayer = GameWorld.GetObj(ownerID, IPY_GameWorld.gotPlayer)
@@ -190,11 +215,14 @@
         
         # 因为有击杀次数限制,所以不是所有的队员都可以获得归属,所以这里设置为特殊指定玩家掉落
         hurtType, hurtID = ChConfig.Def_NPCHurtTypeSpecial, 0
-        
+        if isDead:
+            GameWorld.Log("队伍成员数: %s" % (curTeam.GetMemberCount()))
         refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
         for i in xrange(curTeam.GetMemberCount()):
             curTeamPlayer = curTeam.GetMember(i)
             if curTeamPlayer == None or curTeamPlayer.GetPlayerID() == 0:
+                if isDead:
+                    GameWorld.Log("    i=%s, 成员不存在!" % (i))
                 continue
             
             if curTeamPlayer.GetCopyMapID() == GameWorld.GetGameWorld().GetCopyMapID() \
@@ -202,12 +230,20 @@
                 and AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False):
                 __AddBossDropOwnerPlayerBuff(curTeamPlayer, tick, curNPC)
                 killerDict[curTeamPlayer.GetPlayerID()] = curTeamPlayer
-                
+                if isDead:
+                    GameWorld.Log("    i=%s, 成员有归属权! memPlayerID=%s,背包剩余空格=%s" 
+                                  % (i, curTeamPlayer.GetPlayerID(), ItemCommon.GetItemPackSpace(curTeamPlayer, IPY_GameWorld.rptItem)))
+                    
             # 不同线、或者距离超出boss范围的队员不加归属buff
             else:
                 isOk = BuffSkill.DelBuffBySkillID(curTeamPlayer, ChConfig.Def_SkillID_DropOwnerBuff, tick, buffOwner=curNPC)
                 if isOk:
                     GameWorld.DebugLog("删除归属队员buff: teamID=%s,playerID=%s" % (ownerID, curTeamPlayer.GetPlayerID()))
+                if isDead:
+                    GameWorld.Log("    i=%s, 成员无归属权! memPlayerID=%s,copyMapID=%s,pos(%s,%s),CheckKillNPCByCnt=%s" 
+                                  % (i, curTeamPlayer.GetPlayerID(), curTeamPlayer.GetCopyMapID(), 
+                                     curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), 
+                                     AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False)))
                     
     elif ownerType == ChConfig.Def_NPCHurtTypeFamily:
         
@@ -229,7 +265,7 @@
                     GameWorld.DebugLog("删除非归属仙盟成员buff: teamID=%s,playerID=%s" % (ownerID, player.GetPlayerID()))
             
     if isDead:
-        key = (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), npcID)
+        #key = (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), npcID)
         teamID = curTeam.GetTeamID() if curTeam else 0
         if killerDict:
             PyGameData.g_npcKillerInfo[key] = killerDict, curTeam, hurtType, hurtID
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 0d7b24c..3f0bc15 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -4014,10 +4014,16 @@
         npcID = curNPC.GetNPCID()
         mapID = GameWorld.GetMap().GetMapID()
         mapID = FBCommon.GetRecordMapID(mapID)
+        isGameBoss = ChConfig.IsGameBoss(curNPC)
+        if isGameBoss:
+            GameWorld.Log("NPC开始掉落: npcID=%s,dropPlayerID=%s" % (npcID, dropPlayer.GetPlayerID()))
         if mapID == ChConfig.Def_FBMapID_MunekadoTrial:
             return
         ipyDrop = GetNPCDropIpyData(npcID)
         if not ipyDrop:
+            if isGameBoss:
+                curWorldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
+                GameWorld.ErrLog("取不到NPC掉落信息!npcID=%s,curWorldLV=%s" % (npcID, curWorldLV))
             return
         
         #if mapID == ChConfig.Def_FBMapID_MunekadoTrial:
@@ -4266,9 +4272,11 @@
         self.__LastHurtPlayer = self.__FindLastTimeHurtObjEx()
         self.__MaxHurtPlayer = self.__FindBossMaxHurtObj() # py自定义伤血所得到的Boss最大伤血玩家
         
-        self.__AllKillerDict, curTeam, hurtType, hurtID = self.__FindNPCKillerInfo()
-        self.__OwnerHurtType, self.__OwnerHurtID = hurtType, hurtID
         isGameBoss = ChConfig.IsGameBoss(curNPC)
+        self.__AllKillerDict, curTeam, hurtType, hurtID = self.__FindNPCKillerInfo(isGameBoss)
+        self.__OwnerHurtType, self.__OwnerHurtID = hurtType, hurtID
+        if isGameBoss:
+            GameWorld.Log("__GiveObjPrize npcID=%s,hurtType=%s,hurtID=%s" % (npcID, hurtType, hurtID))
         
         #最后一击处理
         self.__DoLastTimeHurtLogic()
@@ -4377,7 +4385,7 @@
     ## NPC死亡, 分享经验逻辑
     #  @param self 类实例
     #  @return 返回击杀玩家信息元组, (玩家列表实例,队伍实例,归属类型,归属ID)
-    def __FindNPCKillerInfo(self):
+    def __FindNPCKillerInfo(self, isGameBoss):
         curNPC = self.__Instance
         npcID = curNPC.GetNPCID()
         objID = curNPC.GetID()
@@ -4396,36 +4404,39 @@
         
         #isLog = self.__GetIsLog()
         dropOwnerType = GetDropOwnerType(curNPC)
-        #GameWorld.DebugLog("NPC击杀者信息...npcID=%s,dropOwnerType=%s" % (npcID, dropOwnerType))
-        
+        if isGameBoss:
+            GameWorld.Log("NPC被击杀, key=%s,dropOwnerType=%s" % (key, dropOwnerType))
+            
         # 最大伤血 - 伤血可能被重置
         if dropOwnerType == ChConfig.DropOwnerType_MaxHurt:
             npcHurtList = curNPC.GetPlayerHurtList()
             npcHurtList.Sort()
-            #if isLog:
-            #    GameWorld.DebugLog("NPC被击杀,npcID=%s,dropOwnerType=%s,hurtCount=%s" % (npcID, dropOwnerType, npcHurtList.GetHurtCount()))
+            if isGameBoss:
+                GameWorld.Log("hurtCount=%s" % (npcHurtList.GetHurtCount()))
             for i in xrange(npcHurtList.GetHurtCount()):
                 #获得最大伤血对象
                 maxHurtObj = npcHurtList.GetHurtAt(i)
-                #if isLog:
-                #    GameWorld.DebugLog("    i=%s,hurtValueType=%s,valueID=%s" % (i, maxHurtObj.GetValueType(), maxHurtObj.GetValueID()))
-                curPlayer, curTeam = self.__GetTagByHurtObj(maxHurtObj)
+                if isGameBoss:
+                    GameWorld.Log("hurtIndex=%s,hurtValueType=%s,valueID=%s" % (i, maxHurtObj.GetValueType(), maxHurtObj.GetValueID()))
+                curPlayer, curTeam = self.__GetTagByHurtObj(maxHurtObj, isLog=isGameBoss)
                 #当前伤血对象超出指定范围或已经死亡
                 if curPlayer == None and curTeam == None:
-                    #if isLog:
-                    #    GameWorld.DebugLog("        当前伤血对象超出指定范围或已经死亡")
+                    if isGameBoss:
+                        GameWorld.Log("    当前伤血对象超出指定范围或已经死亡")
                     continue
                 
                 if curPlayer:
                     playerID = curPlayer.GetPlayerID()
                     if playerID not in killerDict:
                         killerDict[playerID] = curPlayer
-                    GameWorld.Log("    归属最大伤血玩家: npcID=%s,dropOwnerType=%s,playerID=%s" % (npcID, dropOwnerType, playerID))
+                    if isGameBoss:
+                        GameWorld.Log("    归属最大伤血玩家: npcID=%s,dropOwnerType=%s,playerID=%s" % (npcID, dropOwnerType, playerID))
                     return killerDict, None, ChConfig.Def_NPCHurtTypePlayer, playerID
                 
                 if curTeam:
                     killTeam = curTeam
-                    GameWorld.Log("    归属最大伤血队伍: npcID=%s,dropOwnerType=%s,teamID=%s" % (npcID, dropOwnerType, curTeam.GetTeamID()))
+                    if isGameBoss:
+                        GameWorld.Log("    归属最大伤血队伍: npcID=%s,dropOwnerType=%s,teamID=%s" % (npcID, dropOwnerType, curTeam.GetTeamID()))
                     return killerDict, curTeam, ChConfig.Def_NPCHurtTypeTeam, curTeam.GetTeamID()
         # 最大伤血玩家 - 伤血不会被重置
         elif dropOwnerType == ChConfig.DropOwnerType_MaxHurtPlayer:
@@ -4455,8 +4466,8 @@
         if self.__LastHurtPlayer:
             lastHurtPlayerID = self.__LastHurtPlayer.GetPlayerID()
             teamID = self.__LastHurtPlayer.GetTeamID()
-            #if isLog:
-            #    GameWorld.DebugLog("    归属最后一击,npcID=%s,lastHurtPlayerID=%s,teamID=%s" % (npcID, lastHurtPlayerID, teamID))
+            if isGameBoss:
+                GameWorld.Log("    归属最后一击,npcID=%s,lastHurtPlayerID=%s,teamID=%s" % (npcID, lastHurtPlayerID, teamID))
             if teamID:
                 killTeam = GameWorld.GetTeamManager().FindTeam(teamID)
             if not killTeam and lastHurtPlayerID not in killerDict:
@@ -4464,9 +4475,8 @@
                 
         if dropOwnerType == ChConfig.DropOwnerType_All:
             hurtType = ChConfig.Def_NPCHurtTypeAll
-            #if isLog:
-            #    GameWorld.DebugLog("    无归属...npcID=%s" % npcID)
-            #GameWorld.DebugLog("    无归属...")
+            if isGameBoss:
+                GameWorld.Log("    无归属...npcID=%s" % npcID)
             
         elif dropOwnerType == ChConfig.DropOwnerType_Faction:
             #阵营归属
@@ -4474,23 +4484,22 @@
             if protectFaction > 0:
                 hurtType = ChConfig.Def_NPCHurtTypeFaction
                 hurtID = protectFaction
-                #GameWorld.DebugLog("    阵营归属...factionID=%s" % protectFaction)
+                if isGameBoss:
+                    GameWorld.Log("    阵营归属...factionID=%s" % protectFaction)
                 
         if hurtType == 0:
             #归属队伍
             if killTeam:
                 hurtType = ChConfig.Def_NPCHurtTypeTeam
                 hurtID = killTeam.GetTeamID()
-                #if isLog:
-                #    GameWorld.DebugLog("    归属默认队伍, npcID=%s,teamID=%s" % (npcID, hurtID))
-                #GameWorld.DebugLog("    归属默认队伍, teamID=%s" % hurtID)
+                if isGameBoss:
+                    GameWorld.Log("    归属默认队伍, npcID=%s,teamID=%s" % (npcID, hurtID))
             #伤血归属玩家
             elif killerDict:
                 hurtType = ChConfig.Def_NPCHurtTypePlayer
                 hurtID = killerDict.keys()[0]
-                #if isLog:
-                #    GameWorld.DebugLog("    归属默认玩家, npcID=%s,playerID=%s" % (npcID, hurtID))
-                #GameWorld.DebugLog("    归属默认玩家, playerID=%s" % hurtID)
+                if isGameBoss:
+                    GameWorld.Log("    归属默认玩家, npcID=%s,playerID=%s" % (npcID, hurtID))
                 
         return killerDict, killTeam, hurtType, hurtID
     
@@ -4561,9 +4570,10 @@
     #  @param maxHurtObj 最大伤血对象
     #  @return 返回值, 伤血对象
     #  @remarks 获得伤血对象,支持抢怪
-    def __GetTagByHurtObj(self, maxHurtObj, isCheckRefreshArea=False):
+    def __GetTagByHurtObj(self, maxHurtObj, isCheckRefreshArea=False, isLog=False):
         #获得死亡的NPC
         curNPC = self.__Instance
+        npcID = curNPC.GetNPCID()
         # 伤害的obj类型元组(玩家, 队伍)
         hurtObjTuple = (None, None)
         if maxHurtObj == None:
@@ -4578,18 +4588,28 @@
             curPlayer = GameWorld.GetObj(maxHurtObj.GetValueID(), IPY_GameWorld.gotPlayer)
             
             if curPlayer == None:
+                if isLog:
+                    GameWorld.Log("找不到该目标伤血玩家: npcID=%s,playerID=%s" % (npcID, maxHurtObj.GetValueID()))
                 return hurtObjTuple
             
             #支持抢怪,个人杀死,但自己死亡,不算
             if curPlayer.GetHP() <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
+                if isLog:
+                    GameWorld.Log("该目标伤血玩家已死亡: npcID=%s,playerID=%s" % (npcID, maxHurtObj.GetValueID()))
                 return hurtObjTuple
             
             if isCheckRefreshArea:
                 if not self.GetIsInRefreshPoint(curPlayer.GetPosX(), curPlayer.GetPosY(), refreshPoint):
+                    if isLog:
+                        GameWorld.Log("该目标伤血玩家不在NPC区域内: npcID=%s,playerID=%s,pos(%s,%s)" 
+                                      % (npcID, maxHurtObj.GetValueID(), curPlayer.GetPosX(), curPlayer.GetPosY()))
                     return hurtObjTuple
             #如果玩家已经超出指定距离,不加经验
             elif GameWorld.GetDist(curNPC.GetPosX(), curNPC.GetPosY(),
                                      curPlayer.GetPosX(), curPlayer.GetPosY()) > ChConfig.Def_Team_GetExpScreenDist:
+                if isLog:
+                    GameWorld.Log("该目标伤血玩家超出指定距离: npcID=%s,playerID=%s,npcPos(%s,%s),playerPos(%s,%s)" 
+                                  % (npcID, maxHurtObj.GetValueID(), curNPC.GetPosX(), curNPC.GetPosY(), curPlayer.GetPosX(), curPlayer.GetPosY()))
                 return hurtObjTuple
             
             #正常返回
@@ -4600,23 +4620,39 @@
             #获得当前队伍
             teamID = maxHurtObj.GetValueID()
             curTeam = GameWorld.GetTeamManager().FindTeam(teamID)
+            if isLog:
+                GameWorld.Log("目标伤血队伍: npcID=%s,teamID=%s" % (npcID, teamID))
             if curTeam == None:
+                if isLog:
+                    GameWorld.Log("找不到目标队伍, teamID=%s" % (teamID))
                 return hurtObjTuple
             
+            if isLog:
+                GameWorld.Log("队伍成员数: GetMemberCount=%s" % (curTeam.GetMemberCount()))                
             #遍历队伍,半径为一屏半的距离内的所有队伍/团队成员,可以获得经验
             for i in xrange(curTeam.GetMemberCount()):
                 curTeamPlayer = curTeam.GetMember(i)
                 if curTeamPlayer == None or curTeamPlayer.GetPlayerID() == 0:
+                    if isLog:
+                        GameWorld.Log("    i=%s, 无该队员!" % (i))
                     continue
                 
                 if curTeamPlayer.GetHP() <= 0 or curTeamPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
+                    if isLog:
+                        GameWorld.Log("    i=%s, 队员已死亡!memPlayerID=%s" % (i, curTeamPlayer.GetPlayerID()))
                     continue
                 
                 if isCheckRefreshArea:
                     if not self.GetIsInRefreshPoint(curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), refreshPoint):
+                        if isLog:
+                            GameWorld.Log("    i=%s, 队员不在NPC区域内!memPlayerID=%s,pos(%s,%s)" 
+                                          % (i, curTeamPlayer.GetPlayerID(), curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY()))
                         continue
                 elif GameWorld.GetDist(curNPC.GetPosX(), curNPC.GetPosY(), curTeamPlayer.GetPosX(),
                                        curTeamPlayer.GetPosY()) > ChConfig.Def_Team_GetExpScreenDist:
+                    if isLog:
+                        GameWorld.Log("    i=%s, 队员超出指定距离!memPlayerID=%s,npcPos(%s,%s),playerPos(%s,%s)" 
+                                      % (i, curTeamPlayer.GetPlayerID(), curNPC.GetPosX(), curNPC.GetPosY(), curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY()))
                     continue
                 
                 hurtObjTuple = (None, curTeam)
@@ -4849,7 +4885,7 @@
     def __GetIsLog(self):
         ## 测试查错日志,临时用
         ## 相关bug: 仙界秘境无经验、boss无掉落
-        return False
+        return ChConfig.IsGameBoss(self.__Instance)
         #return GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_BZZD or ChConfig.IsGameBoss(self.__Instance)
 
     #---------------------------------------------------------------------

--
Gitblit v1.8.0