Thread: [PI] Few problems that needs to be fixed

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 [PI] Few problems that needs to be fixed 
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    972
    Thanks given
    77
    Thanks received
    90
    Rep Power
    15
    1. When ever I change the price of my high alch in item.cfg, the sell to shop price goes up aswell.
    2. When ever I try to sell a item to the general store I get this error,
    Code:
    [9/2/13 9:56 PM]: java.lang.ArrayIndexOutOfBoundsException: 101
    [9/2/13 9:56 PM]: 	at server.game.shops.ShopAssistant.addShopItem(ShopAssistant.java:278)
    [9/2/13 9:56 PM]: 	at server.game.shops.ShopAssistant.sellItem(ShopAssistant.java:255)
    [9/2/13 9:56 PM]: 	at server.game.players.packets.Bank5.processPacket(Bank5.java:36)
    [9/2/13 9:56 PM]: 	at server.game.players.PacketHandler.processPacket(PacketHandler.java:138)
    [9/2/13 9:56 PM]: 	at server.game.players.Client.processQueuedPackets(Client.java:1049)
    [9/2/13 9:56 PM]: 	at server.game.players.PlayerHandler.process(PlayerHandler.java:133)
    [9/2/13 9:56 PM]: 	at server.Server.main(Server.java:139)
    When I close the shop, I get my money but the item I sold doesn't show. How can I fixed these 2 problems?
    Reply With Quote  
     

  2. #2  
    Project Drop-Zone Owner & The BLOOD Gang Always Banging RED


    Join Date
    May 2013
    Age
    28
    Posts
    2,992
    Thanks given
    5
    Thanks received
    937
    Rep Power
    183
    It's an out of bounds error, alching the item does not have to do with item.cfg. As you can see it says ShopAssistant. You need a tutorial/snippet which is released here. Changing the price in item.cfg is like general store shop prices etc. Say you change 4151 to 5M it will then sell to the general store for 5M. The answer for number 1 is you cannot change the high alch through item.cfg. It's done differently item.cfg does it for general store as I said above with an example.
    Reply With Quote  
     

  3. #3  
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    972
    Thanks given
    77
    Thanks received
    90
    Rep Power
    15
    My out of bounds errors has nothing to do with alching.
    Reply With Quote  
     

  4. #4  
    Project Drop-Zone Owner & The BLOOD Gang Always Banging RED


    Join Date
    May 2013
    Age
    28
    Posts
    2,992
    Thanks given
    5
    Thanks received
    937
    Rep Power
    183
    Go to line 255 and 278 in eclipse then.
    Reply With Quote  
     

  5. #5  
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    972
    Thanks given
    77
    Thanks received
    90
    Rep Power
    15
    Code:
    public boolean addShopItem(int itemID, int amount) {
    		boolean Added = false;
    		if (amount <= 0) {
    			return false;
    		}
    		if (Item.itemIsNote[itemID] == true) {
    			itemID = c.getItems().getUnnotedItem(itemID);
    		}
    		for (int i = 0; i < ShopHandler.ShopItems.length; i++) {
    			if ((ShopHandler.ShopItems[c.myShopId][i] - 1) == itemID) {
    				ShopHandler.ShopItemsN[c.myShopId][i] += amount;
    				Added = true;
    			}
    		}
    		if (Added == false) {
    			for (int i = 0; i < ShopHandler.ShopItems.length; i++) {
    				if (ShopHandler.ShopItems[c.myShopId][i] == 0) {
    					ShopHandler.ShopItems[c.myShopId][i] = (itemID + 1);
    					ShopHandler.ShopItemsN[c.myShopId][i] = amount;
    					ShopHandler.ShopItemsDelay[c.myShopId][i] = 0;
    					break;
    				}
    			}
    		}
    		return true;
    	}
    Code:
    public boolean sellItem(int itemID, int fromSlot, int amount) {
    		for (int i : Config.ITEM_SELLABLE) {
    			if (i == itemID) {
    				c.sendMessage("You can't sell "
    						+ c.getItems().getItemName(itemID).toLowerCase() + ".");
    				return false;
    			}
    		}
    		if (c.playerRights == 2 && !Config.ADMIN_CAN_SELL_ITEMS) {
    			c.sendMessage("Selling items as an admin has been disabled.");
    			return false;
    		}
    
    		if (amount > 0 && itemID == (c.playerItems[fromSlot] - 1)) {
    			if (ShopHandler.ShopSModifier[c.myShopId] > 1) {
    				boolean IsIn = false;
    				for (int i = 0; i <= ShopHandler.ShopItemsStandard[c.myShopId]; i++) {
    					if (itemID == (ShopHandler.ShopItems[c.myShopId][i] - 1)) {
    						IsIn = true;
    						break;
    					}
    				}
    				if (IsIn == false) {
    					c.sendMessage("You can't sell "
    							+ c.getItems().getItemName(itemID).toLowerCase()
    							+ " to this store.");
    					return false;
    				}
    			}
    
    			if (amount > c.playerItemsN[fromSlot]
    					&& (Item.itemIsNote[(c.playerItems[fromSlot] - 1)] == true || Item.itemStackable[(c.playerItems[fromSlot] - 1)] == true)) {
    				amount = c.playerItemsN[fromSlot];
    			} else if (amount > c.getItems().getItemAmount(itemID)
    					&& Item.itemIsNote[(c.playerItems[fromSlot] - 1)] == false
    					&& Item.itemStackable[(c.playerItems[fromSlot] - 1)] == false) {
    				amount = c.getItems().getItemAmount(itemID);
    			}
    			// double ShopValue;
    			// double TotPrice;
    			int TotPrice2 = 0;
    			// int Overstock;
    			for (int i = amount; i > 0; i--) {
    				TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 1,
    						fromSlot) * 0.90);
    				if (c.getItems().freeSlots() > 0
    						|| c.getItems().playerHasItem(995)) {
    					if (Item.itemIsNote[itemID] == false) {
    						c.getItems().deleteItem(itemID,
    								c.getItems().getItemSlot(itemID), 1);
    					} else {
    						c.getItems().deleteItem(itemID, fromSlot, 1);
    					}
    					c.getItems().addItem(995, TotPrice2);
    					addShopItem(itemID, 1);
    				} else {
    					c.sendMessage("You don't have enough space in your inventory.");
    					break;
    				}
    			}
    			c.getItems().resetItems(3823);
    			resetShop(c.myShopId);
    			updatePlayerShop();
    			return true;
    		}
    		return true;
    	}
    I don't see how this has to do with high alching tbh. (Green = The line number that gives me the error)
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Aug 2013
    Age
    27
    Posts
    1,128
    Thanks given
    373
    Thanks received
    754
    Rep Power
    0
    Quote Originally Posted by 2nubs1cup View Post
    1. When ever I change the price of my high alch in item.cfg, the sell to shop price goes up aswell.
    2. When ever I try to sell a item to the general store I get this error,
    Code:
    [9/2/13 9:56 PM]: java.lang.ArrayIndexOutOfBoundsException: 101
    [9/2/13 9:56 PM]: 	at server.game.shops.ShopAssistant.addShopItem(ShopAssistant.java:278)
    [9/2/13 9:56 PM]: 	at server.game.shops.ShopAssistant.sellItem(ShopAssistant.java:255)
    [9/2/13 9:56 PM]: 	at server.game.players.packets.Bank5.processPacket(Bank5.java:36)
    [9/2/13 9:56 PM]: 	at server.game.players.PacketHandler.processPacket(PacketHandler.java:138)
    [9/2/13 9:56 PM]: 	at server.game.players.Client.processQueuedPackets(Client.java:1049)
    [9/2/13 9:56 PM]: 	at server.game.players.PlayerHandler.process(PlayerHandler.java:133)
    [9/2/13 9:56 PM]: 	at server.Server.main(Server.java:139)
    When I close the shop, I get my money but the item I sold doesn't show. How can I fixed these 2 problems?
    Go to your ShopHandler.java and change every int of 101 to 200, and try again sir.
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    972
    Thanks given
    77
    Thanks received
    90
    Rep Power
    15
    Quote Originally Posted by Ardi Rizal View Post
    Go to your ShopHandler.java and change every int of 101 to 200, and try again sir.
    Thanks , how can I change my high alch prices?, if you know.
    Reply With Quote  
     

  9. #8  
    Banned

    Join Date
    Aug 2013
    Age
    27
    Posts
    1,128
    Thanks given
    373
    Thanks received
    754
    Rep Power
    0
    Quote Originally Posted by 2nubs1cup View Post
    Thanks , how can I change my high alch prices?, if you know.
    Most of PI be in prices.txt sir on your Data folder.
    Reply With Quote  
     

  10. #9  
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    972
    Thanks given
    77
    Thanks received
    90
    Rep Power
    15
    Quote Originally Posted by Ardi Rizal View Post
    Most of PI be in prices.txt sir on your Data folder.
    So I put 861 1536, and it will alch for 1536 gp?
    Reply With Quote  
     

  11. #10  
    Banned

    Join Date
    Aug 2013
    Age
    27
    Posts
    1,128
    Thanks given
    373
    Thanks received
    754
    Rep Power
    0
    Quote Originally Posted by 2nubs1cup View Post
    So I put 861 1536, and it will alch for 1536 gp?
    Yes, first it is the itemId, later it be the item price.
    Example:
    4151 1
    Then the whip be for 1gp.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [pi] BIG ERROR NEED TO BE FIXED
    By reborn-gt in forum Help
    Replies: 5
    Last Post: 08-22-2013, 05:40 PM
  2. Replies: 5
    Last Post: 08-14-2012, 03:44 PM
  3. Replies: 5
    Last Post: 06-07-2012, 08:22 PM
  4. [PI] 2 stuffs need to be fixed...
    By Hellobuddyhowareyou in forum Help
    Replies: 4
    Last Post: 05-05-2011, 10:44 AM
  5. Replies: 0
    Last Post: 01-17-2009, 01:59 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •