Hello everyone, as you may know, most thieving bases (not mine ) do not have stalls due to their oddness for some reason... So, I did some searching and found out that some objects can't be used by ObjectOption1.java because of some odd reason. Anyways, here is what you do:
Step 1: Open ObjectOption2.java with this:
Code:
package Pandemic.io.packets;
import Pandemic.Engine;
import Pandemic.players.Player;
import Pandemic.util.Misc;
import Pandemic.Skills.*;
public class ObjectOption2 implements Packet {
/**
* Handles the second option on objects (sometimes first).
* @param p The Player which the frame should be handled for.
* @param packetId The packet id this belongs to.
* @param packetSize The amount of bytes being recieved for this packet.
* Re-done correctly by Pandemic
*/
public void handlePacket(Player p, int packetId, int packetSize) {
if (!p.objectOption2) {
p.clickX = p.stream.readUnsignedWordBigEndian();
p.clickId = p.stream.readUnsignedWord();
p.clickY = p.stream.readUnsignedWordBigEndianA();
p.objectOption2 = true;
}
int distance = 0;
if (p.walkDir != -1 || p.runDir != -1
|| distance > objectSize(p.clickId)) {
return;
}
p.objectOption2 = false;
switch (p.clickId) {
}
}
private int objectSize(int id) {
switch (id) {
case 23271:
return 2;
default:
return 1;
}
}
}
Step 2: Get your object Id by putting:
Code:
Misc.println("Object Option 2: ObjectId: "+p.clickId);
at the top after it declares p.clickX and p.clickY.
Step 3: Go in the server and click on that object! Then hopefully in the server log you will see
Code:
Object Option 2: ObjectId: 23423
and then you do the next step with that id.
Step 4: Go into your freshly redone ObjectOption2.java and find this:
Code:
switch (p.clickId) {
Then put this:
Code:
switch (p.clickId) {
case whateveridyougot:
p.frames.sendMessage(p, "Hi, thank you Pandemic for finding out this awesome thing!");
//Here is where you put everything about this object if clicked :)
break;
}
There you go,
Pandemic