Improved movement while flying.

This commit is contained in:
MobiusDev 2019-02-18 09:51:14 +00:00
parent 5d04f7dd9f
commit 4cc0015d3c
43 changed files with 54 additions and 54 deletions

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -740,7 +740,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceId());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceId());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -359,7 +359,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -2631,7 +2631,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || isStunned() || isSleeping() || isAttackingNow() || isAlikeDead() || isParalyzed() || isPhysicalAttackMuted() || _AIdisabled;
return isStunned() || isSleeping() || isAttackingNow() || isAlikeDead() || isParalyzed() || isPhysicalAttackMuted() || _AIdisabled;
}
public final Calculator[] getCalculators()
@ -3931,7 +3931,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));

View File

@ -619,7 +619,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@ -361,7 +361,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@ -1863,7 +1863,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
return hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
}
public final boolean isConfused()
@ -2950,7 +2950,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.

View File

@ -1152,7 +1152,7 @@ public class SkillCaster implements Runnable
}
}
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
final Location destination = creature.isFlying() ? new Location(x, y, z) : GeoEngine.getInstance().canMoveToTargetLoc(creature.getX(), creature.getY(), creature.getZ(), x, y, z, creature.getInstanceWorld());
creature.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
creature.broadcastPacket(new FlyToLocation(creature, destination, flyType, 0, 0, 333));