Thread: (Project Insanity/Riotscape) Destroy item

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32
  1. #1 (Project Insanity/Riotscape) Destroy item 
    Banned
    Join Date
    Mar 2011
    Posts
    11
    Thanks given
    0
    Thanks received
    15
    Rep Power
    0
    Hello, today I will be showing you how to add this:


    First, add this in PlayerAssistant.java:
    Code:
    public void destroyInterface(int itemId) {
    		String itemName = c.getItems().getItemName(itemId);
    		String[][] info = {{"Are you sure you want to destroy this item?", "14174"}, {"Yes.", "14175"}, {"No.", "14176"}, {"", "14177"}, {"Put info here", "14182"}, 
    							{"More info here", "14183"}, {itemName, "14184"}};
    		sendFrame34(itemId, 0, 14171, 1);
    		for (int i = 0; i < info.length; i++)
    			sendFrame126(info[i][0], Integer.parseInt(info[i][1]));
    		c.destroyItem = itemId;
    		sendFrame164(14170);
    	}
    	
    	public void destroyItem(int itemId) {
    		String itemName = c.getItems().getItemName(itemId);
    		c.getItems().deleteItem(itemId, 1);
    		c.sendMessage("Your " + itemName + " vanishes as you drop it on the ground.");
    		c.destroyItem = 0;
    	}
    Next, in Config.java, add:
    Code:
    public static final int[] DESTROYABLES 	= 	{10548, 10551}; // Destroyable items
    In DropItem.java under:
    Code:
     if(c.playerItemsN[slot] != 0 && itemId != -1 && c.playerItems[slot] == itemId + 1) {
    Add:
    Code:
    boolean destroyable = false;
    			for (int i : Config.DESTROYABLES) {
    				destroyable = i == itemId;
    				break;
    			}
    			if (destroyable) {
    				c.getPA().destroyInterface(itemId);
    				return;
    			}
    In Player.java add:
    Code:
     public int destroyItem = 0;
    Lastly, in ClickingButtons.java, add:
    Code:
    case 55095:
    				c.getPA().destroyItem(c.destroyItem);
    			case 55096:
    				c.getPA().closeAllWindows();
    			break;
    Hope you enjoy! (Feel free to make a few snippet requests )

    Credits:
    Underoath
    Reply With Quote  
     


  2. #2  
    Registered Member

    Join Date
    Sep 2009
    Age
    24
    Posts
    2,769
    Thanks given
    367
    Thanks received
    187
    Rep Power
    458
    hmm not bad, i might add it latter.
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Mar 2011
    Posts
    11
    Thanks given
    0
    Thanks received
    15
    Rep Power
    0
    NP, hope you like it yo
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2011
    Posts
    719
    Thanks given
    156
    Thanks received
    91
    Rep Power
    32
    Good job, thanks for this
    Reply With Quote  
     

  5. #5  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    28
    Posts
    4,758
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    nice work but for the " more info here " you should of just put " if you break this item " " You will not get it back! " or something like that might use this
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Mar 2011
    Posts
    11
    Thanks given
    0
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by animeking1120 View Post
    nice work but for the " more info here " you should of just put " if you break this item " " You will not get it back! " or something like that might use this
    I put that there so you can write your own info
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Oct 2010
    Posts
    1,731
    Thanks given
    56
    Thanks received
    97
    Rep Power
    0
    Nice job man looks nice
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Mar 2008
    Posts
    1,937
    Thanks given
    131
    Thanks received
    61
    Rep Power
    0
    already had this for a looong time, but good job this is done nicely
    Reply With Quote  
     

  9. #9  
    🍕

    Linus's Avatar
    Join Date
    Dec 2008
    Age
    28
    Posts
    2,778
    Thanks given
    970
    Thanks received
    410
    Rep Power
    0
    added to my list of snippets& tutorials, unique and original, thanks for the share.

    ╠╬╣
    ╦╦
    ╠╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╚╩╩╩╩╩╩╝

    ╠╬╬╬╣

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #10  
    🍕

    Linus's Avatar
    Join Date
    Dec 2008
    Age
    28
    Posts
    2,778
    Thanks given
    970
    Thanks received
    410
    Rep Power
    0
    Also, if you want a custom text for a custom item, you can always use a switch statement and take advantage of frame126, example:

    Code:
    		/**
    		*Custom text for specific items
    		**/
    		switch(itemId) {
    		case 10498: //attractor and accumulator
    		case 10499: //attractor and accumulator
    			sendFrame126("You can get this item again by talking to Ava", 14182);
    			sendFrame126("She is located near the slayer tower in canfis.", 14183);
    		break;
    		}

    ╠╬╣
    ╦╦
    ╠╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╚╩╩╩╩╩╩╝

    ╠╬╬╬╣

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  11. Thankful user:


Page 1 of 4 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. Replies: 33
    Last Post: 07-23-2011, 02:59 PM
  2. Replies: 10
    Last Post: 09-03-2010, 12:01 AM
  3. Replies: 0
    Last Post: 07-17-2010, 05:23 AM
  4. Replies: 2
    Last Post: 05-10-2010, 05:56 PM
  5. Replies: 2
    Last Post: 05-06-2010, 04:58 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •