Jump to content
Sign in to follow this  
General

[PI] Ladders/Stairs

Recommended Posts

This i no where near the most efficient way to do ladders in PI, but I just wrote this up quickly as I don't intend to have the full trapdoors/ladders or anything, for me personally this will do and is easy to implement.

First of all you need the modified cycle event manager, if you don't want to use it you're just going to have to fiddle about with the ticks from 2 to 1800 I think.

PlayerAssistant:
[CODE]
public void Climb(int x, int y, int h, String animation) {
if (animation == "up") {
c.startAnimation(828);
} else if (animation == "down") {
c.startAnimation(827);
}
c.canWalk = false;
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
[MENTION=15855]Over[/MENTION]ride
public void execute(CycleEventContainer container) {
container.stop();
}
[MENTION=15855]Over[/MENTION]ride
public void stop() {
c.getPA().movePlayer(x, y, h);
c.canWalk = true;
}
}, 2);
}[/CODE]

And that's it, if you want to use this you should know where to add the object clicking and there's two snippets below how it was used, but if you can't figure it out, i'm slightly worried.

Example of climbing up ladders/stairs:
[CODE]
//falador mine stairs
case 1734:
if (obX == 3059) {
c.getPA().Climb(3061, 3377, 0, "up");
}
break;
[/CODE]

and if you want the climb down animation obviously you change the "up" to "down"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×