Okay so I'm trying to figure out how forced movement works.
So I have my object
Code:
package org.runescape.game.world.mask;
public class Movement {
private Animation animation;
private Location start;
private Location end;
private int startSpeed;
private int endSpeed;
private int direction;
public static Movement create(Animation animation, Location start, Location end,
int startSpeed, int endSpeed, int direction) {
return new Movement(animation, start, end, startSpeed, endSpeed, direction);
}
private Movement(Animation animation, Location start, Location end,
int startSpeed, int endSpeed, int direction) {
super();
this.animation = animation;
this.start = start;
this.end = end;
this.startSpeed = startSpeed;
this.endSpeed = endSpeed;
this.direction = direction;
}
public Animation getAnimation() {
return animation;
}
public Location getStart() {
return start;
}
public Location getEnd() {
return end;
}
public int getStartSpeed() {
return startSpeed;
}
public int getEndSpeed() {
return endSpeed;
}
public int getDirection() {
return direction;
}
}
And My Update Block
Code:
block.putByteS((byte) player.getCurrentForcedMovement().getStart().getX());
block.putByteS((byte) player.getCurrentForcedMovement().getStart().getY());
block.putByteS((byte) player.getCurrentForcedMovement().getEnd().getX());
block.putByteS((byte) player.getCurrentForcedMovement().getEnd().getY());
block.putLEShortA(player.getCurrentForcedMovement().getStartSpeed());
block.putShortA(player.getCurrentForcedMovement().getEndSpeed());
block.putByteS((byte) player.getCurrentForcedMovement().getDirection());
player.playAnimation(player.getCurrentForcedMovement().getAnimation());
When I use the method I created PlayForceMovement(Movement movement)
Code:
case "walk":
int direction = Integer.parseInt(args[1]);
int x = Integer.parseInt(args[1]);
int y = Integer.parseInt(args[2]);
player.playForcedMovement(Movement.create(player.getCurrentAnimation(), player.getLocation(), Location.create(x, y, 0), 2000, 2200, direction));
break;
}
My player never walk in a poll direction so it seem its alway (NE, NW, SE, or SW) and its never toward the specified coords.
So if anyone can help me understand this would really nice.