Thread: crystal key chest dementhium

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 crystal key chest dementhium 
    Registered Member
    Join Date
    Nov 2011
    Posts
    176
    Thanks
    5
    Thanked 6 Times in 4 Posts
    Rep Power
    19
    does anyone know how to make crystal chest work? ive tryed alot of methods im pretty sure this piece is wrong

    import org.dementhium.content.minigames.CrystalChest;

    and yes i do have the import :P

    Code:
    				player.getInventory().addItem(new ChanceItem(CRYSTAL_CHEST_REWARDS));
    but here is rest :S

    itemonobjecthandler.java

    Code:
    		} else if (def.getName().toLowerCase().equals("closed chest")) {
    			if (player.getInventory().contains(989)) {
    				if (!player.getInventory().contains(989)) {
    					player.sendMessage("You do not have a crystal key.");
    					return;
    				}
    				player.getInventory().getContainer().remove(new Item(989));
    				player.getInventory().addItem(new ChanceItem(CRYSTAL_CHEST_REWARDS));
    				player.getInventory().refresh();
    				player.sendMessage("You open the Closed Chest.");
    				return;
    			}
    crystalchest.java

    Code:
    	private static final ChanceItem[] CRYSTAL_CHEST_REWARDS = new ChanceItem[] {
    		new ChanceItem(new Item(995, 2000), 27), new ChanceItem(new Item(1631, 1), 100), new ChanceItem(new Item(1969, 1), 27),
    		new ChanceItem(new Item(441, 150), 8), new ChanceItem(new Item(454, 1), 7), new ChanceItem(new Item(2363, 3), 9), 
    		new ChanceItem(new Item(556, 50), 9), new ChanceItem(new Item(558, 50), 9), new ChanceItem(new Item(559, 50), 9),
    		new ChanceItem(new Item(557, 50), 9), new ChanceItem(new Item(554, 50), 9), new ChanceItem(new Item(555, 50), 9),
    		new ChanceItem(new Item(560, 10), 9), new ChanceItem(new Item(564, 10), 9), new ChanceItem(new Item(562, 10), 9),
    		new ChanceItem(new Item(561, 10), 9), new ChanceItem(new Item(563, 10), 9), 
    		new ChanceItem(new Item(985, 1), 3), new ChanceItem(new Item(987, 1), 3), new ChanceItem(new Item(995, 750), 3),
    		};
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Nov 2011
    Posts
    176
    Thanks
    5
    Thanked 6 Times in 4 Posts
    Rep Power
    19
    no one able to help?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jan 2010
    Posts
    585
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Rep Power
    2
    Code:
    		} else if (def.getName().toLowerCase().equals("closed chest")) {
    				if (!player.getInventory().contains(989)) {
    					player.sendMessage("You do not have a crystal key.");
    					return;
    				}
    				player.getInventory().getContainer().remove(new Item(989));
    				player.getInventory().addItem(new ChanceItem(CRYSTAL_CHEST_REWARDS));
    				player.getInventory().refresh();
    				player.sendMessage("You open the Closed Chest.");
    				return;
    			}
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2011
    Posts
    176
    Thanks
    5
    Thanked 6 Times in 4 Posts
    Rep Power
    19
    that gives this

    Code:
    Compiling Junk...
    src\org\dementhium\net\packethandlers\ItemOnObjectHandler.java:183: error: constructor ChanceItem in class ChanceItem cannot be applied to given types
                                    player.getInventory().addItem(new ChanceItem(CRYSTAL_CHEST_REWARDS));
                                                                  ^
      required: Item,int
      found: ChanceItem[]
      reason: actual and formal argument lists differ in length
    1 error
    Complete
    Druk op een toets om door te gaan. . .
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jan 2010
    Posts
    585
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Rep Power
    2
    Quote Originally Posted by GomuGomuFruit View Post
    that gives this

    Code:
    Compiling Junk...
    src\org\dementhium\net\packethandlers\ItemOnObjectHandler.java:183: error: constructor ChanceItem in class ChanceItem cannot be applied to given types
                                    player.getInventory().addItem(new ChanceItem(CRYSTAL_CHEST_REWARDS));
                                                                  ^
      required: Item,int
      found: ChanceItem[]
      reason: actual and formal argument lists differ in length
    1 error
    Complete
    Druk op een toets om door te gaan. . .
    You aware of it that I've done nothing but removing a unnecessary line?
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Nov 2011
    Posts
    176
    Thanks
    5
    Thanked 6 Times in 4 Posts
    Rep Power
    19
    well it was neccesary xD
    Reply With Quote  
     

  7. #7  
    Registered Member imAntony's Avatar
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by GomuGomuFruit View Post
    well it was neccesary xD
    It compiled fine the way iobpkbarrage suggested, and looking through the code on this line:

    Code:
    		if (player.getInventory().contains(989)) {
    				if (!player.getInventory().contains(989)) {
    You had it checking if the user had the key in the inventory, then checking if they didn't, which to me didn't make any sense.

    Although with the suggested way iopkbarrage gave it still doesn't work for me and I don't know why.
    Reply With Quote  
     

  8. #8  
    Tantalizing

    Join Date
    Apr 2011
    Posts
    436
    Thanks
    105
    Thanked 126 Times in 62 Posts
    Rep Power
    64
    Quote Originally Posted by imAntony View Post
    It compiled fine the way iobpkbarrage suggested, and looking through the code on this line:

    Code:
    		if (player.getInventory().contains(989)) {
    				if (!player.getInventory().contains(989)) {
    You had it checking if the user had the key in the inventory, then checking if they didn't, which to me didn't make any sense.

    Although with the suggested way iopkbarrage gave it still doesn't work for me and I don't know why.
    You could of made an introduction thread for your first post instead of grave digging
    Reply With Quote  
     

  9. #9  
    Registered Member imAntony's Avatar
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    An introduction thread, It's not an exact requirement is it?
    Reply With Quote  
     

  10. #10  
    Tantalizing

    Join Date
    Apr 2011
    Posts
    436
    Thanks
    105
    Thanked 126 Times in 62 Posts
    Rep Power
    64
    Quote Originally Posted by imAntony View Post
    An introduction thread, It's not an exact requirement is it?
    No but it's better than bringing up a thread that is 4 months old.
    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)

Similar Threads

  1. crystal key chest system for dementhium 639
    By Zᴀᴄʜ in forum Help
    Replies: 2
    Last Post: 01-24-2012, 12:18 AM
  2. [z508] My Crystal Key to Chest System.
    By Xeonx in forum Tutorials
    Replies: 9
    Last Post: 09-15-2011, 08:45 AM
  3. [PI] Crystal Chest and Key with Rewards
    By Roboyto in forum Tutorials
    Replies: 19
    Last Post: 07-18-2011, 07:48 AM
  4. Crystal chest V2
    By Volcom in forum Tutorials
    Replies: 18
    Last Post: 12-10-2007, 11:54 PM
  5. fully working crystal chest!
    By Volcom in forum Tutorials
    Replies: 32
    Last Post: 09-11-2007, 01: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
  •