no one able to help?
|
|
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
but here is rest :SCode:player.getInventory().addItem(new ChanceItem(CRYSTAL_CHEST_REWARDS));
itemonobjecthandler.java
crystalchest.javaCode:} 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; }
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), };
no one able to help?
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; }
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. . .
well it was neccesary xD
It compiled fine the way iobpkbarrage suggested, and looking through the code on this line:
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.Code:if (player.getInventory().contains(989)) { if (!player.getInventory().contains(989)) {
Although with the suggested way iopkbarrage gave it still doesn't work for me and I don't know why.
An introduction thread, It's not an exact requirement is it?
| « [667] Need Play.bat [667] | Client and Server Help » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |