Thread: [742] Mystery Box info?

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 [742] Mystery Box info? 
    Registered Member
    Join Date
    May 2013
    Posts
    546
    Thanks given
    4
    Thanks received
    1
    Rep Power
    11
    How i can send a Local message if someone gets a Santa hat from the box?


    This is atm my message for the player.


    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,417
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    player.sendMessage("");
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2013
    Posts
    546
    Thanks given
    4
    Thanks received
    1
    Rep Power
    11
    I want to send a world message if the player gets like santa hat.. not that
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,417
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Quote Originally Posted by Chaos105 View Post
    I want to send a world message if the player gets like santa hat.. not that
    Oh sorry, I thought you were asking how to send a local message after opening an mbox.
    Code:
    if (reward.contains("santa")) {
    World.sendMessage("");
    }
    ??
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    May 2013
    Posts
    546
    Thanks given
    4
    Thanks received
    1
    Rep Power
    11
    ok. i must edit it much but its work now.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    May 2013
    Posts
    546
    Thanks given
    4
    Thanks received
    1
    Rep Power
    11
    other problem on it, randomly it dont gives you a item but i add all right?



    Like here i got 23/28 items.

    Code:
    } else if(itemId == 18768) {
    int[] RandomReward = {28002, 15443, 15444, 15442, 15441, 111694, 13740, 13742, 13738, 13744, 1050, 1038, 1040, 1042, 1044, 1046, 1048}; 
    player.getInventory().deleteItem(18768, 1);
    int i = Utils.getRandom(RandomReward.length);
    int items = RandomReward[i];
    String name = ItemDefinitions.getItemDefinitions(items).getName();
    player.getInventory().addItem(items, 1);
    player.getPackets().sendGameMessage("You open the mystery box and find..."+name+"!");
    Reply With Quote  
     

  7. #7  
    Husband. Father.
    Loyalty_'s Avatar
    Join Date
    Aug 2013
    Age
    25
    Posts
    1,171
    Thanks given
    74
    Thanks received
    129
    Rep Power
    64
    Sorry for double posting.
    Loyalty_





    Quote Originally Posted by Falconpunch View Post
    Player.java buddy. find init() or something like that and find where it adds the starter and do what someone mentioned above (Although an int is 4 scrublords)
    Reply With Quote  
     

  8. #8  
    Husband. Father.
    Loyalty_'s Avatar
    Join Date
    Aug 2013
    Age
    25
    Posts
    1,171
    Thanks given
    74
    Thanks received
    129
    Rep Power
    64
    Quote Originally Posted by Chaos105 View Post
    other problem on it, randomly it dont gives you a item but i add all right?



    Like here i got 23/28 items.

    Code:
    } else if(itemId == 18768) {
    int[] RandomReward = {28002, 15443, 15444, 15442, 15441, 111694, 13740, 13742, 13738, 13744, 1050, 1038, 1040, 1042, 1044, 1046, 1048}; 
    player.getInventory().deleteItem(18768, 1);
    int i = Utils.getRandom(RandomReward.length);
    int items = RandomReward[i];
    String name = ItemDefinitions.getItemDefinitions(items).getName();
    player.getInventory().addItem(items, 1);
    player.getPackets().sendGameMessage("You open the mystery box and find..."+name+"!");
    Code:
     if (itemId == 18768) {
    			int[] randomItems = {28002, 15443, 15444, 15442, 15441, 111694, 13740, 13742, 13738, 13744, 1050, 1038, 1040, 1042, 1044, 1046, 1048}; 
    	        int i = Utils.getRandom(randomItems.length);
    			player.getInventory().deleteItem(18768, 1);
    	        player.getInventory().addItem(randomItems[i], 1);
    			String reward = ItemDefinitions.getItemDefinitions(randomItems[i]).getName().toLowerCase();
    			player.getInventory().addItem(1, 1);
    			World.sendWorldMessage("" + player.getDisplayName() + " <col=008CFF> has just received a <col=008CFF>"+ reward + " from a mystery box!</col>", false);	
    				return;
    Loyalty_





    Quote Originally Posted by Falconpunch View Post
    Player.java buddy. find init() or something like that and find where it adds the starter and do what someone mentioned above (Although an int is 4 scrublords)
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    May 2013
    Posts
    546
    Thanks given
    4
    Thanks received
    1
    Rep Power
    11
    This is the same just edit the message and others i get errors lol.
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Feb 2011
    Posts
    1,143
    Thanks given
    545
    Thanks received
    108
    Rep Power
    87
    Code:
    if (itemId == 6199) {
    		int[] RandomItems = {11732, 4151, 11283, 385, 2347, 1712, 1712, 6585, 1712, 6585, 11732, 11732, 3105, 6918, 6920, 6922, 6924, 6570, 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);
    		int i = Utils.getRandom(148); //Number of randomItems
    		player.getInventory().addItem(RandomItems[i], 1);
    		player.getPackets().sendGameMessage("You've received an item from the Mystery Box!");
    		return;
    	}
    You're going to have to edit it a little bit, but it works. E.G. edit the id's and edit the message.

    Reply With Quote  
     

Page 1 of 2 12 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. Donation Box (Mystery Box)
    By Project in forum Tutorials
    Replies: 24
    Last Post: 04-24-2014, 03:54 AM
  2. [PI] - Mystery Box: Giving random rewards
    By Sonic chao in forum Snippets
    Replies: 23
    Last Post: 05-23-2012, 01:27 PM
  3. Mystery Box ModelID
    By afrodjman in forum Models
    Replies: 3
    Last Post: 05-03-2012, 09:23 PM
  4. Mystery Box
    By Kelso in forum Help
    Replies: 9
    Last Post: 10-19-2011, 01:57 AM
  5. [317] Mystery Box [317]
    By pyrotic in forum Tutorials
    Replies: 25
    Last Post: 08-18-2011, 12:24 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
  •