Thread: [667/***]Adding Mystery Boxes

Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1 [667/***]Adding Mystery Boxes 
    Registered Member Coruption's Avatar
    Join Date
    Aug 2010
    Posts
    440
    Thanks given
    115
    Thanks received
    49
    Rep Power
    8
    Alright so I added these to my server but then didn't end up going through with my server because I got bored of it. Yes, it's pretty simple.

    What this does: Adds a mystery box to your server which, when opened gives the player a random item from the array of items you have.

    InventoryOptionsHandler.java:

    Code:
    if (itemId == 6199) {
    		int[] RandomItems = {11732, 4151, 11283, 385, 2347, 1712, 1712, 6585, 1712, 6585, 11732, 11732, 3105, 6918, 6920, 6922, 6924, 6570, 6199, 6199, 10828, 1079, 1127, 20072, 20072, 8850, 10551, 10548, 4087, 15332, 15332, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759, 6585, 5698, 1704, 7378, 7370, 7390, 6737, 6731, 6733, 11716, 6199, 6199, 7386, 7394, 11846, 11850, 11852, 2673, 2669, 2671, 6889, 6914, 2653, 2655, 2657, 1837, 10330, 11848, 11854, 11856, 10332, 10334, 10336, 542, 4087, 4585, 6568, 6568, 10338, 10340, 10342, 10344, 10346, 10348, 10350, 10352, 2581, 13736, 6916, 6918, 6920, 6922, 6924, 3481, 3483, 3486, 2577, 2665, 10452, 10454, 10456, 9470, 2661, 10450, 10446, 10448, 1037, 14595, 14603, 1050, 23679, 23680, 23681, 23682, 23683, 23684, 23685, 23686, 23687, 23688, 23689, 23690, 23691, 23692, 23693, 23694, 23695, 23696, 23697, 23698, 23699, 23700, 1040, 1042, 1044, 1046, 1048, 1050, 1053, 1055, 1057, 11732, 3105, 1712, 1704, 1706, 1079, 1127, 6585, 6570, }; //Other ids go in there as well
    		player.getInventory().deleteItem(6199, 1);
    		for (int i = 0; i < RandomItems.length; i++) 
    		player.getInventory().addItem(RandomItems[i], 1);
    		player.getPackets().sendGameMessage("You've recieved an item from the Mystery Box!");
    		return;
    	}

    Enjoy. I will not be coding 667 anymore
    Quote Originally Posted by maffia-rpg View Post
    I have read some were that apache said it wasn't a malicious. Its a command that shutdowns a computer < or something like that. Matrix didn't had added that. RuneScape did.
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member
    Join Date
    Nov 2011
    Posts
    124
    Thanks given
    55
    Thanks received
    26
    Rep Power
    8
    Thanks for this. Going to use.
    Reply With Quote  
     

  4. #3  
    Super Donator

    Haegely's Avatar
    Join Date
    Jan 2012
    Age
    27
    Posts
    305
    Thanks given
    31
    Thanks received
    40
    Rep Power
    119
    Very simple, but haven't seen it before. Good addition sir.
    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    Apr 2012
    Age
    29
    Posts
    119
    Thanks given
    6
    Thanks received
    4
    Rep Power
    12
    Thanks mate, this will be very useful for my crystal chest (after a few tweaks).
    --This post has been posted via "HTC WILDFIRE S"--
    Reply With Quote  
     

  6. #5  
    Registered Member Own4g3's Avatar
    Join Date
    Mar 2011
    Age
    26
    Posts
    359
    Thanks given
    97
    Thanks received
    132
    Rep Power
    38
    randomitems.length
    ??
    Reply With Quote  
     

  7. #6  
    Registered Member `Basher's Avatar
    Join Date
    May 2011
    Posts
    447
    Thanks given
    136
    Thanks received
    40
    Rep Power
    23
    Good job.
    Cheese
    Reply With Quote  
     

  8. #7  
    Extreme Donator


    Join Date
    Nov 2011
    Posts
    796
    Thanks given
    217
    Thanks received
    137
    Rep Power
    181
    cool i guess
    Reply With Quote  
     

  9. #8  
    Registered Member
    Join Date
    Nov 2011
    Posts
    124
    Thanks given
    55
    Thanks received
    26
    Rep Power
    8
    I added it in but, the boxes dont disappear or give you one of the random items. Any idea on how to fix or what I've done wrong? Thanks
    Reply With Quote  
     

  10. #9  
    Sexy boi <3

    ByteValue's Avatar
    Join Date
    May 2012
    Age
    25
    Posts
    831
    Thanks given
    11
    Thanks received
    80
    Rep Power
    80
    Code:
    for (int i = 0; i < RandomItems.length; i++)
    Would replace int i = Utils.getRandom(159);
    Reply With Quote  
     

  11. #10  
    Registered Member Coruption's Avatar
    Join Date
    Aug 2010
    Posts
    440
    Thanks given
    115
    Thanks received
    49
    Rep Power
    8
    Quote Originally Posted by ByteValue View Post
    Code:
    for (int i = 0; i < RandomItems.length; i++)
    Would replace int i = Utils.getRandom(159);
    Oh thanks I'll remember for next time

    Quote Originally Posted by xCHRiS View Post
    I added it in but, the boxes dont disappear or give you one of the random items. Any idea on how to fix or what I've done wrong? Thanks
    are you sure you added it in the right place? Did you put it under handleItemOption1?
    Quote Originally Posted by maffia-rpg View Post
    I have read some were that apache said it wasn't a malicious. Its a command that shutdowns a computer < or something like that. Matrix didn't had added that. RuneScape did.
    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. [PI] Mystery Boxes
    By Matt0wn3r in forum Snippets
    Replies: 14
    Last Post: 06-15-2014, 10:20 PM
  2. [667]Adding item bonuses[667]
    By nbness2 in forum Tutorials
    Replies: 11
    Last Post: 04-17-2013, 07:14 PM
  3. [667/***]Adding Food
    By Defiled' in forum Snippets
    Replies: 8
    Last Post: 05-22-2012, 12:39 PM
  4. 667 adding objects
    By Zond in forum Help
    Replies: 0
    Last Post: 03-31-2012, 03:42 PM
  5. Adding 667+ items
    By Phat Stacks in forum Help
    Replies: 2
    Last Post: 03-20-2012, 11:06 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
  •