Sorted Thanks.
Printable View
Sorted Thanks.
You can get the item id based on the read values, you would need a couple more read values for things like inventory item slot etc..
Example:
Code:int itemId = p.stream.readUnsignedWordBigEndianA();
p.frames.sendMessage(p, "This item is worth " + Engine.items.getItemValue(itemId) + " coins.");
HelloQuote:
Originally Posted by bracket [Only registered and activated users can see links. Click Here To Register...]
Code:Compiling palidino76.rs2.io
palidino76\rs2\io\PacketManager.java:457: error: variable itemId is already defined in method parsePacket(Player,int,int)
int itemId = p.stream.readUnsignedWordBigEndianA();
^
Note: .\palidino76\rs2\clanchat\Room.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Press any key to continue . . .
Can you post or pm me the whole class file?
[Only registered and activated users can see links. Click Here To Register...]
There you go guys.
Find:
Replace with:Code:public void parsePacket(Player p, int packetId, int packetSize) {
Player en = Engine.players[p.enemyIndex];
Find:Code:public void parsePacket(Player p, int packetId, int packetSize) {
Player en = Engine.players[p.enemyIndex];
int itemId = 0;
replace with:Code:case 195:
int itemId = p.stream.readUnsignedWord();
Find:Code:case 195:
itemId = p.stream.readUnsignedWord();
Replace with:Code:case 38:
/*
* Item examining.
*/
/* if (Engine.items.isUntradable(itemId)) { //(ieks items.java)
p.frames.sendMessage(p, "This item is not tradeable.");
return;
} */
//p.frames.sendMessage(p, "This item is worth " + Engine.items.getItemValue(itemId) + " coins.");
p.frames.sendMessage(p, Engine.items.getItemDescription(p.stream.readUnsignedWordBigEndianA()));
break;
Should work after thatCode:case 38:
/*
* Item examining.
*/
itemId = p.stream.readUnsignedWordBigEndianA();
/*if (Engine.items.isUntradable(itemId)) { //(ieks items.java)
p.frames.sendMessage(p, "This item is not tradeable.");
return;
}*/
p.frames.sendMessage(p, "This item is worth " + Engine.items.getItemValue(itemId) + " coins.");
p.frames.sendMessage(p, Engine.items.getItemDescription(itemId));
break;
Make sure to remove the // from
Forgot to mention that.Code://p.frames.sendMessage(p, "This item is worth " + Engine.items.getItemValue(itemId) + " coins.");
Thank you so much!Quote:
Originally Posted by Armo [Only registered and activated users can see links. Click Here To Register...]