Thread: [718] Matix small dupe fix + brief coding tutorial

Page 1 of 3 123 LastLast
Results 1 to 10 of 29
  1. #1 [718] Matix small dupe fix + brief coding tutorial 
    Cindra 718 Founder
    Four Nations's Avatar
    Join Date
    Sep 2012
    Posts
    1,043
    Thanks given
    77
    Thanks received
    186
    Rep Power
    56
    While i was doing some testing on my server i became aware of a small bug which allowed players to essentially dupe all types of bones, this is done by a player burying a bone and quickly dropping it. Although the fix is simple I'm sure a lot of people aren't aware of the bug so here i am releasing a fix and unlike most tutorials im actually going to explain what each piece of code does so others can learn

    Spoiler for brief coding tutorial about exactly what each piece of code does:

    This is simple a boolean , a setter, and a getter (You can tell which one is which by their name) a boolean is simply a true or false statement, i've made it private so in this tutorial it will be easier to understand the methods. The isBurying() Method is your getter, this method is simply going to return the value of the boolean burying we can use this by adding something like.

    Code:
    if (player.isBurying()) {
    	player.sm("We're burying!");
    } else {
    	return;
    }
    That's simply saying if the player is burying its going to send a player message saying "We're burying!" and the "else" means if the player is doing anything other then burying its simply going to return (do nothing).

    Now, onto the setter, incase you havn't realised yet this is the setter:

    Code:
    	public void setBurying(boolean burying) {
    		this.burying = burying;
    	}
    This particular setter is saying whatever the value of this setter is it will set the burying boolean to value of the setter, as an example we could do something like this..
    Code:
    player.setBurying(true);
    that will set the boolean burying true; and obviously to make it false you can do

    Code:
    player.setBurying(false);
    Okay, thats the end of booleans for now.. We will now be learning what this piece of code does

    Code:
    		if (player.isBurying() && Bone.forId(itemId) != null) {
    			return;
    		}
    Okay, firstly the handleItemOption7 method in your InventoryOptionsHandler class is the drop method, its also used for other items but its not important.
    Now i want you to remember in the above where we learned about setters, getters and booleans.. I'm sure your pretty confident about the basics of those now so here we will be demonstrating a getter along with an "&&" just means "and" or "&" also a !=null (it does what it says, if the item inst equal to null (nothing)).
    So in this statement we're saying if the player is burying and the item is a Bone (If you look at Bone.forId method you will see it refers to all the types of bones in the world) and the item inst equal to null its going to return which basically means its going to do nothing you have to make sure this is put above your piece of code that adds the drop to the ground and deletes the inventory item because we want it to check our code first and if its not burying it will let it drop. Your piece of code that actually drops the item should look something like this:

    Code:
    		player.getInventory().deleteItem(slotId, item);
    		player.setNextAnimation(new Animation(-1));
    		World.addGroundItem(item, new WorldTile(player), player, false, 180, true);
                    player.getPackets().sendSound(2739, 0, 1);
    I'm not going to go deep into that today because that's not what we're learning about today.
    Ideally your code should be placed directly above that.

    Going to make this last bit short and sweet because I've already explained setters above.

    I'm sure if you read all the above you will now know what this code does
    Code:
    player.setBurying(true);
    but if your lazy like me and want a quick and easy answer its saying the player is burying a form of bone.

    now we put this near or around

    Code:
    final ItemDefinitions itemDef = new ItemDefinitions(item.getId());
    because where that line of code is thats where the player starts the burying process, and we put the

    Code:
    player.setBurying(false);
    under

    Code:
    					player.getTemporaryAttributtes().put("current_prayer_xp", total);
    					stop();
    because ideally, that's exactly where the player stops the burying process, so as soon as the player stops the burying process it will tell your server that you are not burying a bone anymore, therefore are able to drop bones now.


    Cool you actually made it to the end of the tutorial! Thanks for reading and if anyone needs more explanations for anything post below and ill make a thread and maybe start you tube. Any Questions ? post below ill get back to you ASAP. Thanks for reading.




    Firstly, add the following in Player.java:

    Code:
            private boolean burying;
       
    	public boolean isBurying() {
    		return burying;
    	}
    
    	public void setBurying(boolean burying) {
    		this.burying = burying;
    	}
    Next head over to your handleItemOption7 method in InventoryOptionsHandler.java and add the following:

    Code:
    		if (player.isBurying() && Bone.forId(itemId) != null) {
    			return;
    		}
    next in your Burying.java in the following method (bury), under this line:

    Code:
    final ItemDefinitions itemDef = new ItemDefinitions(item.getId());
    your going to add the following:

    Code:
    player.setBurying(true);
    lasty, in the same method under this piece of code:

    Code:
    player.getTemporaryAttributtes().put("current_prayer_xp", total);
    					stop();
    your going to add this.

    Code:
    player.setBurying(true);
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    I heal clients


    Join Date
    Apr 2013
    Posts
    680
    Thanks given
    65
    Thanks received
    239
    Rep Power
    108
    Thanks, gonna use!
    NO ONE IS PERFECT
    "No one in this world is pure and perfect, if you avoid people for their little mistakes you will be always alone in this world, so judge less and love more."
    "Ship in the harbor is safe, but that is not what ships are built for."
    Reply With Quote  
     

  4. #3  
    Cindra 718 Founder
    Four Nations's Avatar
    Join Date
    Sep 2012
    Posts
    1,043
    Thanks given
    77
    Thanks received
    186
    Rep Power
    56
    Quote Originally Posted by walied yassen View Post
    Thanks, gonna use!
    No problem.
    Reply With Quote  
     

  5. #4  
    BoomScape #1
    BoomScape's Avatar
    Join Date
    May 2013
    Posts
    2,422
    Thanks given
    289
    Thanks received
    234
    Rep Power
    48
    Swear this has already been released lol?
    Attached image
    Reply With Quote  
     

  6. #5  
    Cindra 718 Founder
    Four Nations's Avatar
    Join Date
    Sep 2012
    Posts
    1,043
    Thanks given
    77
    Thanks received
    186
    Rep Power
    56
    Quote Originally Posted by RuneServerShit View Post
    Swear this has already been released lol?
    not that i know of, i've never seen it.
    Reply With Quote  
     

  7. #6  
    Banned

    Join Date
    Mar 2010
    Posts
    2,218
    Thanks given
    170
    Thanks received
    262
    Rep Power
    0
    The bury fix? or you could just get it to delete the item from the slot before you get the xp.... lol
    Reply With Quote  
     

  8. #7  
    Registered Member

    Join Date
    Aug 2012
    Posts
    1,725
    Thanks given
    907
    Thanks received
    362
    Rep Power
    387
    This has been released in Citelic.
    Reply With Quote  
     

  9. #8  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    I thought matrix has dropping disabled
    Reply With Quote  
     

  10. #9  
    Cindra 718 Founder
    Four Nations's Avatar
    Join Date
    Sep 2012
    Posts
    1,043
    Thanks given
    77
    Thanks received
    186
    Rep Power
    56
    Quote Originally Posted by Teek View Post
    The bury fix? or you could just get it to delete the item from the slot before you get the xp.... lol

    You could yes. But that's not how burying is suppose to work is it..
    Reply With Quote  
     

  11. #10  
    Cindra 718 Founder
    Four Nations's Avatar
    Join Date
    Sep 2012
    Posts
    1,043
    Thanks given
    77
    Thanks received
    186
    Rep Power
    56
    Quote Originally Posted by Bart_ View Post
    This has been released in Citelic.
    Never knew don't download it, I'm sure there are lots of peoples who are using sources other then citelic and this tutorial is for them.
    Reply With Quote  
     

Page 1 of 3 123 LastLast

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. 718 Christmas Cracker Dupe FIX
    By BoomScape in forum Snippets
    Replies: 8
    Last Post: 08-04-2014, 08:28 AM
  2. NRS3 Server V4 718 Grand Exchange Dupe Fix
    By Zombie in forum Buying
    Replies: 21
    Last Post: 05-18-2013, 07:07 AM
  3. [718] GE Dupe Fix?
    By CamperScape in forum Help
    Replies: 0
    Last Post: 12-20-2012, 03:31 AM
  4. [718] Grand Exchange Selling Dupe Fix?
    By CamperScape in forum Tutorials
    Replies: 0
    Last Post: 12-20-2012, 03:25 AM
  5. [PI] Small Dupe Fix
    By I'm A Jerk in forum Tutorials
    Replies: 12
    Last Post: 03-25-2011, 04:56 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
  •