RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.net.packet.out.SendProjectile Class Reference
Inheritance diagram for com.runehive.net.packet.out.SendProjectile:
Collaboration diagram for com.runehive.net.packet.out.SendProjectile:

Public Member Functions

boolean encode (Player player)
 SendProjectile (Projectile projectile, Position position, int lock, byte offsetX, byte offsetY)
Public Member Functions inherited from com.runehive.net.packet.OutgoingPacket
void execute (Player player)
 OutgoingPacket (int opcode, int capacity)
 OutgoingPacket (int opcode, PacketType type)
 OutgoingPacket (int opcode, PacketType type, int size)

Private Attributes

final int lock
final byte offsetX
final byte offsetY
final Position position
final Projectile projectile

Additional Inherited Members

Protected Attributes inherited from com.runehive.net.packet.OutgoingPacket
final PacketBuilder builder

Detailed Description

Definition at line 8 of file SendProjectile.java.

Constructor & Destructor Documentation

◆ SendProjectile()

com.runehive.net.packet.out.SendProjectile.SendProjectile ( Projectile projectile,
Position position,
int lock,
byte offsetX,
byte offsetY )

Definition at line 16 of file SendProjectile.java.

16 {
17 super(117, 15);
18 this.projectile = projectile;
19 this.lock = lock;
20 this.offsetX = offsetX;
21 this.offsetY = offsetY;
22 this.position = position;
23 }

References lock, offsetX, offsetY, position, and projectile.

Member Function Documentation

◆ encode()

boolean com.runehive.net.packet.out.SendProjectile.encode ( Player player)

Reimplemented from com.runehive.net.packet.OutgoingPacket.

Definition at line 26 of file SendProjectile.java.

26 {
27 player.send(new SendCoordinate(position));
28 builder.writeByte(((projectile.getOffsetX() & 7) << 3) | (projectile.getOffsetY() & 7))
29 .writeByte(offsetX)
30 .writeByte(offsetY)
31 .writeShort(lock)
32 .writeShort(projectile.getId())
33 .writeByte(projectile.getStartHeight())
34 .writeByte(projectile.getEndHeight())
35 .writeShort(projectile.getDelay())
36 .writeShort(projectile.getDuration())
37 .writeByte(projectile.getCurve())
38 .writeByte(projectile.getDistance());
39 return true;
40 }

References com.runehive.net.packet.OutgoingPacket.builder, lock, offsetX, offsetY, position, projectile, and com.runehive.game.world.entity.mob.player.Player.send().

Here is the call graph for this function:

Member Data Documentation

◆ lock

final int com.runehive.net.packet.out.SendProjectile.lock
private

Definition at line 12 of file SendProjectile.java.

Referenced by encode(), and SendProjectile().

◆ offsetX

final byte com.runehive.net.packet.out.SendProjectile.offsetX
private

Definition at line 13 of file SendProjectile.java.

Referenced by encode(), and SendProjectile().

◆ offsetY

final byte com.runehive.net.packet.out.SendProjectile.offsetY
private

Definition at line 14 of file SendProjectile.java.

Referenced by encode(), and SendProjectile().

◆ position

final Position com.runehive.net.packet.out.SendProjectile.position
private

Definition at line 11 of file SendProjectile.java.

Referenced by encode(), and SendProjectile().

◆ projectile

final Projectile com.runehive.net.packet.out.SendProjectile.projectile
private

Definition at line 10 of file SendProjectile.java.

Referenced by encode(), and SendProjectile().


The documentation for this class was generated from the following file: