Purpose: Use an item on object
Difficulty: 1/10
Assumed Knowledge: Ctrl + F & Basic code editing
Server Base: Dodian/Devolution
Classes Modified: Client.java
Procedure
Step 1: Open your client.java & search for "case 192".
It should have something like;
Step 2: To make an item be used on an object hit enter after the "break"Code:// Use an item on an object junk = inStream.readSignedWordBigEndianA(); int UsedOnObjectID = inStream.readUnsignedWordBigEndian(); int UsedOnY = inStream.readSignedWordBigEndianA(); int ItemSlot = (inStream.readSignedWordBigEndianA() - 128); int UsedOnX = inStream.readUnsignedWordBigEndianA(); int ItemID = inStream.readUnsignedWord(); if (!playerHasItem(ItemID)) break;
Step 3: Then add in
This is when you use an item on an object it will delete an item from your inventory & add a new item.Code:else if(ItemID == #### && UsedOnObjectID == ####) deleteItem(####,getItemSlot(####), 1); addItem(####, 1);
Lets say you wanted to use Crystal Key (989) on Crystal Chest (ID 172) (x=2914 y=3451) you'd use.
Now you'd add that code underneath the following in Case 192Code:else if(ItemID == 989 && UsedOnObjectID == 172) deleteItem(989,getItemSlot(989), 1); addItem(1615, 1);So when you use Crystal Key on the Crystal Chest.Code:if (!playerHasItem(ItemID)) break;
It removes the Crystal Key from your inventory.
Then you receive a Dragonstone.
Step 4: Compile & Run!
Credits: Myself & Devolution Source!
Hope this helps alot of people as it took me a while to work it out. And it's very useful.


Reply With Quote![[Tut] Item on Object [DODIAN]](http://ragezone.com/hyper728.png)


