Fire cape
July 10th, 2010, 20:58
Description: Adding a packet that makes an interface appear over the chatbox.
Assumed Knowledge: How to read.
Tested Server: Rs377d
Files/Classes modified: ActionSender.
Files/Classes added: N/A
This is what your adding:
Only the registered members can see the link.
Open your source, and follow this package.
org.rs377d.net.util
Open up ActionSender and add theese in.
/**
* Sends an interface over the chatbox.
* @param interfaceId the chatbox interface id.
* @return the action sender instance for chaining.
*/
public ActionSender chatBoxInterface(int interfaceId) {
Rs2PacketBuilder packet = new Rs2PacketBuilder(109);
packet.putShort(interfaceId);
player.getSession().write(packet.toPacket());
return this;
}
/**
* Sends text onto an interface.
* @param text the first line of text.
* @param text2 the second line of text.
* @param text3 the third line of text.
* @param text4 the fourth line of text.
* @param title the title of the text.
* @return the action sender instance for chanining.
*/
public ActionSender infodia(String text, String text2, String text3, String text4, String title){
sendString(title, 6180);
sendString(text, 6181);
sendString(text2, 6182);
sendString(text3, 6183);
sendString(text4, 6184);
chatBoxInterface(6179);
return this;
}
Assumed Knowledge: How to read.
Tested Server: Rs377d
Files/Classes modified: ActionSender.
Files/Classes added: N/A
This is what your adding:
Only the registered members can see the link.
Open your source, and follow this package.
org.rs377d.net.util
Open up ActionSender and add theese in.
/**
* Sends an interface over the chatbox.
* @param interfaceId the chatbox interface id.
* @return the action sender instance for chaining.
*/
public ActionSender chatBoxInterface(int interfaceId) {
Rs2PacketBuilder packet = new Rs2PacketBuilder(109);
packet.putShort(interfaceId);
player.getSession().write(packet.toPacket());
return this;
}
/**
* Sends text onto an interface.
* @param text the first line of text.
* @param text2 the second line of text.
* @param text3 the third line of text.
* @param text4 the fourth line of text.
* @param title the title of the text.
* @return the action sender instance for chanining.
*/
public ActionSender infodia(String text, String text2, String text3, String text4, String title){
sendString(title, 6180);
sendString(text, 6181);
sendString(text2, 6182);
sendString(text3, 6183);
sendString(text4, 6184);
chatBoxInterface(6179);
return this;
}