Jump to content

Search the Community

Showing results for tags 'crystal'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 8 results

  1. [B]Media what you're adding[/B] [img]http://puu.sh/ajr5y/9624730e9a.jpg[/img] [img]http://puu.sh/ajr8W/3982da82f2.jpg[/img] If you want a object to exchange the crystal keys, you simple call the openChest(c) - method [CODE]CrystalChest.getSingleton().openChest(c);[/CODE] CrystalChest.java [CODE]package server.model.players.content; import java.util.Random; import server.model.players.Client; import server.util.Misc; /** * * @author Fuzen Seth * [MENTION=49618]info[/MENTION] Represents simple crystal chest system. * [MENTION=3199]Sin[/MENTION]ce 20.7.2014 */ public class CrystalChest { /** * The mininum cash reward if the loot is coins. */ private static final int MININUM_CASH_REWARD = 50000; /** * The maxinum cash reward if the loot is coins. */ private static final int MAXINUM_CASH_REWARD = 150000; /** * Rewards. */ private int[] REWARDS = {995, 1712, 3751, 10828 ,1127 ,1079, 1215, 5698}; /** * The singleton. */ private static CrystalChest singleton = new CrystalChest(); /** * The Random instance. */ private Random random = new Random(); /** * Opens the crystal chest. * [MENTION=75098]Para[/MENTION]m c */ public void openChest(Client c) { final int rewardItem = REWARDS[random.nextInt(REWARDS.length - 1)]; if (!c.getItems().playerHasItem(989)) { c.getDH().sendStatement("The chest is locked."); return; } if (rewardItem == 995) c.getItems().addItem(995, (int) Misc.randomDouble(MININUM_CASH_REWARD, MAXINUM_CASH_REWARD)); else c.getItems().addItem(rewardItem, 1); c.getItems().deleteItem(989, 1); c.getDH().sendStatement("You have managed to loot the chest."); c.sendMessage("You loot the crystal chest!"); } /** * Loads crystal chest singleton. * [MENTION=184045]return[/MENTION] */ public static CrystalChest getSingleton() { return singleton; } } [/CODE] creds te the fezenseth
  2. I know it's not done the best way possible & it could be improved massively, this is 2 minutes of work though, so meh. [CODE]package server.model.content; import server.model.players.Client; public class CrystalChest { public static int KEY = 989; public static int DRAGONSTONE = 1631; public static int KEY_HALVE1 = 985; public static int KEY_HALVE2 = 987; public static final int ANIMATION = 881; public static int ChestRewards[] = {1079, 1093, 526, 1969, 371, 2363, 451, KEY_HALVE1, KEY_HALVE2}; public static int randomChestRewards() { return ChestRewards[(int)(Math.random()*ChestRewards.length)]; } public static void makeKey(Client c) { if (c.getItems().playerHasItem(KEY_HALVE1, 1) && c.getItems().playerHasItem(KEY_HALVE2, 1)) { c.getItems().deleteItem(KEY_HALVE1, 1); c.getItems().deleteItem(KEY_HALVE2, 1); c.getItems().addItem(KEY, 1); } } public static void searchChest(Client c) { if (c.getItems().playerHasItem(KEY)) { c.getItems().removeItem(KEY, 1); c.startAnimation(ANIMATION); c.getItems().addItem(DRAGONSTONE, 1); c.getItems().addItem(randomChestRewards(), 1); c.sendMessage("You stick your hand in the chest and pull an item out of the chest."); } else { c.sendMessage("The chest is locked, it won't budge!"); return; } } }[/CODE] How to make looting the chest work, ActionHandler import the newly made class, under FirstObjectClick add [CODE] case ####: CrystalChest.searchChest(c); break;[/CODE] pretty basic though.
  3. Details: This is a crystal key system for 667 / 718, it contains making the key pair and opening the actual chest. This is optimized noob-friendly which means that you can easily change the chest rewards. We can start by adding new java file, we will be calling it: [B] CrystalChest.java, add it to com.rs.game.player.content;[/B] [CODE]package com.rs.game.player.content; import com.rs.game.Animation; import com.rs.game.player.Player; import com.rs.utils.Utils; /** * * @author JazzyYaYaYa | Nexon | Fuzen Seth * */ public class CrystalChest { /** * Player instance */ private transient Player player; private static final Object[] CHEST_REWARDS = {getCHEST_REWARD1(), getCHEST_REWARD2(), getCHEST_REWARD3(), getCHEST_REWARD4(), getCHEST_REWARD5(), getCHEST_REWARD6(), getCHEST_REWARD7(), getCHEST_REWARD8(), getCHEST_REWARD9(), getCHEST_REWARD10(), getCHEST_REWARD11(), getCHEST_REWARD12() }; public static final int[] KEY_HALVES = { 985, 987 }; public static final int KEY = 989; public static final int Animation = 881; private static int[][] CHEST_REWARD1 = { {1631, 1}, {1969, 1}, {995, 2000} }; private static int[][] CHEST_REWARD2 = { {1631, 1} }; private static int[][] CHEST_REWARD3 = { {1631, 1}, {554, 50}, {555, 50}, {556, 50}, {557, 50}, {558, 50}, {559, 50}, {560, 10}, {561, 10}, {562, 10}, {563, 10}, {564, 10} }; private static int[][] CHEST_REWARD4 = { {1631, 1}, {2363, 3} }; private static int[][] CHEST_REWARD5 = { {1631, 1}, {454, 100} }; private static int[][] CHEST_REWARD6 = { {1631, 1}, {441, 150} }; private static int[][] CHEST_REWARD7 = { {1631, 1}, {1603, 2}, {1601, 2} }; private static int[][] CHEST_REWARD8 = { {1631, 1}, {372, 5}, {995, 1000} }; private static int[][] CHEST_REWARD9 = { {1631, 1}, {987, 1}, {995, 750} }; private static int[][] CHEST_REWARD10 = { {1631, 1}, {985, 1}, {995, 750} }; private static int[][] CHEST_REWARD11 = { {1631, 1}, {1183, 1} }; private static int[][] CHEST_REWARD12 = { {1631, 1}, { 1079, 1 } }; public static void makeKey(Player p){ if (p.getInventory().containsItem(toothHalf(), 1) && p.getInventory().containsItem(loopHalf(), 1)){ p.getInventory().deleteItem(toothHalf(), 1); p.getInventory().deleteItem(loopHalf(), 1); p.getInventory().addItem(KEY, 1); p.getPackets().sendGameMessage("You succesfully make a crytal key."); } } public void openChest() { if (!player.getInventory().containsItem(989, 1)) { player.getPackets().sendGameMessage("The chest is securely locked."); return; } else if (player.getInventory().containsItem(989, 1)) { player.getInventory().deleteItem(989, 1); player.setNextAnimation(new Animation(881)); player.getPackets().sendGameMessage("You unlock the chest with your key."); player.getInventory().addItem(995, Utils.random(8230)); player.getInventory().addItem((Integer) CHEST_REWARDS[Utils.random(getLength() - 1)], 1); player.getInventory().refresh(); } } public static int getLength() { return CHEST_REWARDS.length; } /** * Represents the toothHalf of the key. */ public static int toothHalf(){ return KEY_HALVES[0]; } /** * Represent the loop half of the key. */ public static int loopHalf(){ return KEY_HALVES[1]; } public static int[][] getCHEST_REWARD2() { return CHEST_REWARD2; } public static void setCHEST_REWARD2(int[][] cHEST_REWARD2) { CHEST_REWARD2 = cHEST_REWARD2; } public static int[][] getCHEST_REWARD3() { return CHEST_REWARD3; } public static void setCHEST_REWARD3(int[][] cHEST_REWARD3) { CHEST_REWARD3 = cHEST_REWARD3; } public static int[][] getCHEST_REWARD4() { return CHEST_REWARD4; } public static void setCHEST_REWARD4(int[][] cHEST_REWARD4) { CHEST_REWARD4 = cHEST_REWARD4; } public static int[][] getCHEST_REWARD6() { return CHEST_REWARD6; } public static void setCHEST_REWARD6(int[][] cHEST_REWARD6) { CHEST_REWARD6 = cHEST_REWARD6; } public static int[][] getCHEST_REWARD5() { return CHEST_REWARD5; } public static void setCHEST_REWARD5(int[][] cHEST_REWARD5) { CHEST_REWARD5 = cHEST_REWARD5; } public static int[][] getCHEST_REWARD7() { return CHEST_REWARD7; } public static void setCHEST_REWARD7(int[][] cHEST_REWARD7) { CHEST_REWARD7 = cHEST_REWARD7; } public static int[][] getCHEST_REWARD8() { return CHEST_REWARD8; } public static void setCHEST_REWARD8(int[][] cHEST_REWARD8) { CHEST_REWARD8 = cHEST_REWARD8; } public static int[][] getCHEST_REWARD9() { return CHEST_REWARD9; } public static void setCHEST_REWARD9(int[][] cHEST_REWARD9) { CHEST_REWARD9 = cHEST_REWARD9; } public static int[][] getCHEST_REWARD10() { return CHEST_REWARD10; } public static void setCHEST_REWARD10(int[][] cHEST_REWARD10) { CHEST_REWARD10 = cHEST_REWARD10; } public static int[][] getCHEST_REWARD11() { return CHEST_REWARD11; } public static void setCHEST_REWARD11(int[][] cHEST_REWARD11) { CHEST_REWARD11 = cHEST_REWARD11; } public static int[][] getCHEST_REWARD12() { return CHEST_REWARD12; } public static void setCHEST_REWARD12(int[][] cHEST_REWARD12) { CHEST_REWARD12 = cHEST_REWARD12; } public static int[][] getCHEST_REWARD1() { return CHEST_REWARD1; } public static void setCHEST_REWARD1(int[][] cHEST_REWARD1) { CHEST_REWARD1 = cHEST_REWARD1; } } [/CODE] [B] Add this with the other private transients located in Player.java[/B] [CODE] private transient CrystalChest crystalChest;[/CODE] [B]Now scroll down and add this with the other getters.[/B] [CODE] public CrystalChest getCrystalChest() { return crystalChest; }[/CODE] Once you have done them, go into InventoryOptionsHandler.java and find this:[CODE] public static void handleItemOnItem(final Player player, InputStream stream) {[/CODE] Once you have found it add this with other itemonitems: [CODE] if (itemUsedId == 985 && itemUsedWithId == 987) { player.getCrystalChest().makeKey(player); }[/CODE] Now, you can decide your own chest by changing the chestobject id. Add this in ObjectHandler.java [CODE] if (id == YOUR_CHEST_ID_HERE) { player.getCrystalChest().openChest(); } [/CODE] Done, simply replace the "YOUR_CHEST_ID_HERE" with your chest that you want to use. [B]Credits to:[/B] Fuzen Seth Liberty / Robbie - <- Made for Project Insanity I tuned it to 667 / 718
  4. When adding this [url=http://www.runelocus.com/forums/showthread.php?89789-667-amp-718-Crystal-Keys-System]718 [667] & [718] - Crystal Keys System[/url] i got this error [IMG]http://i62.tinypic.com/actv88.png[/IMG] i think i added [QUOTE] private transient CrystalChest crystalChest;[/QUOTE] and [QUOTE]public CrystalChest getCrystalChest() { return crystalChest; } [/QUOTE] wrong please could you help me? here is my player.java without these added :) [url]https://www.dropbox.com/s/fkfh6xtg6m1dbzl/Player.java[/url] if it is that and someone could add them it would be amazing :) <3
  5. I was adding Crystal Chest to my server and I got just a couple of errors, they seem minor but I can not seem to find out what is wrong! Please help me, greatly appreciated. :) [QUOTE]src\com\rs\game\player\Player.java:101: error: cannot find symbol private transient CrystalChest crystalChest; ^ symbol: class CrystalChest location: class Player src\com\rs\game\player\Player.java:231: error: cannot find symbol public CrystalChest getCrystalChest() { ^ symbol: class CrystalChest location: class Player Note: src\com\rs\game\player\Inventory.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors compiled Player folder src\com\rs\game\player\Player.java:101: error: cannot find symbol private transient CrystalChest crystalChest; ^ symbol: class CrystalChest location: class Player src\com\rs\game\player\Player.java:231: error: cannot find symbol public CrystalChest getCrystalChest() { ^ symbol: class CrystalChest location: class Player Note: src\com\rs\game\player\Inventory.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors compiled Server folder src\com\rs\game\player\Player.java:101: error: cannot find symbol private transient CrystalChest crystalChest; ^ symbol: class CrystalChest location: class Player src\com\rs\game\player\Player.java:231: error: cannot find symbol public CrystalChest getCrystalChest() { ^ symbol: class CrystalChest location: class Player Note: src\com\rs\game\player\Inventory.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors compiling Dialogues src\com\rs\game\player\Player.java:101: error: cannot find symbol private transient CrystalChest crystalChest; ^ symbol: class CrystalChest location: class Player src\com\rs\game\player\Player.java:231: error: cannot find symbol public CrystalChest getCrystalChest() { ^ symbol: class CrystalChest location: class Player Note: src\com\rs\game\player\Inventory.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors compiled Main Server Folder src\com\rs\game\player\Player.java:101: error: cannot find symbol private transient CrystalChest crystalChest; ^ symbol: class CrystalChest location: class Player src\com\rs\game\player\Player.java:231: error: cannot find symbol public CrystalChest getCrystalChest() { ^ symbol: class CrystalChest location: class Player Note: src\com\rs\game\player\Inventory.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors compiled Main Server Folder src\com\rs\game\player\Player.java:101: error: cannot find symbol private transient CrystalChest crystalChest; ^ symbol: class CrystalChest location: class Player src\com\rs\game\player\Player.java:231: error: cannot find symbol public CrystalChest getCrystalChest() { ^ symbol: class CrystalChest location: class Player Note: src\com\rs\game\player\Inventory.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors Compiled all Successfully Press any key to continue . . .[/QUOTE]
  6. Hello guys was wondering if someone could help me adding crystal key chest to my server.
  7. I will be showing you a simple CrystalChest system doe Matrix 667/*** [CODE] package com.rs.game.minigames; import com.rs.game.player.Player; import com.rs.game.Animation; import com.rs.utils.Utils; /** * Represents the chest on which the key is used. * @author 'Corey 2010 <[email protected]> */ public class CrystalChest { private static final int[] CHEST_REWARDS = { }; public static final int[] KEY_HALVES = { 985, 987 }; public static final int KEY = 989; public static final int Animation = 881; /** * Represents the key being made. * Using tooth halves. */ public static void makeKey(Player p){ if (p.getInventory().containsItem(toothHalf(), 1) && p.getInventory().containsItem(loopHalf(), 1)){ p.getInventory().deleteItem(toothHalf(), 1); p.getInventory().deleteItem(loopHalf(), 1); p.getInventory().addItem(KEY, 1); p.sendMessage("You succesfully make a crytal key."); } } /** * If the player can open the chest. */ public static boolean canOpen(Player p){ if(p.getInventory().containsItem(KEY, 1)){ return true; }else{ p.sendMessage("<col=FFFF00>This chest is locked.</col>"); return false; } } /** * When the player searches the chest. */ public static void searchChest(final Player p){ if (canOpen(p)){ p.sendMessage("You unlock the chest with your key."); p.getInventory().deleteItem(KEY, 1); p.setNextAnimation(new Animation(Animation)); p.getInventory().addItem(995, Utils.random(8230)); p.getInventory().addItem(CHEST_REWARDS[Utils.random(getLength() - 1)], 1); p.sendMessage("You find some treasure in the chest."); } } public static int getLength() { return CHEST_REWARDS.length; } /** * Represents the toothHalf of the key. */ public static int toothHalf(){ return KEY_HALVES[0]; } /** * Represent the loop half of the key. */ public static int loopHalf(){ return KEY_HALVES[1]; } } [/CODE] InventoryOptionsManager.java [CODE] if (itemUsed.getId() == CrystalChest.toothHalf() && usedWith.getId() == CrystalChest.loopHalf() || itemUsed.getId() == CrystalChest.loopHalf() && usedWith.getId() == CrystalChest.toothHalf()){ CrystalChest.makeKey(player); return; } [/CODE] ObjectHandler.java ItemOnObject method [CODE]}else if (itemId == CrystalChest.KEY && object.getId() == 172) { CrystalChest.searchChest(player); }[/CODE]
  8. 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));[/code] 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; }[/code] 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), };[/code]
×