Author Topic: [PI] Fixing the WearItem Alche Dupe  (Read 148 times)

Offline robgob

  • Adamant Member
  • *
  • Posts: 120
  • Rep 5
  • I swarm like locust
  • Location: Michigan
    • View Profile
[PI] Fixing the WearItem Alche Dupe
« on: April 13, 2011, 04:29:32 am »
.::The Exploit::.
So it came to my attention that in many PI sources, players can have a client send a false Low/High Alche packet to the server, and still receive the coins without actually having the item.
And in another case, players can right click the item they wish to wear, use the clients quick keys to switch to the magic tab(while the item menu is still up), wear the item and quickly alche it at the same time. This would then let the person wear AND alche the item .

Both the wearItem and Magic on Item methods don't check to see if you actually have the item.

.::The Fix::.


In your ItemAssistant.java
Search for:
Code: [Select]
public boolean wearItem(int wearID, int slot) {add this right under it:
Code: [Select]
if (!c.getItems().playerHasItem(wearID, 1, slot)) {
//add a method here for logging cheaters(If you want)
return false;
}

in your PlayerAssistant.java search for:
Code: [Select]
public void magicOnItems(int slot, int itemId, int spellId) {
and under that add:
Code: [Select]
if (!c.getItems().playerHasItem(itemId, 1, slot)) {
//add a method here for logging cheaters(If you want)
return;
}

Share on Bluesky Share on Facebook


Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: [PI] Fixing the WearItem Alche Dupe
« Reply #1 on: April 13, 2011, 09:28:47 am »
Very nice mate =D