Thread: Selling items to gen shop

Results 1 to 4 of 4
  1. #1 Selling items to gen shop 
    Officially Running

    Mr Dream's Avatar
    Join Date
    Dec 2013
    Posts
    1,922
    Thanks given
    555
    Thanks received
    295
    Rep Power
    905
    Hey what's the method for selling items?
    Attached image
    Attached image
    Reply With Quote  
     

  2. #2  
    Officially Retired

    Huey's Avatar
    Join Date
    Jan 2008
    Age
    22
    Posts
    16,478
    Thanks given
    3,385
    Thanks received
    7,727
    Rep Power
    5000
    Right click sell.
    Attached image
    Listen children don't become this guy.
    Quote Originally Posted by Owner Spikey View Post
    Why can I attack lower level npc's in a matter of a mouse hover but for a higher level npc the only choice to attack is by right clicking option attack?

    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Officially Running

    Mr Dream's Avatar
    Join Date
    Dec 2013
    Posts
    1,922
    Thanks given
    555
    Thanks received
    295
    Rep Power
    905
    Quote Originally Posted by Huey View Post
    Right click sell.
    where in shopassistant do I find that..
    Attached image
    Attached image
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Registered Member Plasmetic's Avatar
    Join Date
    Nov 2015
    Posts
    273
    Thanks given
    20
    Thanks received
    30
    Rep Power
    20
    Tweak/convert if needed.

    Code:
    	public boolean sellItem(int itemID, int fromSlot, int amount) {
    		if (c.myShopId == 14)
    			return false;
    		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 (Server.shopHandler.ShopSModifier[c.myShopId] > 1) {
    				boolean IsIn = false;
    				for (int i = 0; i <= Server.shopHandler.ShopItemsStandard[c.myShopId]; i++) {
    					if (itemID == (Server.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));
    				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;
    	}
    Reply With Quote  
     


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. Replies: 3
    Last Post: 03-09-2015, 03:54 AM
  2. Disabling selling items to token shop?
    By OodlesOfNoodles in forum Help
    Replies: 6
    Last Post: 11-30-2013, 02:17 AM
  3. [PI] Can't Sell Items to the Shop?
    By Billionaire in forum Help
    Replies: 1
    Last Post: 04-30-2013, 03:57 AM
  4. Sell items to PKP shop PI
    By Troubleshoot in forum Help
    Replies: 1
    Last Post: 08-06-2012, 04:02 PM
  5. PI selling items to a shop?
    By Someone in forum Help
    Replies: 0
    Last Post: 03-03-2011, 05:39 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •