Purpose: To help you make you cut a certain amount of logs, and then the tree falls.
Requirements: A server with ReplaceObject2 void (fedexer's)
Edited files: Client.java
Alright well i'll do magic tree, because that's what i use in my server. So you need to start off with what happens when you click an item.
Code:
case 8409:
That is the case you need for the magic tree. Now you must tell the game what to do when you click on the object 8409. We want it to cut logs, then make a tree fall. In the case add something like this
Code:
Example();
Name that to whatever you would like the void to be called.
You need to make these two int's, i will explain why later.
Code:
public int magicTreeTimer = 0;
public int magicTree = 0;
Now we have to make the void
Code:
public void Example()
That is the start of your void.
Now you have to tell the game that it will only run through this code if magicTree doesn't equal 5.
Code:
if(magicTree != 5)
Something like that would do. You have to make a for loop now.
Code:
for(int i = 0; i < X; i++)
Change x to how many logs you want before the tree turns into a stump. You now have to tell the game to chop the logs, do the animation, and to add the xp.
E = the animation.
S = the amount of xp times the player's woodcutting level you want.
A = the item that you add.
Now you need to say what happens if magicTree does equal 5.
Code:
if(magicTree == 5)
{
ReplaceObject2(X, Y, O, F, 10);
magicTreeTimer = 25;
magicTree = 0;
}
X = object's x coord
Y = object's y coord
O = new object id (you might want 8410(magic tree stump))
F = the way the new object faces
Now search for
X = object's x coord
Y = object's y coord
F = the way the new object faces
The 8409 places the tree back.
Compile and enjoy
I didn't put in most { and } I assumed you guys knew enough about java to know where to put them. If you seriously don't know where to put the {'s and }'s I will help you.
95% Creds to [Only registered and activated users can see links. ]
5% Creds to me..for bring this to rune-server
First post!
Awesome im gunna add this straight away!
P.s noobs who want to add this may find it a bit hard where to add everything maybe u shud make it easier for them?
lol funny u give urself 5% credits for copieng it but its ok
very funny i made my first choppable trees the very same way as this is done
thank god i know better now
but its nice for beginners
try making the amount of logs to chop random instead of 5 (looks more real)
to give you a hint change the 5 (amount of logs to chop) into misc.random2(10); to make it random
nice tut anyway
Please vote: [Only registered and activated users can see links. ]
btb.servegame.com:
lol funny u give urself 5% credits for copieng it but its ok
very funny i made my first choppable trees the very same way as this is done
thank god i know better now
but its nice for beginners
try making the amount of logs to chop random instead of 5 (looks more real)
to give you a hint change the 5 (amount of logs to chop) into misc.random2(10); to make it random
Fabjan...its not necessarily coping, its like the owner does not have a rune-server account and there fore would like me to post it on here for my wonderful brothers and rune-server.