DIFFICULTY: 0/10
Hello everyone, first tutorial. If you're using vencillio I recommend you check out my snippet. It involves a nasty Ruby-Bolts (e) exploit.
Otherwise lets get in to it.
Step One:
Open
You should see a folder called core, rs2, and tools.
If you do you're in the right place.
Step Two:
Otherwise make a new folder.
You can title it whatever, for example mines titled June.
For the tutorial lets call it "randomevents"
Step Three:
Open the folder and create a new java document called Birdsnest.java
Step Four:
Open the Birdsnest.java
And add this code below.
Code:
package com.vencillio.randomevents;
import com.vencillio.core.util.Utility;
import com.vencillio.rs2.entity.player.Player;
import com.vencillio.rs2.entity.player.net.out.impl.SendMessage;
//Rex//
public class Birdsnest {
public static void treedrop(Player player) {
if (Utility.random(600) == 1) {
player.send(new SendMessage("@red@ A birds nest fell out of the tree.!"));
GroundItemHandler.add(new Item(5074, 1), player.getLocation(), player, player.ironPlayer() ? player : null);
}
}
}
Here's the code explained.
Code:
package com.vencillio.randomevents;
import com.vencillio.core.util.Utility;
import com.vencillio.rs2.entity.player.Player;
import com.vencillio.rs2.entity.player.net.out.impl.SendMessage;
//Author Rex//
public class Birdsnest {
public static void treedrop(Player player) {
if (Utility.random(600) == 1) { // Handles random chance of birds nest falling out of tree
player.send(new SendMessage("@red@ A birds nest falls out of the tree.!")); // Sends Message to Player saying a birds nest fell.
GroundItemHandler.add(new Item(5074, 1), player.getLocation(), player, player.ironPlayer() ? player : null); // Creates the Ground Item
}
}
}
Step Five:
Open
Woodcuttingtask.java
Ctrl-F and search "handleGivingLogs()"
Directly under add
Code:
Birdsnest.treedrop(player);
Don't forget your imports. If you're on an IDE then it will suggest it for you.
If not scroll up to the top where you see all the imports
Add under and one of them
Code:
import com.vencillio.randomevents.Birdsnest;
And you're DONE!
To make birds nest search-able
Open ItemPackets.java
Search for
Code:
case 6199://Mystery Box
You will see
Code:
case 6199://Mystery Box
MysteryBox.open(player);
break;
Under the break;
Add
Code:
case 5074://Birds Nest
player.getInventory().addOrCreateGroundItem(Additemidhere, amount, true);
break;
You could get way more in depth with all of this, but this is a basic template you could say.
Good luck to all!