Jump to content

Search the Community

Showing results for tags 'shop'.



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 214 results

  1. xelion

    Matrix Shop Help

    hello i realy need help whit matrix shops becuse when i try to buy item i cant buy it or sell it or see his price please if u can help me post code in rep or something thank you :D :p ;)
  2. I need help and kinda fast (people are quiten bcuz of this) how do i add a shop that buys everythinh like a shopkeeper source is zenith721 uhm so please help :/
  3. Ok so i added shop that buys everything and the thing that wrong is it buys everything for 1gp and i tried to change it but still not So please help will help me out alot! skype = jenteverpaelen
  4. Title says it all, paying for the matrix 718 shop fix skype: dshtarkyd contact me on here pm as well
  5. I tried to remove some of the items from the shop and i got this error: [ATTACH=CONFIG]6285[/ATTACH] here is the shops. i edited @[email protected]_Rares shop [url]http://dl.dropbox.com/u/93574920/shops.cfg[/url]
  6. hey i recently opened my server 667/721 i was removing some items from shops when ever i remove them and compile the source the shops still the same adding or removing items in shop still the same nothing changed i got to unpackedshops.txt cant find the .java ones so i thought this one is the right ones any1 could help?
  7. I'm really new to all this coding and I've looked up tutorials on how to do this sort of thing but everytime it always comes up wrong. [ATTACH=CONFIG]6280[/ATTACH] As you can see, these prices are way different from the the code that I put into Shop.java as you can see here: public int getBuyPrice(Item item, int dq) { switch (item.getId()) { case 1127: item.getDefinitions().setValue(30000); break; case 1079: item.getDefinitions().setValue(30000); break; case 4151: item.getDefinitions().setValue(120000); break; case 1712: item.getDefinitions().setValue(30000); break; case 7462: item.getDefinitions().setValue(50000); break; case 10828: item.getDefinitions().setValue(30000); break; case 11732: item.getDefinitions().setValue(30000); break; case 20072: item.getDefinitions().setValue(30000); break; } return item.getDefinitions().getValue(); } public int getSellPrice(Item item, int dq) { switch (item.getId()) { case 1127: item.getDefinitions().setValue(15000); break; case 1079: item.getDefinitions().setValue(15000); break; case 4151: item.getDefinitions().setValue(60000); break; case 1712: item.getDefinitions().setValue(15000); break; case 7462: item.getDefinitions().setValue(25000); break; case 10828: item.getDefinitions().setValue(15000); break; case 11732: item.getDefinitions().setValue(15000); break; case 20072: item.getDefinitions().setValue(15000); break; } return item.getDefinitions().getValue(); } If anyone can tell me what is wrong it would be greatly appreciated. Like I said, I'm new to this and I don't want to make a server online I just want to mess around for now. Thanks. P.S. I can't find the option to put java into code on the forums so help with that would be nice too.
  8. All my damn Shop NPC's move and it's a pain in the butt to open the shops. How do I make them stop moving and just stand still? 667/728 Thanks!
  9. itroid

    Ticket shop help

    Hi, i have a agility course where it gives you agility tickets. I want a shop where you buy things with your tickets. not gp. Is there a tut or something i can find on that? I know i think its simple but i forgot >_<
  10. jaideep00

    shop

    [B][I][U]hi guys, i need help with my rsps server its a project insanity and i need help with my shops whenever i change place of shops like mage range shops and i put at my home edge and when i compile and rerun my server ok after we login we cant see theses please someone help me! [SIZE=5]my source and client its Solitude[/SIZE] [SIZE=5]skype:helprsps[/SIZE][/U][/I][/B]
  11. Hey guys!! I'm very experienced with coding 667. I created a g.e, perfected all skills, added prestiging wiht rewards, etc... but in the stupidity section of my brain, I can't seem to get a shop working to be able to sell to it. I made a line in unpackedShops.txt that looks like 91 995 true - Sell Me Stuff - 0 0 And, for some reason, you are unable to sell stuff to him. I also declared the npc as a shop in NPCHandler.java. Any help?
  12. 123654987

    Shop

    When i open a shop in my server i can't buy the item that is stocked there...I don't know why so if anyone knows how to fix this, would you help me? Sell wont work either.
  13. jaideep00

    Pk Shop

    hi guys i need help with adding pk shops and i already put a pk shops but i cant buy item for pk points if i want to buy its only from gp we cane buy i need help with paying 1m rsgp! skype:helprsps
  14. my question is how can i add item prices @ me tokkul shop tried with displee's cache editor but it just fcked up me cache so is there another way changing shop item prices? redevo,
  15. how do i change the shop cordinates in project dungeonfest? pureh,:)
  16. In eclipse 639 I can use the shopediter to make my own shops and everything but I don't know how to change the prices. Items already have prices when I put them in the store and they are really cheap. If anyone can tell me how to change the prices that would be great! Thanks. Edit: Nvm, I figured out how
  17. 667 shop when i click on a item it kicks me? Me shop.java [code]package com.rs.game.player.content; import java.util.HashMap; import java.util.concurrent.CopyOnWriteArrayList; import com.rs.cache.loaders.ItemDefinitions; import com.rs.game.item.Item; import com.rs.game.player.CombatDefinitions; import com.rs.game.player.Player; import com.rs.game.player.Skills; import com.rs.utils.ItemBonuses; 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; public static final int SANTA_HAT = 1050; private String name; private Item[] mainStock; private int[] defaultQuantity; private Item[] generalStock; private int money; 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.getPackets().sendConfig(118, MAIN_STOCK_ITEMS_KEY); // sets // mainstock // items set player.getPackets().sendConfig(1496, -1); // sets samples items set player.getPackets().sendConfig(532, money); sendStore(player); player.getPackets().sendGlobalConfig(199, -1);// unknown player.getInterfaceManager().sendInterface(620); // opens shop 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);// unknown player.getPackets().sendGlobalConfig(1242, 15439903);// unknown player.getPackets().sendGlobalConfig(741, -1);// unknown player.getPackets().sendGlobalConfig(743, -1);// unknown player.getPackets().sendGlobalConfig(744, 0);// unknown if (generalStock != null) player.getPackets().sendHideIComponent(620, 19, false); // unlocks // general // store // icon player.getPackets().sendIComponentSettings(620, 25, 0, getStoreSize() * 6, 1150); // unlocks stock slots sendInventory(player); player.getPackets().sendIComponentText(620, 20, name); } public void sendInventory(Player player) { player.getInterfaceManager().sendInventoryInterface(621); player.getPackets().sendItems(93, player.getInventory().getItems()); player.getPackets().sendUnlockIComponentOptionSlots(621, 0, 0, 27, 0, 1, 2, 3, 4, 5); player.getPackets().sendInterSetItemsOptionsScript(621, 0, 93, 4, 7, "Value", "Sell 1", "Sell 5", "Sell 10", "Sell 50", "Examine"); } public int getSlotId(int clickSlotId) { return clickSlotId / 6; } public void buy(Player player, int clickSlot, int quantity) { int slotId = getSlotId(clickSlot); if (slotId >= getStoreSize()) return; Item item = slotId >= mainStock.length ? generalStock[slotId - mainStock.length] : mainStock[slotId]; if (item == null) return; if (item.getAmount() == 0) { player.getPackets().sendGameMessage( "There is no stock of that item at the moment."); return; } int dq = slotId >= mainStock.length ? 0 : defaultQuantity[slotId]; int price = getBuyPrice(item, dq); int amountCoins = player.getInventory().getItems().getNumberOf(money); int maxQuantity = amountCoins / price; int buyQ = item.getAmount() > quantity ? quantity : item.getAmount(); boolean enoughCoins = maxQuantity >= buyQ; if (!enoughCoins) { 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; player.getInventory().deleteItem(money, totalPrice); player.getInventory().addItem(item.getId(), buyQ); item.setAmount(item.getAmount() - buyQ); if (item.getAmount() <= 0 && slotId >= mainStock.length) generalStock[slotId - mainStock.length] = null; refreshShop(); sendInventory(player); } } 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 == 0 && 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; } player.getInventory().deleteItem(originalId, quantity); player.getInventory().addItem(money, price * quantity); } 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 == 0 && 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 0; } public void sendInfo(Player player, int clickSlot) { int slotId = getSlotId(clickSlot); if (slotId >= getStoreSize()) return; Item item = slotId >= mainStock.length ? generalStock[slotId - mainStock.length] : mainStock[slotId]; if (item == null) return; player.getTemporaryAttributtes().put("ShopSelectedSlot", clickSlot); int dq = slotId >= mainStock.length ? 0 : defaultQuantity[slotId]; int price = getBuyPrice(item, dq); player.getPackets().sendGameMessage( item.getDefinitions().getName() + ": current costs " + price + " " + ItemDefinitions.getItemDefinitions(money).getName() .toLowerCase() + "."); player.getInterfaceManager().sendInventoryInterface(449); player.getPackets().sendGlobalConfig(741, item.getId()); player.getPackets().sendGlobalConfig(743, money); player.getPackets().sendUnlockIComponentOptionSlots(449, 15, -1, 0, 0, 1, 2, 3, 4); // unlocks buy player.getPackets().sendGlobalConfig(744, price); player.getPackets().sendGlobalConfig(745, 0); player.getPackets().sendGlobalConfig(746, -1); player.getPackets().sendGlobalConfig(168, 98); player.getPackets().sendGlobalString(25, ItemExamines.getExamine(item)); player.getPackets().sendGlobalString(34, ""); // quest id for some items int[] bonuses = ItemBonuses.getItemBonuses(item.getId()); if (bonuses != null) { HashMap<Integer, Integer> requiriments = item.getDefinitions() .getWearingSkillRequiriments(); if (requiriments != null && !requiriments.isEmpty()) { String reqsText = ""; for (int skillId : requiriments.keySet()) { if (skillId > 24 || skillId < 0) continue; int level = requiriments.get(skillId); if (level < 0 || level > 120) continue; boolean hasReq = player.getSkills().getLevelForXp(skillId) >= level; reqsText += "<br>" + (hasReq ? "<col=00ff00>" : "<col=ff0000>") + "Level " + level + " " + Skills.SKILL_NAME[skillId]; } player.getPackets().sendGlobalString(26, "<br>Worn on yourself, requiring: " + reqsText); } else player.getPackets() .sendGlobalString(26, "<br>Worn on yourself"); player.getPackets().sendGlobalString( 35, "<br>Attack<br><col=ffff00>+" + bonuses[CombatDefinitions.STAB_ATTACK] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.SLASH_ATTACK] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.CRUSH_ATTACK] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.MAGIC_ATTACK] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.RANGE_ATTACK] + "<br><col=ffff00>---" + "<br>Strength" + "<br>Ranged Strength" + "<br>Magic Damage" + "<br>Absorve Melee" + "<br>Absorve Magic" + "<br>Absorve Ranged" + "<br>Prayer Bonus"); player.getPackets() .sendGlobalString(36, "<br><br>Stab<br>Slash<br>Crush<br>Magic<br>Ranged<br>Summoning"); player.getPackets().sendGlobalString( 52, "<<br>Defence<br><col=ffff00>+" + bonuses[CombatDefinitions.STAB_DEF] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.SLASH_DEF] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.CRUSH_DEF] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.MAGIC_DEF] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.RANGE_DEF] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.SUMMONING_DEF] + "<br><col=ffff00>+" + bonuses[CombatDefinitions.STRENGTH_BONUS] + "<br><col=ffff00>" + bonuses[CombatDefinitions.RANGED_STR_BONUS] + "<br><col=ffff00>" + bonuses[CombatDefinitions.MAGIC_DAMAGE] + "%<br><col=ffff00>" + bonuses[CombatDefinitions.ABSORVE_MELEE_BONUS] + "%<br><col=ffff00>" + bonuses[CombatDefinitions.ABSORVE_MAGE_BONUS] + "%<br><col=ffff00>" + bonuses[CombatDefinitions.ABSORVE_RANGE_BONUS] + "%<br><col=ffff00>" + bonuses[CombatDefinitions.PRAYER_BONUS]); } else player.getPackets().sendGlobalString(26, ""); } public int getBuyPrice(Item item, int dq) { switch (item.getId()) { case 1050://item id item.getDefinitions().setValue(5000);//buying price break; case 20135://item id item.getDefinitions().setValue(1500);//buying price break; case 20139://item id item.getDefinitions().setValue(1500);//buying price break; case 20143://item id item.getDefinitions().setValue(1500);//buying price break; case 20159://item id item.getDefinitions().setValue(1500);//buying price break; case 20163://item id item.getDefinitions().setValue(1500);//buying price break; case 20167://item id item.getDefinitions().setValue(1500);//buying price break; case 20147://item id item.getDefinitions().setValue(1500);//buying price break; case 20151://item id item.getDefinitions().setValue(1500);//buying price break; case 20155://item id item.getDefinitions().setValue(1500);//buying price break; case 1038://item id item.getDefinitions().setValue(8000);//buying price break; case 1040://item id item.getDefinitions().setValue(10000);//buying price break; case 1042://item id item.getDefinitions().setValue(6500);//buying price break; case 1044://item id item.getDefinitions().setValue(14000);//buying price break; case 1046://item id item.getDefinitions().setValue(16000);//buying price break; case 1048://item id item.getDefinitions().setValue(20000);//buying price break; case 12093://item id item.getDefinitions().setValue(25);//buying price break; case 12790://item id item.getDefinitions().setValue(20);//buying price break; case 22494://item id item.getDefinitions().setValue(20000);//buying price break; case 13734://item id item.getDefinitions().setValue(10);//buying price break; case 13738://item id item.getDefinitions().setValue(700);//buying price break; case 13736://item id item.getDefinitions().setValue(100);//buying price break; case 13740://item id item.getDefinitions().setValue(2000);//buying price break; case 13742://item id item.getDefinitions().setValue(1250);//buying price break; case 20769://item id item.getDefinitions().setValue(7000);//buying price break; case 15332://item id item.getDefinitions().setValue(25);//buying price break; case 13887://item id item.getDefinitions().setValue(300);//buying price break; case 13893://item id item.getDefinitions().setValue(400);//buying price break; case 13884://item id item.getDefinitions().setValue(500);//buying price break; case 13890://item id item.getDefinitions().setValue(500);//buying price break; } switch (item.getId()) { /* -------------------- Custom item prices ------------------------------ */ case 11694: // ags item.getDefinitions().setValue(15000); // 15k break; case 11696: // bgs item.getDefinitions().setValue(10000); // 10k break; case 21512: // jad item.getDefinitions().setValue(1); // 1gp break; case 6570: // fcape item.getDefinitions().setValue(1000); // 1k break; case 20769: // complet cape item.getDefinitions().setValue(10000); // 10k break; case 21371: // vine whip item.getDefinitions().setValue(3000); // 3k break; case 4151: // whip item.getDefinitions().setValue(100); // 100 break; case 15098: // dice item.getDefinitions().setValue(100); // 100 break; case 2577: // ranger boots item.getDefinitions().setValue(1000); // 1k break; case 19335: // fury (or) item.getDefinitions().setValue(1000); // 1k break; case 18335: // arcane stream item.getDefinitions().setValue(5000); // 5k break; case 15220: // bring (i) item.getDefinitions().setValue(1000);// 1k break; case 13899: // vls item.getDefinitions().setValue(8000); // 8k break; case 13905: // vesta's spear item.getDefinitions().setValue(8000); // 8k break; case 13896: // stat helm item.getDefinitions().setValue(3000); // 3k break; case 13902: // stat hammer item.getDefinitions().setValue(6000); //6k break; case 18349: // rapier item.getDefinitions().setValue(20000); // 20k break; case 18351: // cls item.getDefinitions().setValue(20000); // 20k break; case 18353: // cmaul item.getDefinitions().setValue(20000); // 20k break; case 18357: // cbow item.getDefinitions().setValue(20000); // 20k break; case 1050: // santa item.getDefinitions().setValue(500); //500 break; case 7462: // bgloves item.getDefinitions().setValue(100); // 100 break; case 7458: // mith gloves item.getDefinitions().setValue(50); // 50 break; case 15386: // sol item.getDefinitions().setValue(5000); // 5k break; case 6889: // mbook item.getDefinitions().setValue(1500); // 1.5k break; case 13734: // sprit shield item.getDefinitions().setValue(2500); // 2.5k break; case 13736: // blessed item.getDefinitions().setValue(2500); // 2.5k break; case 13738: // arcane item.getDefinitions().setValue(25000); // 25k break; case 13740: // divine item.getDefinitions().setValue(25000); // 25k break; case 13742: // ely item.getDefinitions().setValue(25000); // 25k break; case 13744: // spec item.getDefinitions().setValue(25000); // 25k break; case 22494: // polypore item.getDefinitions().setValue(30000); // 30k break; case 20771: // compelt item.getDefinitions().setValue(10000); // 10k break; /* ---------------------- End --------------------------------------------- */ case 11724: item.getDefinitions().setValue(85000000); break; case 11726: item.getDefinitions().setValue(90000000); break; case 11728: item.getDefinitions().setValue(30000000); break; case 4708://barrows starts here item.getDefinitions().setValue(10000000);//10m a pice break; case 4710: item.getDefinitions().setValue(10000000); break; case 4712: item.getDefinitions().setValue(10000000); break; case 4714: item.getDefinitions().setValue(10000000); break; case 4716: item.getDefinitions().setValue(10000000); break; case 4718: item.getDefinitions().setValue(10000000); break; case 4720: item.getDefinitions().setValue(10000000); break; case 4722: item.getDefinitions().setValue(10000000); break; case 4724: item.getDefinitions().setValue(10000000); break; case 4726: item.getDefinitions().setValue(10000000); break; case 4728: item.getDefinitions().setValue(10000000); break; case 4730: item.getDefinitions().setValue(10000000); break; case 4732: item.getDefinitions().setValue(10000000); break; case 4734: item.getDefinitions().setValue(10000000); break; case 4736: item.getDefinitions().setValue(10000000); break; case 4738: item.getDefinitions().setValue(10000000); break; case 4745: item.getDefinitions().setValue(10000000); break; case 9790: item.getDefinitions().setValue(200000); break; case 11700: item.getDefinitions().setValue(50000); break; case 14484: item.getDefinitions().setValue(100000); break; case 1044: item.getDefinitions().setValue(1000000); break; case 4747: item.getDefinitions().setValue(10000000); break; case 4749: item.getDefinitions().setValue(10000000); break; case 4751: item.getDefinitions().setValue(10000000); break; case 4753: item.getDefinitions().setValue(10000000); break; case 4755: item.getDefinitions().setValue(10000000); break; case 4757: item.getDefinitions().setValue(10000000); break; case 4759: item.getDefinitions().setValue(10000000); break; case 21736: item.getDefinitions().setValue(10000000); break; case 21744: item.getDefinitions().setValue(10000000); break; case 21752: item.getDefinitions().setValue(10000000); break; case 21760: item.getDefinitions().setValue(10000000); break;//barrows ends case 6585: item.getDefinitions().setValue(10000000); break; case 11718: item.getDefinitions().setValue(30000000); break; case 11720: item.getDefinitions().setValue(65000000); break; case 11722: item.getDefinitions().setValue(65000000); break; case 6685: item.getDefinitions().setValue(10000); break; case 11698: item.getDefinitions().setValue(25000000); break; case 11730: item.getDefinitions().setValue(14000000); break; case 11716: item.getDefinitions().setValue(10000000); break; // edge shop ends case 15486://mage shop starts here item.getDefinitions().setValue(5000000); break; case 6916: item.getDefinitions().setValue(5000000); break; case 6918: item.getDefinitions().setValue(17000000); break; case 6924: item.getDefinitions().setValue(12000000); break; case 6922: item.getDefinitions().setValue(17000000); break; case 6920: item.getDefinitions().setValue(3000000); break; case 6914: item.getDefinitions().setValue(6000000); break; // mage ends here case 2497://range shop starts here item.getDefinitions().setValue(2000); break; case 2491: item.getDefinitions().setValue(5000); break; case 2581: item.getDefinitions().setValue(2500000); break; case 11235: item.getDefinitions().setValue(5000000); break; case 11212: item.getDefinitions().setValue(500); break; case 9341: item.getDefinitions().setValue(300); break; case 4212: item.getDefinitions().setValue(200000); break; case 10499: item.getDefinitions().setValue(100000); break; case 9144: item.getDefinitions().setValue(800); break;//range shop ends } return item.getDefinitions().getValue(); } public int getSellPrice(Item item, int dq) { switch (item.getId()) { case 11694: // ags item.getDefinitions().setValue(15000); // 15k break; case 11696: // bgs item.getDefinitions().setValue(10000); // 10k break; case 6570: // fcape item.getDefinitions().setValue(1000); // 1k break; case 21371: // vine whip item.getDefinitions().setValue(3000); // 3k break; case 20769: // complet cape item.getDefinitions().setValue(10000); // 10k break; case 15098: // dice item.getDefinitions().setValue(100); // 100 break; case 4151: // whip item.getDefinitions().setValue(100); // 100 break; case 2577: // ranger boots item.getDefinitions().setValue(1000); // 1k break; case 19335: // fury (or) item.getDefinitions().setValue(1000); // 1k break; case 18335: // arcane stream item.getDefinitions().setValue(5000); // 5k break; case 15220: // bring (i) item.getDefinitions().setValue(1000);// 1k break; case 13899: // vls item.getDefinitions().setValue(8000); // 8k break; case 13905: // vesta's spear item.getDefinitions().setValue(8000); // 8k break; case 13896: // stat helm item.getDefinitions().setValue(3000); // 3k break; case 13902: // stat hammer item.getDefinitions().setValue(6000); //6k break; case 18349: // rapier item.getDefinitions().setValue(20000); // 20k break; case 18351: // cls item.getDefinitions().setValue(20000); // 20k break; case 18353: // cmaul item.getDefinitions().setValue(20000); // 20k break; case 18357: // cbow item.getDefinitions().setValue(20000); // 20k break; case 1050: // santa item.getDefinitions().setValue(500); //500 break; case 7462: // bgloves item.getDefinitions().setValue(100); // 100 break; case 7458: // mith gloves item.getDefinitions().setValue(50); // 50 break; case 15386: // sol item.getDefinitions().setValue(5000); // 5k break; case 13734: // sprit shield item.getDefinitions().setValue(2500); // 2.5k break; case 13736: // blessed item.getDefinitions().setValue(2500); // 2.5k break; case 13738: // arcane item.getDefinitions().setValue(25000); // 25k break; case 13740: // divine item.getDefinitions().setValue(25000); // 25k break; case 13742: // ely item.getDefinitions().setValue(25000); // 25k break; case 13744: // spec item.getDefinitions().setValue(25000); // 25k break; case 22494: // polypore item.getDefinitions().setValue(30000); // 30k break; case 20771: // compelt item.getDefinitions().setValue(10000); // 10k break; /* ---------------------- End --------------------------------------------- */ case 11724: } return item.getDefinitions().getValue() / 2; } public void sendExamine(Player player, int clickSlot) { int slotId = getSlotId(clickSlot); 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); } }[/code] PLs helP!
  18. so i tryed and it doesnt work right so i really need somebody who can help me add this shop to the shop keeper
  19. Steve

    Shop Editor

    Released with Dementhium but here it is separate. It's pretty powerful actually, you can drag items around to change slots, have sample items, add new items, shops, anything really... [CODE] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * ShopEditor.java * * Created on Jun 28, 2011, 7:53:23 PM */ package org.xealusion.tools; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.io.IOException; import java.io.RandomAccessFile; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.DefaultListModel; import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.event.MouseInputListener; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.plaf.basic.BasicTableUI; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import org.xealusion.cache.Cache; import org.xealusion.model.Container; import org.xealusion.model.Item; import org.xealusion.model.definition.ItemDefinition; import org.xealusion.model.player.Shop; /** * @author Stephen */ public class ShopEditor extends javax.swing.JFrame { /** * */ private static final long serialVersionUID = 1L; public class TableUI extends BasicTableUI { private boolean draggingRow = false; private int startDragPoint; private int dyOffset; @Override protected MouseInputListener createMouseInputListener() { return new DragDropRowMouseInputHandler(); } @Override public void paint(Graphics g, JComponent c) { super.paint(g, c); if (draggingRow) { g.setColor(table.getParent().getBackground()); Rectangle cellRect = table.getCellRect(table.getSelectedRow(), 0, false); g.copyArea(cellRect.x, cellRect.y, table.getWidth(), table.getRowHeight(), cellRect.x, dyOffset); if (dyOffset < 0) { g.fillRect(cellRect.x, cellRect.y + (table.getRowHeight() + dyOffset), table.getWidth(), (dyOffset * -1)); } else { g.fillRect(cellRect.x, cellRect.y, table.getWidth(), dyOffset); } } } class DragDropRowMouseInputHandler extends MouseInputHandler { @Override public void mousePressed(MouseEvent e) { super.mousePressed(e); startDragPoint = (int)e.getPoint().getY(); } @Override public void mouseDragged(MouseEvent e) { int fromRow = table.getSelectedRow(); if (fromRow >= 0) { draggingRow = true; int rowHeight = table.getRowHeight(); int middleOfSelectedRow = (rowHeight * fromRow) + (rowHeight / 2); int toRow = -1; int yMousePoint = (int)e.getPoint().getY(); if (yMousePoint < (middleOfSelectedRow - rowHeight)) { // Move row up toRow = fromRow - 1; } else if (yMousePoint > (middleOfSelectedRow + rowHeight)) { // Move row down toRow = fromRow + 1; } if (toRow >= 0 && toRow < table.getRowCount()) { TableModel model = table.getModel(); for (int i = 0; i < model.getColumnCount(); i++) { Object fromValue = model.getValueAt(fromRow, i); Object toValue = model.getValueAt(toRow, i); model.setValueAt(toValue, fromRow, i); model.setValueAt(fromValue, toRow, i); } table.setRowSelectionInterval(toRow, toRow); startDragPoint = yMousePoint; } dyOffset = (startDragPoint - yMousePoint) * -1; table.repaint(); } } @Override public void mouseReleased(MouseEvent e){ super.mouseReleased(e); draggingRow = false; table.repaint(); } } } @SuppressWarnings("rawtypes") private DefaultListModel defaultModel = new DefaultListModel(); private ArrayList<Shop> shops = new ArrayList<Shop>(); @SuppressWarnings("unused") private Shop currentShop; Class<?>[] types = new Class[]{java.lang.Integer.class, java.lang.Integer.class }; /** * Creates new form ShopEditor */ public ShopEditor() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException ex) { Logger.getLogger(ShopEditor.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(ShopEditor.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(ShopEditor.class.getName()).log(Level.SEVERE, null, ex); } catch (UnsupportedLookAndFeelException ex) { Logger.getLogger(ShopEditor.class.getName()).log(Level.SEVERE, null, ex); } try { Cache.init(); ItemDefinition.init(); } catch (IOException e) { e.printStackTrace(); } initComponents(); load(); } /** * This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("all") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jDialog1 = new javax.swing.JDialog(); jTextField2 = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); jButton8 = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); jList1 = new javax.swing.JList(); jLabel1 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jSeparator1 = new javax.swing.JSeparator(); jLabel2 = new javax.swing.JLabel(); jCheckBox1 = new javax.swing.JCheckBox(); jScrollPane3 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); jLabel3 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jDialog1.setMinimumSize(new java.awt.Dimension(400, 120)); jLabel5.setText("Item ids"); jButton8.setText("Done"); jButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton8ActionPerformed(evt); } }); javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane()); jDialog1.getContentPane().setLayout(jDialog1Layout); jDialog1Layout.setHorizontalGroup( jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jDialog1Layout.createSequentialGroup() .addContainerGap() .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) .addComponent(jLabel5) .addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)) .addContainerGap()) ); jDialog1Layout.setVerticalGroup( jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jDialog1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton8) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Dementhium Shop Editor"); jList1.setModel(defaultModel); jList1.setToolTipText("Use the delete key on a selected shop to delete it"); jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { jList1ValueChanged(evt); } }); jScrollPane1.setViewportView(jList1); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); jLabel1.setText("Shops"); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] {}, new String [] {"Item ID", "Amount"} ) { Class[] types = new Class [] {java.lang.Integer.class, java.lang.Integer.class }; boolean[] canEdit = new boolean [] {true, true }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); jTable1.setUI(new TableUI()); jScrollPane2.setViewportView(jTable1); jButton1.setText("Add"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Delete"); jButton2.setToolTipText("Deletes the selected item"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("Save"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton4.setText("Add"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); jLabel2.setText("Shop Items"); jCheckBox1.setText("General Store"); jCheckBox1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { shops.get(jList1.getSelectedIndex()).setGeneral(jCheckBox1.isSelected()); } }); jTable2.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "", "Item ID", "Amount" } ) { Class[] types = new Class [] { java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class }; boolean[] canEdit = new boolean [] { false, true, true }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); jScrollPane3.setViewportView(jTable2); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); jLabel3.setText("Sample Items"); jTextField1.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { jTextField1TextUpdate(e); } public void removeUpdate(DocumentEvent e) { jTextField1TextUpdate(e); } public void insertUpdate(DocumentEvent e) { jTextField1TextUpdate(e); } }); jLabel4.setText("Shop name"); jButton5.setText("Add"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jButton6.setText("Delete"); jButton6.setToolTipText("Deletes the selected item"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jButton7.setText("Add bulk"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jMenu1.setText("File"); jMenuItem1.setText("Dump shops"); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addComponent(jLabel1) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, 0, 0, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton6) .addGap(27, 27, 27) .addComponent(jCheckBox1)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE) .addComponent(jButton7)) .addComponent(jLabel3)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jLabel2) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jButton4))) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton7)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox1) .addComponent(jButton6) .addComponent(jButton5)))) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents protected void jButton2ActionPerformed(ActionEvent evt) { for (int i = 0; i < jTable1.getSelectedRows().length; i++) { int index = jTable1.getSelectedRows()[i]; System.out.println(index); shops.get(jList1.getSelectedIndex()).removeItem(index); } shops.get(jList1.getSelectedIndex()).getShop().shift(); reloadTable(shops.get(jList1.getSelectedIndex()).getShop()); } protected void jButton3ActionPerformed(ActionEvent evt) { try { int selectedIndex = jList1.getSelectedIndex(); saveFile(); jList1.setSelectedIndex(selectedIndex); } catch (IOException e) { e.printStackTrace(); } } private void saveFile() throws IOException { RandomAccessFile shopFile = new RandomAccessFile("./data/shops.bin", "rw"); shopFile.writeShort(shops.size()); for (int shopId = 0; shopId < shops.size(); shopId++) { Shop s = shops.get(shopId); shopFile.writeShort(s.getId()); shopFile.writeByte(s.getShop().getTakenSlots()); shopFile.writeByte(s.isGeneralStore() ? 1 : 0); for (int item = 0; item < s.getShop().getTakenSlots(); item++) { shopFile.writeShort(s.getShop().get(item).getId()); shopFile.writeInt(s.getShop().get(item).getAmount()); } shopFile.writeByte(s.freeItems.getTakenSlots()); for (int item = 0; item < s.freeItems.getTakenSlots(); item++) { shopFile.writeShort(s.freeItems.get(item).getId()); shopFile.writeInt(s.freeItems.get(item).getAmount()); } shopFile.writeUTF(s.getName()); } shopFile.close(); shops.clear(); load(); } @SuppressWarnings("unchecked") private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed Shop shop = new Shop(Integer.parseInt(JOptionPane.showInputDialog("Enter NPC ID to use this shop")), false, new int[]{1}, new int[]{1}, null, null, false); shops.add(shop); defaultModel.addElement(shop.getId()); jList1.setSelectedIndex(defaultModel.getSize() - 1); reloadTable(shop.getShop()); reloadSamples(shop.freeItems); }//GEN-LAST:event_jButton4ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed shops.get(jList1.getSelectedIndex()).addItem(1, 1); reloadTable(shops.get(jList1.getSelectedIndex()).getShop()); }//GEN-LAST:event_jButton1ActionPerformed private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1ValueChanged if (jList1.getSelectedIndex() > -1) { reloadTable(shops.get(jList1.getSelectedIndex()).getShop()); reloadSamples(shops.get(jList1.getSelectedIndex()).freeItems); jTextField1.setText(shops.get(jList1.getSelectedIndex()).getName()); jCheckBox1.setSelected(shops.get(jList1.getSelectedIndex()).isGeneralStore()); } }//GEN-LAST:event_jList1ValueChanged public void jTextField1TextUpdate(DocumentEvent event) { shops.get(jList1.getSelectedIndex()).setName(jTextField1.getText()); } private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed shops.get(jList1.getSelectedIndex()).addSample(1, 1); reloadSamples(shops.get(jList1.getSelectedIndex()).freeItems); }//GEN-LAST:event_jButton5ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed for (int i = 0; i < jTable2.getSelectedRows().length; i++) { int index = jTable2.getSelectedRows()[i]; shops.get(jList1.getSelectedIndex()).freeItems.set(index, null); } shops.get(jList1.getSelectedIndex()).freeItems.shift(); reloadSamples(shops.get(jList1.getSelectedIndex()).freeItems); }//GEN-LAST:event_jButton6ActionPerformed private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed String input = JOptionPane.showInputDialog(this, "Enter the ids(split by ',')"); if (input == null) { return; } try { String[] idsstring = input.replaceAll(" ", "").split(","); for (String element : idsstring) { int id = Integer.parseInt(element); shops.get(jList1.getSelectedIndex()).addItem(id, 1); shops.get(jList1.getSelectedIndex()).set(shops.get(jList1.getSelectedIndex()).getShop().getFreeSlot() - 1, new Item(id, 1000)); } reloadTable(shops.get(jList1.getSelectedIndex()).getShop()); } catch (Exception e) { JOptionPane.showMessageDialog(this, "Errrrrrorrr"); } }//GEN-LAST:event_jButton7ActionPerformed private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed }//GEN-LAST:event_jButton8ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { new ShopEditor().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JButton jButton8; private javax.swing.JCheckBox jCheckBox1; private javax.swing.JDialog jDialog1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; @SuppressWarnings("rawtypes") private javax.swing.JList jList1; private javax.swing.JMenu jMenu1; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JSeparator jSeparator1; private javax.swing.JTable jTable1; private javax.swing.JTable jTable2; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; // End of variables declaration//GEN-END:variables private void load() { try { RandomAccessFile buffer = new RandomAccessFile("data/shops.bin", "r"); // ByteBuffer buffer = shopFile.getChannel().map(MapMode.READ_ONLY, 0, shopFile.getChannel().size()); int shopsAmt = buffer.readShort(); for (int i = 0; i < shopsAmt; i++) { int shopId = buffer.readShort(); int[] items = new int[buffer.readByte()]; int[] amounts = new int[items.length]; boolean isGeneral = buffer.readByte() == 1; for (int itemData = 0; itemData < items.length; itemData++) { items[itemData] = buffer.readShort(); amounts[itemData] = buffer.readInt(); } int[] sampleItems = new int[buffer.readByte()]; int[] sampleAmounts = new int[sampleItems.length]; for (int itemData = 0; itemData < sampleItems.length; itemData++) { sampleItems[itemData] = buffer.readShort(); sampleAmounts[itemData] = buffer.readInt(); } String name = buffer.readUTF(); Shop shop = new Shop(shopId, isGeneral, items, amounts, sampleItems, sampleAmounts, false); shop.setName(name); shops.add(shop); } System.out.println("Loaded " + shops.size() + " Shops"); } catch (IOException ex) { Logger.getLogger(ShopEditor.class.getName()).log(Level.SEVERE, null, ex); } populateLists(); } @SuppressWarnings("unchecked") private void populateLists() { defaultModel.clear(); for (Shop i : shops) { defaultModel.addElement(i.getId()); } } private void reloadTable(Container shop) { @SuppressWarnings("serial") DefaultTableModel model = new DefaultTableModel() { @Override public boolean isCellEditable(int rowIndex, int columnIndex) { return true; } @Override public Class<?> getColumnClass(int columnIndex) { return types[columnIndex]; } }; model.addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { try { if (e.getColumn() != -1) { shops.get(jList1.getSelectedIndex()).set(jTable1.getSelectedRow(), new Item((Integer) jTable1.getValueAt(jTable1.getSelectedRow(), 0), (Integer) jTable1.getValueAt(jTable1.getSelectedRow(), 1))); } } catch (Exception f) { f.printStackTrace(); } } }); model.addColumn("Item ID"); model.addColumn("Amount"); if (shop != null) { for (int i = 0; i < shop.getData().length; i++) { if (shop.get(i) != null) { model.addRow(new Object[]{shop.get(i).getId(), shop.get(i).getAmount()}); } } } jTable1.setModel(model); } private void reloadSamples(Container shop) { @SuppressWarnings("serial") DefaultTableModel model = new DefaultTableModel() { @Override public boolean isCellEditable(int rowIndex, int columnIndex) { return true; } @Override public Class<?> getColumnClass(int columnIndex) { return types[columnIndex]; } }; model.addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { try { if (e.getColumn() != -1) { shops.get(jList1.getSelectedIndex()).setSample(jTable2.getSelectedRow(), new Item((Integer) jTable2.getValueAt(jTable2.getSelectedRow(), 0), (Integer) jTable2.getValueAt(jTable2.getSelectedRow(), 1))); } } catch (Exception f) { f.printStackTrace(); } } }); model.addColumn("Item ID"); model.addColumn("Amount"); if (shop != null) { for (int i = 0; i < shop.toArray().length; i++) { if (shop.get(i) != null) model.addRow(new Object[]{shop.get(i).getId(), shop.get(i).getAmount()}); } } jTable2.setModel(model); } } [/CODE] The format is: [CODE] private void load() { try { RandomAccessFile buffer = new RandomAccessFile("data/shops.bin", "r"); // ByteBuffer buffer = shopFile.getChannel().map(MapMode.READ_ONLY, 0, shopFile.getChannel().size()); int shopsAmt = buffer.readShort(); for (int i = 0; i < shopsAmt; i++) { int shopId = buffer.readShort(); int[] items = new int[buffer.readByte()]; int[] amounts = new int[items.length]; boolean isGeneral = buffer.readByte() == 1; for (int itemData = 0; itemData < items.length; itemData++) { items[itemData] = buffer.readShort(); amounts[itemData] = buffer.readInt(); } int[] sampleItems = new int[buffer.readByte()]; int[] sampleAmounts = new int[sampleItems.length]; for (int itemData = 0; itemData < sampleItems.length; itemData++) { sampleItems[itemData] = buffer.readShort(); sampleAmounts[itemData] = buffer.readInt(); } String name = buffer.readUTF(); Shop shop = new Shop(shopId, isGeneral, items, amounts, sampleItems, sampleAmounts, false); shop.setName(name); shops.add(shop); } System.out.println("Loaded " + shops.size() + " Shops"); } catch (IOException ex) { Logger.getLogger(ShopEditor.class.getName()).log(Level.SEVERE, null, ex); } } [/CODE] And this is the Shop class [CODE] package org.xealusion.model.player; import java.text.NumberFormat; import java.util.ArrayList; import org.xealusion.model.Container; import org.xealusion.model.Item; import org.xealusion.model.World; import org.xealusion.model.definition.ItemDefinition; import org.xealusion.net.ActionSender; import org.xealusion.tickable.Tick; public class Shop { public static final int[] unsellableItems = new int[]{995, 14892, 14891, 14890, 14889, 14888, 14887, 14886, 14885, 14884, 14883, 14882, 14881, 14880, 14879, 14878, 14877, 14876}; private static final int RESTOCK_TIME = 70; public static final int STORE_SIZE = 50; private Container shop = new Container(STORE_SIZE, true); public Container freeItems = new Container(8, true); private ArrayList<Player> playersViewing = new ArrayList<Player>(); private boolean generalStore = false; private String name = "Shop"; public int currencyId = 0; public boolean isGeneralStore() { return generalStore; } public void setGeneral(boolean b) { this.generalStore = b; } public static final Object[] params = new Object[]{"Sell 50", "Sell 10", "Sell 5", "Sell 1", "Value", -1, 1, 7, 4, 93, 40697856}; private int shopId = 0; private int[] origAmounts; private int[] origItems; public Shop(int id, boolean isGeneralStore, int[] items, int[] amounts, int[] sampleItems, int[] sampleAmounts, boolean inGame) { this.shopId = id; this.generalStore = isGeneralStore; if (shopId == 0) {//TODO better way xD this.generalStore = true; } if (!inGame) { shop = new Container(STORE_SIZE, true); } if (items != null && amounts != null) { for (int itemSlot = 0; itemSlot < items.length; itemSlot++) { shop.set(shop.getFreeSlot(), new Item(items[itemSlot], amounts[itemSlot])); } } if (sampleItems != null && sampleAmounts != null) { for (int itemSlot = 0; itemSlot < sampleItems.length; itemSlot++) { freeItems.set(freeItems.getFreeSlot(), new Item(sampleItems[itemSlot], sampleAmounts[itemSlot])); } } origItems = items; origAmounts = amounts; if (inGame) startRestocking(); } private void startRestocking() { World.getWorld().submit(new Tick(RESTOCK_TIME) { @Override public void execute() { for (int i = 0; i < shop.getSize(); i++) { if (i < origAmounts.length) { if (shop.get(i) != null) { if (shop.get(i).getAmount() < origAmounts[i]) { shop.add(new Item(shop.get(i).getId(), 1)); } } } else { if (shop.get(i) != null) { shop.remove(new Item(shop.get(i).getId(), 1)); } } } update(); } }); } public void open(Player player) { ActionSender.sendConfig(player, 118, 3); ActionSender.sendConfig(player, 1496, 23); ActionSender.sendConfig(player, 532, 995); ActionSender.sendBConfig(player, 199, -1); ActionSender.sendInterface(player, 620); sendInventory(player); ActionSender.sendAMask(player, 0, 100, 620, 26, 0, 1150); ActionSender.sendItems(player, 23, freeItems, false); ActionSender.sendAMask(player, 0, 240, 620, 25, 0, 1150); ActionSender.sendItems(player, 3, shop, false); ActionSender.sendString(player, 620, 20, name); for (int index = 0; index < 40; index++) { if (shop.get(index) != null) { ActionSender.sendBConfig(player, 946 + index, 0);//shop.get(index).getDefinition().getStorePrice()); } } } public static void sendInventory(Player player) { ActionSender.sendInventoryInterface(player, 621); ActionSender.sendClientScript(player, 149, params, "IviiiIsssss"); ActionSender.sendAMask(player, 0, 27, 621, 0, 36, 1086); ActionSender.sendItems(player, 93, player.getInventory().getContainer(), false); } public void addPlayer(Player player) { playersViewing.add(player); } public void removePlayer(Player player) { playersViewing.remove(player); } public void handleOption(Player p, int interfaceId, int buttonId, int buttonId2, int packetId, int itemIdent) { switch (interfaceId) { case 620: switch (buttonId) { case 18: removePlayer(p); p.removeAttribute("shopId"); break; case 25: if (buttonId2 > 0) { buttonId2 /= 6; } switch (packetId) { case 54: { ItemDefinition def = ItemDefinition.forId(shop.get(buttonId2).getId()); p.sendMessage(def.getExamine()); } break; case 7: buyItem(p, shop.get(buttonId2).getId(), 1, false); break; case 66: buyItem(p, shop.get(buttonId2).getId(), 5, false); break; case 11: buyItem(p, shop.get(buttonId2).getId(), 10, false); break; case 48: buyItem(p, shop.get(buttonId2).getId(), 50, false); break; case 17: buyItem(p, shop.get(buttonId2).getId(), 500, false); break; case 85: ItemDefinition def = ItemDefinition.forId(shop.get(buttonId2).getId()); p.sendMessage(def.getName() +" costs " + formatPrice(def.getStorePrice()) + " coins."); break; } break; case 26: buttonId2 *= .25; switch (packetId) { case 7: buyItem(p, freeItems.get(buttonId2).getId(), 1, true); break; case 66: buyItem(p, freeItems.get(buttonId2).getId(), 5, true); break; case 11: buyItem(p, freeItems.get(buttonId2).getId(), 10, true); break; case 48: buyItem(p, freeItems.get(buttonId2).getId(), 50, true); break; } break; } break; case 621: Item definition = p.getInventory().getContainer().get(buttonId2); if (definition == null) return; int itemId = definition.getId(); switch (buttonId) { case 0: switch (packetId) { case 7: sellItem(p, itemId, 1); break; case 66: sellItem(p, itemId, 5); break; case 11: sellItem(p, itemId, 10); break; case 48: sellItem(p, itemId, 50); break; case 17: sellItem(p, itemId, 500); break; case 54: { ItemDefinition def = p.getInventory().getContainer().get(buttonId2).getDefinition(); p.sendMessage(def.getExamine()); } break; case 85: ItemDefinition def = p.getInventory().getContainer().get(buttonId2).getDefinition(); p.sendMessage(def.getName() + " costs " + formatPrice(def.getStorePrice()) + " coins."); break; } } break; } } private void sellItem(Player p, int itemId, int amount) { ItemDefinition def = ItemDefinition.forId(itemId); if (def.isNoted()) def.setTradable(true); if (def.isTradable()) { int price = (int) ((def.getStorePrice() / 1.6) * amount); if (price <= 0) price = 1; if (!p.getInventory().contains(itemId)) { return; } if (!p.getInventory().hasRoomFor(995, price)) { ActionSender.sendMessage(p, "Not enough space in your inventory."); return; } if (!shop.contains(new Item(itemId, 1)) && !generalStore) { ActionSender.sendMessage(p, "You cannot sell that item to this shop."); return; } if (p.getInventory().getContainer().amount(itemId) < amount) { if (def.isNoted() || def.isStackable()) { amount = p.getInventory().lookup(itemId).getAmount(); } else { amount = p.getInventory().getContainer().amount(itemId); } price = (int) (ItemDefinition.forId(itemId).getStorePrice() / 1.6 * amount); ActionSender.sendMessage(p, "You don't have enough of that item!"); } Item item = new Item(itemId, amount); if (shop.add(item)) { p.getInventory().deleteItem(itemId, amount); p.getInventory().addItem(995, price); update(); } else { p.sendMessage("There is not enough room in this shop."); } } else { ActionSender.sendMessage(p, "You cannot sell that item to this shop."); } } public void update() { for (Player player : playersViewing) { ActionSender.sendItems(player, 93, player.getInventory().getContainer(), false); ActionSender.sendItems(player, 23, freeItems, false); ActionSender.sendItems(player, 3, shop, false); } } private void buyItem(Player player, int id, int amount, boolean take) { //if (ItemDefinition.forId(id).isTradeable()) { Item item = new Item(id, amount); int price = ((ItemDefinition.forId(id).getStorePrice()) * amount); if ((take ? freeItems.amount(id) : shop.amount(id)) < amount) { ActionSender.sendMessage(player, "The shop does not have that many!"); amount = shop.amount(id); price = ItemDefinition.forId(id).getStorePrice() * amount; if (amount == 0) { ActionSender.sendMessage(player, "The shop has run out of stock of that item."); return; } } if (player.getInventory().getFreeSlots() == 0 && !(item.getDefinition().isStackable() && player.getInventory().contains(item.getId()))) { ActionSender.sendMessage(player, "Not enough space in your inventory."); return; } System.out.println(shopId); if (currencyId == 0) { if (price < 0) { amount = Integer.MAX_VALUE / ItemDefinition.forId(id).getStorePrice(); price = ((ItemDefinition.forId(id).getStorePrice()) * amount); } if (player.getInventory().getFreeSlots() < amount && !(item.getDefinition().isNoted() || item.getDefinition().isStackable())) { ActionSender.sendMessage(player, "Not enough space in your inventory."); amount = player.getInventory().getFreeSlots(); price = ItemDefinition.forId(id).getStorePrice() * amount; } if (player.getInventory().getContainer().amount(995) < price && !take) { ActionSender.sendMessage(player, "You do not have enough coins for that many."); amount = player.getInventory().getContainer().amount(995) / ItemDefinition.forId(id).getStorePrice(); price = ItemDefinition.forId(id).getStorePrice() * amount; if (price < ItemDefinition.forId(id).getStorePrice()) { return; } } } else if (!handleSpecialCurrency(player, item)) { return; } if (!take) { if (currencyId == 0) player.getInventory().deleteItem(995, price); if (origItems.length > shop.lookupSlot(id) && (shop.get(shop.lookupSlot(id)).getAmount() - amount == 0)) { shop.get(shop.lookupSlot(id)).setAmount(0); } else { shop.remove(new Item(id, amount)); } } else { freeItems.remove(new Item(id, amount)); } player.getInventory().addItem(id, amount); update(); //} else { //ActionSender.sendMessage(p, "You cannot buy that item from this shop"); //} } private boolean handleSpecialCurrency(Player player, Item item) { int price = item.getAmount() * item.getDefinition().getStorePrice(); if (price < 0) { item.setAmount(Integer.MAX_VALUE / item.getDefinition().getStorePrice()); price = item.getAmount() * item.getDefinition().getStorePrice(); } switch (currencyId) { case 10: //ppk points if (player.settings.pkPoints >= price) { player.settings.pkPoints -= price; return true; } else { player.sendMessage("You do not have enough PK Points for this item!"); return false; } } return true; } public static String formatPrice(int price) { if (price <= 0) { price = 1; } return NumberFormat.getInstance().format(price); } public Container getShop() { return shop; } public void addItem(int id, int amount) { System.out.println(id); shop.add(new Item(id, amount)); } public void removeItem(int slot) { shop.set(slot, null); } public void set(int slot, Item i) { shop.set(slot, i); } public Integer getId() { return shopId; } public void setId(int parseInt) { this.shopId = parseInt; } public String getName() { return name; } public void setName(String name) { this.name = name; } public void addSample(int i, int i0) { freeItems.add(new Item(i, i0)); } public void setSample(int selectedRow, Item item) { freeItems.set(selectedRow, item); } }[/CODE]
  20. Okay i can't believe i got stuck on this, when i open a shop with a different currency in it and click on a item in shop the client crashes.. i've even watched tutorials and i dont get it to work.. It works with one of my sources but not with the other.. it's not the client cus it works with one of them. and i dont feel like using the other sourcecus it sux.
  21. Some reason on my server when you try to buy an item it gives it to you for free. But you can take that item and sell it back to the shops for money. I tried to replace coding with other coding from other servers. I looked over the shopassistant.java and can't find the issue. If anyone can help me solve this issue I would really love you! No HOMO!
  22. It wont allow me to make shops because I am only missing 1 file which is the unPackedshops.java I only have packed and it's pretty cleaned and Idk how to unpack it because when I open it just has alot of weird symbols
  23. Hopefully some people find this useful. Its 50% because I can't figure out the interface for the equipment tab. If you know it, please post below. The interface for this is 1011. Open actionbuttonpackethandler.java Add this anywhere: [code] case 1011: if (buttonId == 68) {//att xp x1 if (player.PcPoints >= 1) { player.getSkills().addXp(0, 1000); player.PcPoints -= 1; break; } else { player.sm("You need 1 Pest Control Point to buy this!"); } } else if (buttonId == 86) {//att xp 10x if (player.PcPoints >= 10) { player.getSkills().addXp(0, 10000); player.PcPoints -= 10; break; } else { player.sm("You need 10 Pest Control Points to buy this!"); } } else if (buttonId == 88) {//att xp 100x if (player.PcPoints >= 100) { player.getSkills().addXp(0, 100000); player.PcPoints -= 100; break; } else { player.sm("You need 100 Pest Control Points to buy this!"); } } else if (buttonId == 100) {//str xp 1x if (player.PcPoints >= 1) { player.getSkills().addXp(2, 1000); player.PcPoints -= 1; break; } else { player.sm("You need 1 Pest Control Point to buy this!"); } } else if (buttonId == 102) {//str xp 10x if (player.PcPoints >= 10) { player.getSkills().addXp(2, 10000); player.PcPoints -= 10; break; } else { player.sm("You need 10 Pest Control Points to buy this!"); } } else if (buttonId == 104) {//str xp 100x if (player.PcPoints >= 100) { player.getSkills().addXp(2, 100000); player.PcPoints -= 100; break; } else { player.sm("You need 100 Pest Control Points to buy this!"); } } else if (buttonId == 116) {//def xp 1x if (player.PcPoints >= 1) { player.getSkills().addXp(1, 1000); player.PcPoints -= 1; break; } else { player.sm("You need 1 Pest Control Point to buy this!"); } } else if (buttonId == 118) {//def xp 10x if (player.PcPoints >= 10) { player.getSkills().addXp(1, 10000); player.PcPoints -= 10; break; } else { player.sm("You need 10 Pest Control Points to buy this!"); } } else if (buttonId == 120) {//def xp 100x if (player.PcPoints >= 100) { player.getSkills().addXp(1, 100000); player.PcPoints -= 100; break; } else { player.sm("You need 100 Pest Control Points to buy this!"); } } else if (buttonId == 132) {//hp xp 1x if (player.PcPoints >= 1) { player.getSkills().addXp(3, 1000); player.PcPoints -= 1; break; } else { player.sm("You need 1 Pest Control Point to buy this!"); } } else if (buttonId == 134) {//hp xp 10x if (player.PcPoints >= 10) { player.getSkills().addXp(3, 10000); player.PcPoints -= 10; break; } else { player.sm("You need 10 Pest Control Points to buy this!"); } } else if (buttonId == 136) {//hp xp 100x if (player.PcPoints >= 100) { player.getSkills().addXp(3, 100000); player.PcPoints -= 100; break; } else { player.sm("You need 100 Pest Control Points to buy this!"); } } else if (buttonId == 148) {//range xp 1x if (player.PcPoints >= 1) { player.getSkills().addXp(4, 1000); player.PcPoints -= 1; break; } else { player.sm("You need 1 Pest Control Point to buy this!"); } } else if (buttonId == 150) {//range xp 10x if (player.PcPoints >= 10) { player.getSkills().addXp(4, 10000); player.PcPoints -= 10; break; } else { player.sm("You need 10 Pest Control Points to buy this!"); } } else if (buttonId == 152) {//range xp 100x if (player.PcPoints >= 100) { player.getSkills().addXp(4, 100000); player.PcPoints -= 100; break; } else { player.sm("You need 100 Pest Control Points to buy this!"); } } else if (buttonId == 164) {//mage xp 1x if (player.PcPoints >= 1) { player.getSkills().addXp(6, 1000); player.PcPoints -= 1; break; } else { player.sm("You need 1 Pest Control Point to buy this!"); } } else if (buttonId == 166) {//mage xp 10x if (player.PcPoints >= 10) { player.getSkills().addXp(6, 10000); player.PcPoints -= 10; break; } else { player.sm("You need 10 Pest Control Points to buy this!"); } } else if (buttonId == 168) {//mage xp 100x if (player.PcPoints >= 100) { player.getSkills().addXp(6, 100000); player.PcPoints -= 100; break; } else { player.sm("You need 100 Pest Control Points to buy this!"); } } else if (buttonId == 180) {//prayer xp 1x if (player.PcPoints >= 1) { player.getSkills().addXp(5, 1000); player.PcPoints -= 1; break; } else { player.sm("You need 1 Pest Control Points to buy this!"); } } else if (buttonId == 182) {//prayer xp 10x if (player.PcPoints >= 10) { player.getSkills().addXp(5, 10000); player.PcPoints -= 10; break; } else { player.sm("You need 10 Pest Control Points to buy this!"); } } else if (buttonId == 184) {//pryaer xp 100x if (player.PcPoints >= 100) { player.getSkills().addXp(5, 100000); player.PcPoints -= 100; break; } else { player.sm("You need 100 Pest Control Points to buy this!"); } } break; [/code] Each point gives 1k XP. All the buttons work. If you got any other interfaces with buttons that you want them to do something, post below.
  24. This is a tut. That I have made myself so that I could remember how to add/change shops In this tutorial I will explain how to add shops and how to change the coords of the shop Based off my own server but the layout is pretty much the same as a BUBLY server. or anyother server... [U][I][B][COLOR="#B22222"]Step 1:[/COLOR][/B][/I][/U] If you already have an NPC for this, and just want to add a full shop, skip to Step -- - You have to find the coord's for the NPC to spawn. To do this, go stand where you want the NPC to be and type "::coords". Write these numbers down. If nothing happens when you type it, add this to your commands; Code: [CODE] } else if (cmd[0].equals("coords")) { p.frames.sendMessage(p, "x: " + p.absX + ", y: " + p.absY); }[/CODE] [COLOR="#B22222"][U][I][B]Step 2:[/B][/I][/U][/COLOR] Spawning NPC's Find the NPC ID You want to spawn, from the attached file. Then in your server files, go to BIN>DATA>NPCS>NPCSPAWN You should see something like this; Code: [CODE] spawn = 2745 2392 5154 0 2864 5312 2864 5312 TzTok-Jad spawn = 21 2469 5123 0 0 0 0 0 Hero[/CODE] The first code is the NPC ID, the second third and fourth are the X, Y and height. The height is alwasy 0. The last four are also 0's. To add an NPC, find the ID and coords. For example, I want to spawn a hero at 2469,5123. I would add this to the file. Code: [CODE]spawn = 21 2469 5123 0 0 0 0 0 Hero[/CODE] Then save. ALSO, WRITE DOWN THE ID FOR THE SHOP! [B][I][U][COLOR="#B22222"]Step 3:[/COLOR][/U][/I][/B] Go to Irish_Scape Source\files\players. Open players.java Search for; Code: [CODE]public int[] shop[/CODE] You should see something like this; Code: [CODE]public int[] shop15 = {9920, 9925, 10612, 10721, 10723, 11282, 13107, 13109, 13111, 13113, 1311***; public int[] shop15n = {1000000,1000000,1000000,1000000,1000000,1000000,10000000,1000000,10000000,1000000,1000000}; public int[] shop15p = {5000, 5000, 5000};[/CODE] Go to the last one. It might be 15, it might be 10.. whatever shop(NUMHERE)n is the last one. Add this below it; Code: [CODE]public int[] shop15 = {9920, 9925, 10612, 10721, 10723, 11282, 13107, 13109, 13111, 13113, 1311***; // put items here! and change shop15 to the last one public int[] shop15n = {1000000,1000000,1000000,1000000,1000000,1000000,10000000,1000000,10000000,1000000,1000000}; //items amount for example it will show them 1m ea in shop! public int[] shop15p = {5000, 5000, 5000}; //prices here for every and each item! [/CODE] Dont forget to change the SHOP ID To what you wrote down before! Change the item codes, the amount, and price!! [COLOR="#B22222"][U][I][B]Step 4:[/B][/I][/U][/COLOR] Go to Irish_Scape Source\files\io\packets and open up NPCoption1.java Add this; Code: [CODE]case (NPC ID HERE): p.viewings = 1; p.shopid = 15; //SHOP NUMBER HERE p.frames.showInterface(p, 278); p.frames.setItems(p, 278, 89, 94, p.shop15, p.shop15n); //Add the one you put. +1 every time u add new shop p.frames.setString(p, " SHOP NAME HERE", 278, 88); break;[/CODE] Save again. [COLOR="#B22222"][U][I][B]Step 5:[/B][/I][/U][/COLOR] Go to Irish_Scape Source\Bulby\io\packets and open up ItemOption1.java Search for [CODE]else if(itemId ==[/CODE] until you get to the last one. If your last one is 14, add this. Code:[CODE] else if(itemId == p.shop15[itemSlot]) { p.frames.sendMessage(p, "This item costs "+p.shop15p[0]);//CHANGE THE 15 TO YOUR SHOP! }[/CODE] Then in the same packets place, open up ShopBuyConfig.java Search for [CODE]else if (p.shopid ==[/CODE] till you get to last one. For example if it is 14... add this; Code:[CODE] else if (p.shopid == 15 && pi.haveItem(p, 995, p.shop15p[0])) { pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop15p[0]); pi.addItem(p, p.shop15[itemSlot], 1); }[/CODE] Save. Compile! Run! HAVE FUN WITH YOUR NEW SHOP!! [COLOR="#B22222"]DOWNLOAD [/COLOR] same file just different links [URL="http://up.ht/z3GZT3"]Helpful Things[/URL] [URL="http://uppit.com/th2vi1imw0oa/Helpful_things.rar"]Helpful Things[/URL] I will be making a video soon to show how exactly what is being done
×