Try contact Thomy from emps-scape he did a lot of research into this mask and had it working perfect, he gave me his work but I know its defenty not on this PC, I'll have a look on my other PC over the weekend, but your best bet is contacting him as he had it working PERFECT!
If I remember right theres some crazy delay timer that is different for every animation that you also got to figure out, the more I remember the more horrific I remember it was.
Looking at the code I can find I think Scu is right, this is the code I have here but I know its pretty shit as I could never got it working correctly. Although I believe that is due to localX and localY in the mask itself.
mts.mts.
Code:
public void forceMovement(final int finishX, final int finishY, final int animId) { int direction = 0;
if (player.getLocation().getX() < finishX) {
direction = 1;
} else if (player.getLocation().getX() > finishX) {
direction = 3;
}
if (player.getLocation().getY() < finishY) {
direction = 0;
} else if (player.getLocation().getY() > finishY) {
direction = 2;
}
player.forceWalk1 = player.forceWalk2 = Location.create(finishX, finishY, player.getLocation().getZ());
double dis = player.getLocation().distance(player.forceWalk2);
final int delay = (int) (((dis / 2) * 600) + 600);
player.forceDirection = direction;
player.forceSpeed1 = 100;
player.forceSpeed2 = 0;
player.getUpdateFlags().flag(UpdateFlag.WALK);
player.forceAnimId = animId;
player.playAnimation(Animation.create(animId, -1));
/*
* final int a = player.getAppearance().getStandAnim(); final int b =
* player.getAppearance().getWalkAnim(); final int c =
* player.getAppearance().getRunAnim();
*
* player.getAppearance().setAnimations(animId,animId,animId);
* player.getUpdateFlags().flag(UpdateFlag.APPEARANCE);
*/
player.getActionSender().sendMessage("delay2: " + delay);
World.getWorld().submit(new Event(delay) {
@Override
public void execute() {
/*
* player.getAppearance().setAnimations(a,b,c);
* player.getUpdateFlags().flag(UpdateFlag.APPEARANCE);
*/
player.playAnimation(Animation.create(-1, 0));
player.setTeleportTarget(Location.create(finishX, finishY, player.getLocation().getZ()));
player.forceAnimId = -1;
this.stop();
}
});
}
mts.mts.