Jump to content

Max Skarz

Member
  • Content count

    77
  • Joined

  • Last visited

About Max Skarz

  • Rank
    Iron Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. [CENTER][IMG]http://i45.tinypic.com/okn3g5.png[/IMG] [SIZE=5][FONT=Lucida Sans Unicode][COLOR="#0000FF"][URL="http://velocityx-rsps.info"]Website[/URL] [URL="http://velocityx-rsps.info/forum"]Forums[/URL] [URL="https://www.dropbox.com/s/pp1qwie71ifnm4k/VelocityX.jar"]Download[/URL][/CENTER][/COLOR][/FONT][/SIZE] [CENTER][COLOR="#FF0000"][SIZE=5]LOOKING FOR STAFF MEMBERS - [URL="http://www.velocityx-rsps.info/forum/forumdisplay.php?fid=22"]APPLY HERE[/URL][/SIZE][/COLOR] [SIZE=7][COLOR="#FF0000"]Features[/COLOR][/SIZE] [COLOR="#00FF00"] [SIZE=4]Bosses[/SIZE][/COLOR] [SIZE=3][COLOR="#00FF00"]-Nex -Bandos -Zamorak -Saradomin -Corporeal Beast -Tormented Demons -King Black Dragon -Queen Black Dragon (4 waves) -And Much More....[/COLOR][/SIZE] [SIZE=4][COLOR="#FF0000"]Minigames[/COLOR][/SIZE] [SIZE=3][COLOR="#FF0000"]-Fight Caves -Fight Kiln -Fight Pits -Dominion Tower -Duel Arena -Zombie game (Soon To Come)[/COLOR][/SIZE] [SIZE=4][COLOR="#00FFFF"] All skills working except Dungeoneering/Construction[/COLOR][/SIZE] [COLOR="#FFFF00"][SIZE=3]Squeal of Fortune Money Pouch Shops Added Barrows[/SIZE][/COLOR] [SIZE=5][COLOR="#0000FF"]Media[/COLOR][/SIZE] [COLOR="#008000"][SIZE=5][IMG]http://i45.tinypic.com/15pfu53.png[/IMG] [IMG]http://i45.tinypic.com/10xeoo1.png[/IMG] [IMG]http://i49.tinypic.com/alsxzt.png[/IMG] [IMG]http://i49.tinypic.com/2diioh0.png[/IMG] MORE PICS WILL BE ADDED SOON[/SIZE][/COLOR][/CENTER]
  2. Downloaded and thanked. Nice job and Good-Luck with Framework. I appreciate you, your work and your source.
  3. [quote name='fatmess']can i sleep with your sister ?[/QUOTE] a stupid thing to say, this aint a brothel mate. How would you like me to say: Can I sleep with your Mum.
  4. ill find a better way and ill edit command
  5. announcement so everyone would know, but if there is better way please tell
  6. Ok This Probly my first time posting a Snippet and my sister was the one who made this, I know it has been in past 317 servers but i havnt seen it in any 718 servers so here u go. [CODE]case "afk": player.setNextAnimation(new Animation(4111)); World.sendWorldMessage("[News] <col=ff0000><shad=000000>" + Utils.formatPlayerNameForDisplay(player.getUsername()) + " Is AFK </col></shad>", false); return true;[/CODE] [CODE]case "back": player.setNextAnimation(new Animation(12575)); World.sendWorldMessage("[News] <col=ff0000><shad=000000>" + Utils.formatPlayerNameForDisplay(player.getUsername()) + " Is Back From Being AFK </col></shad>", false); return true;[/CODE] Have Fun.
  7. [quote name='LostPk']I keep getting errors with this, I don't know if i added the codes right or not. Can somebody please help me with this? My skype is: dallasmurdock (I will pay $20 usd paypal if squeal of fortune is fully coded and working at the end) thanks :)[/QUOTE] I got mine working I will like to help u.
  8. I fixed this, and I was like lol wat a simple problem. But Thanks anyways.
  9. [ATTACH=CONFIG]6670[/ATTACH] EDIT: Got It Working
  10. I was trying to add Squeal of fortune but keep getting this error. [ATTACH=CONFIG]6669[/ATTACH]
  11. Max Skarz

    VPS help

    I can help u add me On Skype novax-owner
  12. Max Skarz

    Shop.java Error

    I fixed it but thanks ill show u the difference a bit later
  13. Max Skarz

    Shop.java Error

    Ok guys I need Help fixing this error I knew how to fix this but I am doing something else now trying change prices from here. [CODE][NovaX] Compiler has started... [NovaX] Please remain silence while compiling... src\com\rs\game\player\content\Shop.java:292: error: cannot find symbol int price = getBuyPrice(item, dq); ^ symbol: variable dq location: class Shop 1 error [NovaX] Compiler has end, no errors found! Press any key to continue . . .[/CODE] [CODE]package com.rs.game.player.content; import java.util.concurrent.CopyOnWriteArrayList; import com.rs.cache.loaders.ItemDefinitions; import com.rs.game.item.Item; import com.rs.game.player.Player; import com.rs.utils.ItemExamines; import com.rs.utils.ItemSetsKeyGenerator; public class Shop { private static final int MAIN_STOCK_ITEMS_KEY = ItemSetsKeyGenerator.generateKey(); private static final int MAX_SHOP_ITEMS = 40; public static final int COINS = 995; private String name; private Item[] mainStock; private int[] defaultQuantity; private Item[] generalStock; private int money; private int amount; private CopyOnWriteArrayList<Player> viewingPlayers; public Shop(String name, int money, Item[] mainStock, boolean isGeneralStore) { viewingPlayers = new CopyOnWriteArrayList<Player>(); this.name = name; this.money = money; this.mainStock = mainStock; defaultQuantity = new int[mainStock.length]; for (int i = 0; i < defaultQuantity.length; i++) defaultQuantity[i] = mainStock[i].getAmount(); if (isGeneralStore && mainStock.length < MAX_SHOP_ITEMS) generalStock = new Item[MAX_SHOP_ITEMS - mainStock.length]; } public boolean isGeneralStore() { return generalStock != null; } public void addPlayer(final Player player) { viewingPlayers.add(player); player.getTemporaryAttributtes().put("Shop", this); player.setCloseInterfacesEvent(new Runnable() { @Override public void run() { viewingPlayers.remove(player); player.getTemporaryAttributtes().remove("Shop"); player.getTemporaryAttributtes().remove("shop_buying"); player.getTemporaryAttributtes().remove("amount_shop"); } }); player.getPackets().sendConfig(118, MAIN_STOCK_ITEMS_KEY); player.getPackets().sendConfig(1496, -1); player.getPackets().sendConfig(532, money); player.getPackets().sendConfig(2565, 0); sendStore(player); player.getPackets().sendGlobalConfig(199, -1); player.getInterfaceManager().sendInterface(1265); for (int i = 0; i < MAX_SHOP_ITEMS; i++) player.getPackets().sendGlobalConfig(946 + i, i < defaultQuantity.length ? defaultQuantity[i]: generalStock != null ? 0 : -1);// prices player.getPackets().sendGlobalConfig(1241, 16750848); player.getPackets().sendGlobalConfig(1242, 15439903); player.getPackets().sendGlobalConfig(741, -1); player.getPackets().sendGlobalConfig(743, -1); player.getPackets().sendGlobalConfig(744, 0); if (generalStock != null) player.getPackets().sendHideIComponent(1265, 19, false); player.getPackets().sendIComponentSettings(1265, 20, 0, getStoreSize() * 6, 1150); player.getPackets().sendIComponentSettings(1265, 26, 0, getStoreSize() * 6, 82903066); sendInventory(player); player.getPackets().sendIComponentText(1265, 85, name); player.getTemporaryAttributtes().put("shop_buying", true); player.getTemporaryAttributtes().put("amount_shop", 1); } public void sendInventory(Player player) { player.getInterfaceManager().sendInventoryInterface(1266); player.getPackets().sendItems(93, player.getInventory().getItems()); player.getPackets().sendUnlockIComponentOptionSlots(1266, 0, 0, 27, 0, 1, 2, 3, 4, 5); player.getPackets().sendInterSetItemsOptionsScript(1266, 0, 93, 4, 7, "Value", "Sell 1", "Sell 5", "Sell 10", "Sell 50", "Examine"); } //cid 67 public void buy(Player player, int clickSlot, int quantity) { if (clickSlot >= getStoreSize()) return; Item item = clickSlot >= mainStock.length ? generalStock[clickSlot - mainStock.length] : mainStock[clickSlot]; if (item == null) return; if (item.getAmount() == 0) { player.getPackets().sendGameMessage( "There is no stock of that item at the moment."); return; } int dq = clickSlot >= mainStock.length ? 0 : defaultQuantity[clickSlot]; int price = getBuyPrice(item, dq); //int price = getBuyPrice(item); int amountCoins = player.getInventory().getItems().getNumberOf(money); int amountInPouch = player.money; int maxPouch = amountInPouch / price; int maxQuantity = amountCoins / price; int buyQ = item.getAmount() > quantity ? quantity : item.getAmount(); boolean enoughCoins = maxQuantity >= buyQ; boolean enoughInPouch = maxPouch >= buyQ; if (!enoughCoins && !enoughInPouch) { player.getPackets().sendGameMessage("You don't have enough coins."); buyQ = maxQuantity; } else if (quantity > buyQ) { player.getPackets().sendGameMessage("The shop has run out of stock."); if (item.getDefinitions().isStackable()) { if (player.getInventory().getFreeSlots() < 1) { player.getPackets().sendGameMessage("Not enough space in your inventory."); return; } } } else { int freeSlots = player.getInventory().getFreeSlots(); if (buyQ > freeSlots) { buyQ = freeSlots; player.getPackets().sendGameMessage("Not enough space in your inventory."); } } if (buyQ != 0) { int totalPrice = price * buyQ; if (amountCoins + price < 2147000001) { if (enoughInPouch) { player.getPackets().sendRunScript(5561, 0, totalPrice); player.money -= totalPrice; player.getInventory().addItem(item.getId(), buyQ); player.refreshMoneyPouch(); } else { player.getInventory().deleteItem(money, totalPrice); player.getInventory().addItem(item.getId(), buyQ); } item.setAmount(item.getAmount() - buyQ); if (item.getAmount() <= 0 && clickSlot >= mainStock.length) generalStock[clickSlot - mainStock.length] = null; refreshShop(); sendInventory(player); } else { player.getPackets().sendGameMessage("You can't have more then 2147M coins in your inventory."); return; } } } public void restoreItems() { boolean needRefresh = false; for (int i = 0; i < mainStock.length; i++) { if (mainStock[i].getAmount() < defaultQuantity[i]) { mainStock[i].setAmount(mainStock[i].getAmount() + 1); needRefresh = true; } else if (mainStock[i].getAmount() > defaultQuantity[i]) { mainStock[i].setAmount(mainStock[i].getAmount() + -1); needRefresh = true; } } if (generalStock != null) { for (int i = 0; i < generalStock.length; i++) { Item item = generalStock[i]; if (item == null) continue; item.setAmount(item.getAmount() - 1); if (item.getAmount() <= 0) generalStock[i] = null; needRefresh = true; } } if (needRefresh) refreshShop(); } private boolean addItem(int itemId, int quantity) { for (Item item : mainStock) { if (item.getId() == itemId) { item.setAmount(item.getAmount() + quantity); refreshShop(); return true; } } if (generalStock != null) { for (Item item : generalStock) { if (item == null) continue; if (item.getId() == itemId) { item.setAmount(item.getAmount() + quantity); refreshShop(); return true; } } for (int i = 0; i < generalStock.length; i++) { if (generalStock[i] == null) { generalStock[i] = new Item(itemId, quantity); refreshShop(); return true; } } } return false; } public void sell(Player player, int slotId, int quantity) { if (player.getInventory().getItemsContainerSize() < slotId) return; Item item = player.getInventory().getItem(slotId); if (item == null) return; int originalId = item.getId(); if (item.getDefinitions().isNoted()) item = new Item(item.getDefinitions().getCertId(), item.getAmount()); if (item.getDefinitions().isDestroyItem() || ItemConstants.getItemDefaultCharges(item.getId()) != -1 || !ItemConstants.isTradeable(item) || item.getId() == money) { player.getPackets().sendGameMessage("You can't sell this item."); return; } int dq = getDefaultQuantity(item.getId()); if (dq == -1 && generalStock == null) { player.getPackets().sendGameMessage( "You can't sell this item to this shop."); return; } int price = getSellPrice(item, dq); int numberOff = player.getInventory().getItems().getNumberOf(originalId); if (quantity > numberOff) quantity = numberOff; if (!addItem(item.getId(), quantity)) { player.getPackets().sendGameMessage("Shop is currently full."); return; } if (player.money + price > 0) { player.getInventory().deleteItem(originalId, quantity); //player.getInventory().addItem(money, price * quantity); player.money += price * quantity; player.getPackets().sendRunScript(5561, 1, price * quantity); } else { player.getPackets().sendGameMessage("You can't have more then 2147483647 coins in your pouch."); return; } } public void sendValue(Player player, int slotId) { if (player.getInventory().getItemsContainerSize() < slotId) return; Item item = player.getInventory().getItem(slotId); if (item == null) return; if (item.getDefinitions().isNoted()) item = new Item(item.getDefinitions().getCertId(), item.getAmount()); if (item.getDefinitions().isNoted() || !ItemConstants.isTradeable(item) || item.getId() == money) { player.getPackets().sendGameMessage("You can't sell this item."); return; } int dq = getDefaultQuantity(item.getId()); if (dq == -1 && generalStock == null) { player.getPackets().sendGameMessage( "You can't sell this item to this shop."); return; } int price = getSellPrice(item, dq); player.getPackets().sendGameMessage( item.getDefinitions().getName() + ": shop will buy for: " + price + " " + ItemDefinitions.getItemDefinitions(money).getName() .toLowerCase() + ". Right-click the item to sell."); } public int getDefaultQuantity(int itemId) { for (int i = 0; i < mainStock.length; i++) if (mainStock[i].getId() == itemId) return defaultQuantity[i]; return -1; } public void sendInfo(Player player, int slotId, boolean isBuying) { if (slotId >= getStoreSize()) return; Item[] stock = isBuying ? mainStock : player.getInventory().getItems().getItems(); Item item = slotId >= stock.length ? generalStock[slotId - stock.length] : stock[slotId]; if (item == null) return; int price = getBuyPrice(item, dq); player.getPackets().sendGameMessage(item.getDefinitions().getName() + ": shop will " + (isBuying ? "sell" : "buy") +" for " + price + " " + ItemDefinitions.getItemDefinitions(money).getName().toLowerCase() + "."); } public int getBuyPrice(Item item, int dq) { switch (item.getId()) { case 239: return 100; break; } return item.getDefinitions().getValue(); } public int getSellPrice(Item item, int dq) { switch (item.getId()) { case 269: return 200; break; case 15270: return 300; break; } return item.getDefinitions().getValue(); } public void sendExamine(Player player, int slotId) { if (slotId >= getStoreSize()) return; Item item = slotId >= mainStock.length ? generalStock[slotId - mainStock.length] : mainStock[slotId]; if (item == null) return; player.getPackets().sendGameMessage(ItemExamines.getExamine(item)); } public void refreshShop() { for (Player player : viewingPlayers) { sendStore(player); player.getPackets().sendIComponentSettings(620, 25, 0, getStoreSize() * 6, 1150); } } public int getStoreSize() { return mainStock.length + (generalStock != null ? generalStock.length : 0); } public void sendStore(Player player) { Item[] stock = new Item[mainStock.length + (generalStock != null ? generalStock.length : 0)]; System.arraycopy(mainStock, 0, stock, 0, mainStock.length); if (generalStock != null) System.arraycopy(generalStock, 0, stock, mainStock.length, generalStock.length); player.getPackets().sendItems(MAIN_STOCK_ITEMS_KEY, stock); } public void sendSellStore(Player player, Item[] inventory) { Item[] stock = new Item[inventory.length + (generalStock != null ? generalStock.length : 0)]; System.arraycopy(inventory, 0, stock, 0, inventory.length); if (generalStock != null) System.arraycopy(generalStock, 0, stock, inventory.length, generalStock.length); player.getPackets().sendItems(MAIN_STOCK_ITEMS_KEY, stock); } /** * Checks if the player is buying an item or selling it. * @param player The player * @param slotId The slot id * @param amount The amount */ public void handleShop(Player player, int slotId, int amount) { boolean isBuying = player.getTemporaryAttributtes().get("shop_buying") != null; if (isBuying) buy(player, slotId, amount); else sell(player, slotId, amount); } public Item[] getMainStock() { return this.mainStock; } public int getAmount() { return this.amount; } public void setAmount(Player player, int amount) { this.amount = amount; player.getPackets().sendIComponentText(1265, 67, String.valueOf(amount)); //just update it here } }[/CODE] ^^^^ Whole Shop.java
×