use of org.apollo.game.model.entity.Projectile in project apollo by apollo-rsps.
the class SendProjectileMessageEncoder method encode.
@Override
public GamePacket encode(SendProjectileMessage message) {
Projectile projectile = message.getProjectile();
Position source = projectile.getPosition();
Position destination = projectile.getDestination();
GamePacketBuilder builder = new GamePacketBuilder(181);
builder.put(DataType.BYTE, message.getPositionOffset());
builder.put(DataType.BYTE, destination.getX() - source.getX());
builder.put(DataType.BYTE, destination.getY() - source.getY());
builder.put(DataType.SHORT, projectile.getTarget());
builder.put(DataType.SHORT, projectile.getGraphic());
builder.put(DataType.BYTE, projectile.getStartHeight());
builder.put(DataType.BYTE, projectile.getEndHeight());
builder.put(DataType.SHORT, projectile.getDelay());
builder.put(DataType.SHORT, projectile.getLifetime());
builder.put(DataType.BYTE, projectile.getPitch());
builder.put(DataType.BYTE, projectile.getOffset());
return builder.toGamePacket();
}
Aggregations