First, I'm going to explain how to do the dupe. Then, we'll look at the source of the problem, and finally, I'll show you how to patch it.
Purpose: Patch a dupe
Difficulty: 0
Assumed Knowledge: Complex 3d array manipulation and the javafx infrastructure
Classes Modified: TradeAndDuel.java
Tested On(if it applies): PI / SoulSplit
Step 1. Performing the arrow\bolt dupe.
The goal here is to try to get two stacks of a arrow or bolt or stackable item. This is best done by storing 1 of the arrow in the bank, equipping the rest, and then taking the 1 arrow out of the bank, then equipping another type or arrow or un-equipping the arrow. This should yield two stacks of arrows in most PI servers with this unpatched. Next, trade someone, offer x on the 1 arrow, and type in the amount of the other arrow. Then decline. This ends up doubling arrows, leading to massive arrow \ bolt numbers.
Step 2. Why?
PI is shit.
Step 3. Patching the problem.
(Note, I'm not actually patching the source of the problem, that is the two stacks occuring. I'm just adding a nice check in a method to see if you're doing shit right)
Open up TradeAndDuel.java and add this in your tradeItem method.
Code:
if(!((c.playerItems[fromSlot] == itemID+1) && (c.playerItemsN[fromSlot] >= amount)))
{
c.sendMessage("You don't have that amount!");
return false;
}
This stops any attempt of "Trade X"'ing over the item number.
Note: What's hilarious is that the fromSlot int is passed to the method and it isn't even used right once. Fucking idiots.
The source of this problem is bad coding. I'm looking at you, developers.
Poor man's fix: Add bolt and arrow ids to stackable array.