Fire cape
July 11th, 2010, 12:32
Description: Adding a packet that controls the camera angle, possibly used for cutscenes.
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.
Normal camera.
/**
* Camera angle. possibly used for cutscenes.
* @param x the x coordinate of the camera.
* @param y the y coordinate of the camera.
* @param height the height of the camera.
* @param speed the speed of the camera
* @param angle the angle of the camera.
* @return the action sender instance, for chaining.
*/
public ActionSender camera(int x, int y, int height, int speed, int angle) {
Rs2PacketBuilder packet = new Rs2PacketBuilder(167);
packet.put((byte) ((byte) x/64));
packet.put((byte) ((byte) y/64));
packet.putShort(height);
packet.put((byte) speed);
packet.put((byte) angle);
player.getSession().write(packet.toPacket());
return this;
}
Verry similar to the other camera, possibly used for the spinning camera?
/**
* Spinning camera? possibly used for cutscenes.
* @param x the x coordinate of the camera.
* @param y the y coordinate of the camera.
* @param height the height of the camera.
* @param speed the speed of the camera.
* @param angle the angle of the camera.
* @return the action sender instance, for chaining.
*/
public ActionSender spinningCamera(int x, int y, int height, int speed, int angle) {
Rs2PacketBuilder packet = new Rs2PacketBuilder(3);
packet.put((byte) x);
packet.put((byte) y);
packet.putShort(height);
packet.put((byte) speed);
packet.put((byte) angle);
player.getSession().write(packet.toPacket());
return this;
}
Stopping the camera.
/**
* Stops the camera.
* @return the action sender instance, for chaining.
*/
public ActionSender stopCamera() {
Rs2PacketBuilder packet = new Rs2PacketBuilder(148);
player.getSession().write(packet.toPacket());
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.
Normal camera.
/**
* Camera angle. possibly used for cutscenes.
* @param x the x coordinate of the camera.
* @param y the y coordinate of the camera.
* @param height the height of the camera.
* @param speed the speed of the camera
* @param angle the angle of the camera.
* @return the action sender instance, for chaining.
*/
public ActionSender camera(int x, int y, int height, int speed, int angle) {
Rs2PacketBuilder packet = new Rs2PacketBuilder(167);
packet.put((byte) ((byte) x/64));
packet.put((byte) ((byte) y/64));
packet.putShort(height);
packet.put((byte) speed);
packet.put((byte) angle);
player.getSession().write(packet.toPacket());
return this;
}
Verry similar to the other camera, possibly used for the spinning camera?
/**
* Spinning camera? possibly used for cutscenes.
* @param x the x coordinate of the camera.
* @param y the y coordinate of the camera.
* @param height the height of the camera.
* @param speed the speed of the camera.
* @param angle the angle of the camera.
* @return the action sender instance, for chaining.
*/
public ActionSender spinningCamera(int x, int y, int height, int speed, int angle) {
Rs2PacketBuilder packet = new Rs2PacketBuilder(3);
packet.put((byte) x);
packet.put((byte) y);
packet.putShort(height);
packet.put((byte) speed);
packet.put((byte) angle);
player.getSession().write(packet.toPacket());
return this;
}
Stopping the camera.
/**
* Stops the camera.
* @return the action sender instance, for chaining.
*/
public ActionSender stopCamera() {
Rs2PacketBuilder packet = new Rs2PacketBuilder(148);
player.getSession().write(packet.toPacket());
return this;
}