|
|
@ -33,20 +33,38 @@ public class MoveToPointHandler extends AbstractClientMsgHandler { |
|
|
|
if (pc == null) |
|
|
|
if (pc == null) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
AbstractWorldObject target = null; |
|
|
|
if(pc.combatTarget == null){ |
|
|
|
Enum.GameObjectType targetType; |
|
|
|
MovementManager.movement(msg, pc); |
|
|
|
|
|
|
|
return true; |
|
|
|
targetType = Enum.GameObjectType.values()[msg.getTargetType()]; |
|
|
|
} else{ |
|
|
|
switch(targetType){ |
|
|
|
Enum.GameObjectType combatTargetType = pc.combatTarget.getObjectType(); |
|
|
|
case Building: |
|
|
|
if(combatTargetType.equals(Enum.GameObjectType.NPC)){ |
|
|
|
int i = 1; |
|
|
|
msg.clearTarget(); |
|
|
|
break; |
|
|
|
pc.setCombatTarget(null); |
|
|
|
case NPC: |
|
|
|
origin.sendMsg(msg); |
|
|
|
int j = 1; |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
if(combatTargetType.equals(Enum.GameObjectType.Mob) || combatTargetType.equals(Enum.GameObjectType.PlayerCharacter)){ |
|
|
|
|
|
|
|
MovementManager.movement(msg, pc); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} else if(combatTargetType.equals(Enum.GameObjectType.Building)) { |
|
|
|
|
|
|
|
Building targetBuilding = BuildingManager.getBuilding(pc.combatTarget.getObjectUUID()); |
|
|
|
|
|
|
|
if (targetBuilding != null) { |
|
|
|
|
|
|
|
if (targetBuilding.isVulnerable() && targetBuilding.getRank() > -1) { |
|
|
|
|
|
|
|
MovementManager.movement(msg, pc); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
msg.clearTarget(); |
|
|
|
|
|
|
|
pc.setCombatTarget(null); |
|
|
|
|
|
|
|
origin.sendMsg(msg); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MovementManager.movement(msg, pc); |
|
|
|
pc.teleport(pc.loc); |
|
|
|
|
|
|
|
msg.setEndCoord(pc.loc); |
|
|
|
|
|
|
|
origin.sendMsg(msg); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|