PDA

View Full Version : [508/525] ItemOption3.java



owner lorenzo
June 18th, 2010, 12:27
Step1:
Make a new file in packethandler called "ItemOption3.java" and paste this in the file :


/*
* Class ItemOption3
*
* Version 1.0
*
* Sunday 20th december 2009
*
* Created by
*/

package net.com.codeusa.net.packethandler;

import net.com.codeusa.model.Player;
import net.com.codeusa.util.Misc;
import net.com.codeusa.Engine;

public class ItemOption3 implements Packet {
/**
* Handles operating equipped items.
* @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.
*/
public void handlePacket(Player p, int packetId, int packetSize) {
if (p == null || p.stream == null) {
return;
}
int junk = p.stream.readUnsignedWord();
int itemId = p.stream.readUnsignedWordA();
int itemSlot = p.stream.readUnsignedWordBigEndianA();
String itemName = Engine.items.getItemName(itemId);

if (itemName.contains("potion") || (itemName.startsWith("Super") || (itemName.startsWith("Vial of")))) {
Engine.playerItems.deleteItem(p, itemId, Engine.playerItems.getItemSlot(p, itemId), 1);
Engine.playerItems.addItem(p, 229, 1);
p.message("You empty the vial onto the floor.");
}

switch (itemId) {

case 3853:
case 3855:
case 3857:
case 3859:
case 3861:
case 3863:
case 3865:
case 3867:
p.getActionSender().setString(p, "Where Would You Like To Go", 235, 1);
p.getActionSender().setString(p, "Burthrope Games Room", 235, 2);
p.getActionSender().setString(p, "Bounty Hunter", 235, 3);
p.getActionSender().setString(p, "Clan Wars", 235, 4);
p.getActionSender().setString(p, "Barbarian Outpost", 235, 5);
p.getActionSender().setString(p, "No Where", 235, 6);
p.getActionSender().showChatboxInterface(p, 235);
break;

case 11118:
case 11120:
case 11122:
case 11124:
p.getActionSender().setString(p, "Where Would You Like To Go", 235, 1);
p.getActionSender().setString(p, "Warriors Guild", 235, 2);
p.getActionSender().setString(p, "Champions' Guild", 235, 3);
p.getActionSender().setString(p, "Monastery", 235, 4);
p.getActionSender().setString(p, "Ranging Guild", 235, 5);
p.getActionSender().setString(p, "No Where", 235, 6);
p.getActionSender().showChatboxInterface(p, 235);
break;

case 1704:
case 10362:
case 11113:
p.message("You currently have no charges left.");
break;
case 10354:
case 10356:
case 10358:
case 10360:
case 1706:
case 1708:
case 1710:
case 1712:
p.getActionSender().setString(p, "Where Would You Like To Go", 235, 1);
p.getActionSender().setString(p, "Edgeville", 235, 2);
p.getActionSender().setString(p, "Karamja", 235, 3);
p.getActionSender().setString(p, "Draynor Village", 235, 4);
p.getActionSender().setString(p, "Al Kharid", 235, 5);
p.getActionSender().setString(p, "No Where", 235, 6);
p.getActionSender().showChatboxInterface(p, 235);
break;

case 11105:
case 11107:
case 11109:
case 11111:
p.getActionSender().setString(p, "Where Would You Like To Go", 235, 1);
p.getActionSender().setString(p, "Fishing Guild", 235, 2);
p.getActionSender().setString(p, "Mining Guild", 235, 3);
p.getActionSender().setString(p, "Crafting Guild", 235, 4);
p.getActionSender().setString(p, "Cooking Guild", 235, 5);
p.getActionSender().setString(p, "No Where", 235, 6);
p.getActionSender().showChatboxInterface(p, 235);
break;

default:
Misc.println("[" + p.username + "] Item option 3: " + itemId);
break;
}
}
}


Step 2:
Go to PacketManager.java
Search for

public ItemOption2 itemOption2 = new ItemOption2();
Add this under it

public ItemOption3 itemOption3 = new ItemOption3();

Step 3:
Still in PacketManager.java

search for

case 134:
itemOption2.handlePacket(p, packetId, packetSize);
Add this under it

case 152:
itemOption3.handlePacket(p, packetId, packetSize);
break;

This is usefull to rub ammy's, real summoning, etc.

Credits: /

Break
June 18th, 2010, 12:35
Already in sources and leeched.
Your saying I can't code, But your asking me at msn how to change home -.-.

owner lorenzo
June 18th, 2010, 12:41
Wtf ??? btw not in all source's and i know i didnt make it i just post lol (i dont know the real maker) .. and dude i know how to change home

Break
June 18th, 2010, 12:51
Ok if you say so, Good job for posting this.
Else I'm maor from msn and I'm sure you know me, Because I helped you alot with coding.

owner lorenzo
June 18th, 2010, 12:55
Ooh duuh i know lol :)

Faab234
June 18th, 2010, 14:36
Thanks Owner Lorenzo.

owner lorenzo
June 18th, 2010, 14:48
Thanks Owner Lorenzo.

Thx for the comment ;)

jamie
June 19th, 2010, 05:21
Very useless sorry to tell ya :(

Nathan'
June 19th, 2010, 05:51
leeched for r00nserver same title aswell, its used for summoning

Rivers
October 13th, 2010, 20:45
well what can i say..no need for it you can just add case 152: before or under w/e case 150: will work as ItemOption1...makes life easier?

Perfection
October 13th, 2010, 20:54
Nice job, Lorenzo.