ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PetControl.py
@@ -47,6 +47,7 @@
import PassiveBuffEffMng
import ChNetSendPack
import IpyGameDataPY
import AttackCommon
#---------------------------------------------------------------------
DefPetRebornHPRate = 100  # 宠物死亡复活血量百分比
@@ -93,6 +94,32 @@
            if not curTag or GameObj.GetHP(curTag) <= 0:
                continue
        
        # 还没有就从视野中查找
        if not curTag or GameObj.GetHP(curTag) <= 0:
            seePlayerCount = rolePet.GetInSightObjCount()
            for i in range(0, seePlayerCount):
                seeObj = rolePet.GetInSightObjByIndex(i)
                if seeObj == None:
                    continue
                seeObjID = seeObj.GetID()
                seeObjType = seeObj.GetGameObjType()
                # 只允许主动攻击NPC,且目标NPC是主动怪
                if seeObjType != IPY_GameWorld.gotNPC:
                    continue
                seeObjDetail = GameWorld.GetObj(seeObjID, seeObjType)
                if not seeObjDetail:
                    continue
                if seeObjDetail.GetAtkType() == 1:
                    # 1为非主动怪
                    continue
                if not AttackCommon.CheckCanAttackTag(rolePet, seeObjDetail):
                    continue
                relation = BaseAttack.GetTagRelation(rolePet, seeObjDetail, None, tick)[0]
                if relation != ChConfig.Type_Relation_Enemy:
                    continue
                curTag = seeObjDetail
                break
    if not curTag or GameObj.GetHP(curTag) <= 0:
        return