Thread: Insanity(emulous) buy1/5/10 dupe

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Insanity(emulous) buy1/5/10 dupe 
    Registered Member

    Join Date
    Aug 2009
    Posts
    464
    Thanks given
    89
    Thanks received
    13
    Rep Power
    214
    Just found a dupe in my server,

    When you are in trade you offer all your items. You fast rightclick when its still in your inventory. Then with that you hit 10, 5 or 1 again and it adds anothr 10, 5 or 1.

    Any idea how to fix this ?
    lol'd
    Quote Originally Posted by Christopher View Post
    What the fuck is compileing
    Reply With Quote  
     

  2. #2  
    Austin_
    Guest
    Code:
    	public boolean tradeItem(int itemID, int fromSlot, int amount) {
    		Client o = (Client) Server.playerHandler.players[c.tradeWith];
    		if(o == null) {
    			return false;
    		}
    		
    		for (int i : Config.ITEM_TRADEABLE) {
    			if(i == itemID) {
    				c.sendMessage("You can't trade this item.");
    				return false;
    			}		
    		}
    		c.tradeConfirmed = false;
    		o.tradeConfirmed = false;
    		if(!Item.itemStackable[itemID] && !Item.itemIsNote[itemID]) {
    			for(int a = 0; a < amount; a++) {
    				if(c.getItems().playerHasItem(itemID, 1)) {
    					offeredItems.add(new GameItem(itemID, 1));	
    					c.getItems().deleteItem(itemID, c.getItems().getItemSlot(itemID), 1);
    					o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    				}
    			}
    			o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    			c.getItems().resetItems(3322);
    			resetTItems(3415);
    			o.getTradeAndDuel().resetOTItems(3416);
    			c.getPA().sendFrame126("", 3431);
    			o.getPA().sendFrame126("", 3431);
    		}
    	if (c.getItems().getItemCount(itemID) < amount) {
    amount = c.getItems().getItemCount(itemID);
    if (amount == 0)
    return false;
    }
            if (!c.inTrade || !c.canOffer) {
    			declineTrade();
    			return false;
    		}
    		
    		if(Item.itemStackable[itemID] || Item.itemIsNote[itemID]) {
    			boolean inTrade = false;
    			for(GameItem item : offeredItems) {
    				if(item.id == itemID) {
    					inTrade = true;
    					item.amount += amount;
    					c.getItems().deleteItem(itemID, c.getItems().getItemSlot(itemID), amount);
    					o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    					break;	
    				}
    			}
    
    			if(!inTrade) {
    				offeredItems.add(new GameItem(itemID, amount));
    				c.getItems().deleteItem(itemID, fromSlot, amount);
    				o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    			}
    		}
    		o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    		c.getItems().resetItems(3322);
    		resetTItems(3415);
    		o.getTradeAndDuel().resetOTItems(3416);
    		c.getPA().sendFrame126("", 3431);
    		o.getPA().sendFrame126("", 3431);
    		return true;
    		}
    Credits: Sanity. Tell him ty.
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    If you read this you're gay!
    Infexis's Avatar
    Join Date
    Aug 2009
    Age
    25
    Posts
    4,561
    Thanks given
    1,158
    Thanks received
    1,173
    Rep Power
    2949
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    "If you can't explain it simply, you don't understand it well enough." - Albert Einstein
    Reply With Quote  
     

  5. #4  
    Registered Member

    Join Date
    Aug 2009
    Posts
    464
    Thanks given
    89
    Thanks received
    13
    Rep Power
    214
    Quote Originally Posted by 1337 View Post
    [Only registered and activated users can see links. ]
    I did that, but that only fix the "x" buy.
    lol'd
    Quote Originally Posted by Christopher View Post
    What the fuck is compileing
    Reply With Quote  
     

  6. #5  
    Austin_
    Guest
    Omg. I posted the code bro.
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Dec 2008
    Posts
    203
    Thanks given
    1
    Thanks received
    3
    Rep Power
    6
    so am i not gunna get a simple "thanks for helping me" for teaching you how to make items not drop >.>
    BAM
    Reply With Quote  
     

  8. #7  
    Registered Member

    Join Date
    Aug 2009
    Posts
    464
    Thanks given
    89
    Thanks received
    13
    Rep Power
    214
    Quote Originally Posted by Zeus. View Post
    Code:
    	public boolean tradeItem(int itemID, int fromSlot, int amount) {
    		Client o = (Client) Server.playerHandler.players[c.tradeWith];
    		if(o == null) {
    			return false;
    		}
    		
    		for (int i : Config.ITEM_TRADEABLE) {
    			if(i == itemID) {
    				c.sendMessage("You can't trade this item.");
    				return false;
    			}		
    		}
    		c.tradeConfirmed = false;
    		o.tradeConfirmed = false;
    		if(!Item.itemStackable[itemID] && !Item.itemIsNote[itemID]) {
    			for(int a = 0; a < amount; a++) {
    				if(c.getItems().playerHasItem(itemID, 1)) {
    					offeredItems.add(new GameItem(itemID, 1));	
    					c.getItems().deleteItem(itemID, c.getItems().getItemSlot(itemID), 1);
    					o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    				}
    			}
    			o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    			c.getItems().resetItems(3322);
    			resetTItems(3415);
    			o.getTradeAndDuel().resetOTItems(3416);
    			c.getPA().sendFrame126("", 3431);
    			o.getPA().sendFrame126("", 3431);
    		}
    	if (c.getItems().getItemCount(itemID) < amount) {
    amount = c.getItems().getItemCount(itemID);
    if (amount == 0)
    return false;
    }
            if (!c.inTrade || !c.canOffer) {
    			declineTrade();
    			return false;
    		}
    		
    		if(Item.itemStackable[itemID] || Item.itemIsNote[itemID]) {
    			boolean inTrade = false;
    			for(GameItem item : offeredItems) {
    				if(item.id == itemID) {
    					inTrade = true;
    					item.amount += amount;
    					c.getItems().deleteItem(itemID, c.getItems().getItemSlot(itemID), amount);
    					o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    					break;	
    				}
    			}
    
    			if(!inTrade) {
    				offeredItems.add(new GameItem(itemID, amount));
    				c.getItems().deleteItem(itemID, fromSlot, amount);
    				o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    			}
    		}
    		o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    		c.getItems().resetItems(3322);
    		resetTItems(3415);
    		o.getTradeAndDuel().resetOTItems(3416);
    		c.getPA().sendFrame126("", 3431);
    		o.getPA().sendFrame126("", 3431);
    		return true;
    		}
    Credits: Sanity. Tell him ty.
    Worked, I love you.
    lol'd
    Quote Originally Posted by Christopher View Post
    What the fuck is compileing
    Reply With Quote  
     

  9. #8  
    Austin_
    Guest
    No problem haha.
    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Dec 2009
    Age
    27
    Posts
    325
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Where would you add it?
    Quote Originally Posted by John' View Post
    You tell me where it goes, it's very small.
    Reply With Quote  
     

  11. #10  
    Registered Member Analed's Avatar
    Join Date
    Jan 2010
    Posts
    326
    Thanks given
    6
    Thanks received
    3
    Rep Power
    0
    Quote Originally Posted by Austinn. View Post
    Code:
    	public boolean tradeItem(int itemID, int fromSlot, int amount) {
    		Client o = (Client) Server.playerHandler.players[c.tradeWith];
    		if(o == null) {
    			return false;
    		}
    		
    		for (int i : Config.ITEM_TRADEABLE) {
    			if(i == itemID) {
    				c.sendMessage("You can't trade this item.");
    				return false;
    			}		
    		}
    		c.tradeConfirmed = false;
    		o.tradeConfirmed = false;
    		if(!Item.itemStackable[itemID] && !Item.itemIsNote[itemID]) {
    			for(int a = 0; a < amount; a++) {
    				if(c.getItems().playerHasItem(itemID, 1)) {
    					offeredItems.add(new GameItem(itemID, 1));	
    					c.getItems().deleteItem(itemID, c.getItems().getItemSlot(itemID), 1);
    					o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    				}
    			}
    			o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    			c.getItems().resetItems(3322);
    			resetTItems(3415);
    			o.getTradeAndDuel().resetOTItems(3416);
    			c.getPA().sendFrame126("", 3431);
    			o.getPA().sendFrame126("", 3431);
    		}
    	if (c.getItems().getItemCount(itemID) < amount) {
    amount = c.getItems().getItemCount(itemID);
    if (amount == 0)
    return false;
    }
            if (!c.inTrade || !c.canOffer) {
    			declineTrade();
    			return false;
    		}
    		
    		if(Item.itemStackable[itemID] || Item.itemIsNote[itemID]) {
    			boolean inTrade = false;
    			for(GameItem item : offeredItems) {
    				if(item.id == itemID) {
    					inTrade = true;
    					item.amount += amount;
    					c.getItems().deleteItem(itemID, c.getItems().getItemSlot(itemID), amount);
    					o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    					break;	
    				}
    			}
    
    			if(!inTrade) {
    				offeredItems.add(new GameItem(itemID, amount));
    				c.getItems().deleteItem(itemID, fromSlot, amount);
    				o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    			}
    		}
    		o.getPA().sendFrame126("Trading with: " + c.playerName+" who has @[email protected]"+c.getItems().freeSlots()+" free slots" ,3417);	
    		c.getItems().resetItems(3322);
    		resetTItems(3415);
    		o.getTradeAndDuel().resetOTItems(3416);
    		c.getPA().sendFrame126("", 3431);
    		o.getPA().sendFrame126("", 3431);
    		return true;
    		}
    Credits: Sanity. Tell him ty.
    where to add this code?

    EDIT: nvm found it
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •