Thread: [Vencillio] - Adding Birds Nests

Results 1 to 2 of 2
  1. #1 [Vencillio] - Adding Birds Nests 
    Registered Member Rex_'s Avatar
    Join Date
    Jul 2015
    Posts
    43
    Thanks given
    3
    Thanks received
    7
    Rep Power
    0
    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
    Code:
    src.com.vencillio
    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!
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    You don't have to create a new class for a method with 2 lines, you can just create a private method in the Woodcutting class.
    Reply With Quote  
     

  3. Thankful user:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. PI Birds Nest - Random Event
    By TrustedDealer in forum Snippets
    Replies: 40
    Last Post: 11-04-2013, 05:32 PM
  2. Dementhium - Birds Nest Searching
    By iMTiKo in forum Snippets
    Replies: 12
    Last Post: 05-06-2013, 04:15 AM
  3. birds nest
    By deadman536 in forum Help
    Replies: 2
    Last Post: 02-16-2013, 04:17 AM
  4. My Birds nests
    By SinfulPS in forum Show-off
    Replies: 5
    Last Post: 05-19-2012, 12:21 PM
  5. [REQ] birds nest drop sound
    By corndogs in forum Requests
    Replies: 1
    Last Post: 01-24-2012, 03:23 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •