hxp
4 天以前 c3bbd3b0263fc6c2127cd9f072f497f46f98758b
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -27,12 +27,9 @@
import FBLogic
import ItemCommon
import OperControlManager
import PetControl
import ReadChConfig
import DataRecordPack
#import ChItem
import ShareDefine
import PlayerHorse
import GameObj
import random
import NetPackCommon
@@ -40,12 +37,10 @@
import GameMap
import collections
import PassiveBuffEffMng
import ChEquip
import SkillShell
import FBCommon
import IpyGameDataPY
import PyGameData
import TurnAttack
#---------------------------------------------------------------------
GameWorld.ImportAll("Script\\Skill\\" , "GameSkills")
GameWorld.ImportAll("Script\\Skill\\" , "GameBuffs")
@@ -622,16 +617,6 @@
def IsToPetOwnerSkill(curNPC, skillTag):
    if skillTag != ChConfig.Def_UseSkillTag_PetMaster:
        return False
    if not PetControl.IsPet(curNPC):
        GameWorld.ErrLog("NPCID %s AI %s 非宠物,无法获得主人释放技能"%(curNPC.GetNPCID(), curNPC.GetAIType()))
        return False
    petOwner = PetControl.GetPetOwner(curNPC)
    if petOwner == None:
        GameWorld.ErrLog("宠物(%s)对主人释放技能,找不到主人"%curNPC.GetRolePet().PetID)
        return False
        
    return True
@@ -708,29 +693,29 @@
            continue
        npcObj.StopMove()
        npcObj.ChangePos(npcPos.PosX, npcPos.PosY)
        BeatBackMove(curPlayer, npcObj)
        #BeatBackMove(curPlayer, npcObj)
    return
# 针对NPC被推出远距离一直卡墙角问题,法宝挑战副本特殊处理为超过4米 NPC自动回退一些
def BeatBackMove(curPlayer, npcObj):
    if GameWorld.GetMap().GetMapID() != ChConfig.Def_FBMapID_MagicWeapon:
        return
    if npcObj.GetCurAction() == IPY_GameWorld.laNPCSkillWarning:
        return
    posMap = npcObj.GetRefreshPosAt(npcObj.GetCurRefreshPointIndex())
    if not posMap:
        return
    #范围校验
    posMapX = posMap.GetPosX()
    posMapY = posMap.GetPosY()
    if GameWorld.GetDist(npcObj.GetPosX(), npcObj.GetPosY(), posMapX, posMapY) < 8:
        # 单次位移不超过5米
        return
    npcControl = NPCCommon.NPCControl(npcObj)
    moveDestX, moveDestY = npcControl.GetMoveNearPosEx(posMapX, posMapY, 5)
    npcObj.Move(moveDestX, moveDestY)
    return
## 针对NPC被推出远距离一直卡墙角问题,法宝挑战副本特殊处理为超过4米 NPC自动回退一些
#def BeatBackMove(curPlayer, npcObj):
#    if GameWorld.GetMap().GetMapID() != ChConfig.Def_FBMapID_MagicWeapon:
#        return
#    if npcObj.GetCurAction() == IPY_GameWorld.laNPCSkillWarning:
#        return
#
#    posMap = npcObj.GetRefreshPosAt(npcObj.GetCurRefreshPointIndex())
#    if not posMap:
#        return
#    #范围校验
#    posMapX = posMap.GetPosX()
#    posMapY = posMap.GetPosY()
#    if GameWorld.GetDist(npcObj.GetPosX(), npcObj.GetPosY(), posMapX, posMapY) < 8:
#        # 单次位移不超过5米
#        return
#    npcControl = NPCCommon.NPCControl(npcObj)
#    moveDestX, moveDestY = npcControl.GetMoveNearPosEx(posMapX, posMapY, 5)
#    npcObj.Move(moveDestX, moveDestY)
#    return
#===============================================================================
# //B4 03 吸引NPC仇恨 #tagNPCAttention
@@ -1352,18 +1337,14 @@
    if GameObj.GetHP(curPlayer) <= 0:
        return
    
    if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
        #GameWorld.DebugLog("自定义场景中,不检查!")
        return True
    #===========================================================================
    # if curPlayer.IsMoving():
    #    GameWorld.DebugLog("移动中不可使用技能")
    #    return False
    #===========================================================================
    if curPlayer.GetPlayerVehicle() == IPY_GameWorld.pvHorse:
        #GameWorld.DebugLog("骑马中不允许释放技能", curPlayerID)
        PlayerHorse.PlayerRideHorseDown(curPlayer)
    #if curPlayer.GetPlayerVehicle() == IPY_GameWorld.pvHorse:
    #    #GameWorld.DebugLog("骑马中不允许释放技能", curPlayerID)
    #    PlayerHorse.PlayerRideHorseDown(curPlayer)
    
    if not PlayerControl.PlayerCanStateTransfer(curPlayer):
        #GameWorld.DebugLog('CheckUseSkill, PlayerStateErr = %s '%( curPlayer.GetPlayerAction() ), curPlayerID )
@@ -1716,22 +1697,8 @@
        # 对自身释放或者无目标技能
        if skillAffectTag in ChConfig.Def_ST_CanNPCUseSkill or skillAim == ChConfig.Def_UseSkillAim_None:
            #释放自身类技能
            return NPCUseSkill(attacker, curSkill, tick)
        # 宠物对主人释放技能
        elif skillAffectTag == ChConfig.Def_UseSkillTag_PetMaster:
            if not PetControl.IsPet(attacker):
                GameWorld.ErrLog("该NPC非宠物,无法获得主人释放技能")
                return False
            petOwner = PetControl.GetPetOwner(attacker)
            if petOwner == None:
                GameWorld.ErrLog("宠物(%s)对主人释放技能,找不到主人"%attacker.GetRolePet().PetID)
                return False
            return NPCUseSkill(attacker, curSkill, tick)
        
            curTag = petOwner
        # 召唤兽对主人释放技能
        elif skillAffectTag == ChConfig.Def_UseSkillTag_SummonMaster:
            if not NPCCommon.IsSummonNPC(attacker):
@@ -1837,7 +1804,7 @@
    #===========================================================================
        
    if curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_HorseSkill and SkillCommon.isPassiveAttr(curSkill):
        PlayerHorse.RefreshHorseAttr(curPlayer)
        pass#PlayerHorse.RefreshHorseAttr(curPlayer)
    else:
        if SkillCommon.isPassiveAttr(curSkill):
            curControl = PlayerControl.PlayerControl(curPlayer)
@@ -3665,18 +3632,6 @@
        result = DoLogic_UseSkill(attacker, target, curSkill, tick, posX, posY, isEnhanceSkill=isEnhanceSkill)
    
    else:
        if affectTag == ChConfig.Def_UseSkillTag_PetMaster:
            if not PetControl.IsPet(attacker):
                return False
            petOwner = PetControl.GetPetOwner(attacker)
            if petOwner == None:
                return False
            target = petOwner
            if GameObj.GetHP(target) <= 0:
                return False
        if affectTag not in [ChConfig.Def_UseSkillTag_None, ChConfig.Def_UseSkillTag_Self]:
            if not target:
                # 配置了可攻击目标,但没目标就不让触发