RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SendProjectileTestPacket.java
1package com.osroyale.net.packet.out;
2
3import com.osroyale.game.world.entity.mob.player.Player;
4import com.osroyale.game.world.position.Position;
5import com.osroyale.net.packet.OutgoingPacket;
6
7public class SendProjectileTestPacket extends OutgoingPacket {
8 private final Position position;
9 private final Position offsetX, offsetY;
10 private int lockon, gfxMoving, startHeight, endHeight, time, speed, angle, creatorSize, startDistanceOffset;
11
12 public SendProjectileTestPacket(Position position, Position offset,
13 int angle, int speed, int gfxMoving, int startHeight, int endHeight,
14 int lockon, int time, int creatorSize, int startDistanceOffset) {
15 super(117, 15);
16 this.position = position;
17 this.offsetY = offset;
18 this.offsetX = offset;
19 this.lockon = lockon;
20 this.gfxMoving = gfxMoving;
21 this.startHeight = startHeight;
22 this.endHeight = endHeight;
23 this.time = time;
24 this.speed = speed;
25 this.angle = angle;
26 this.creatorSize = creatorSize;
27 this.startDistanceOffset = startDistanceOffset;
28 }
29
30 @Override
31 public boolean encode(Player player) {
32 player.send(new SendCoordinate(position));
33 builder.writeByte(0)
34 .writeByte(angle)
35 .writeByte(offsetY.getY())
36 .writeByte(offsetY.getX())
37 .writeShort(lockon)
38 .writeShort(gfxMoving)
39 .writeByte(startHeight)
40 .writeByte(endHeight)
41 .writeShort(time)
42 .writeShort(speed)
43 .writeByte(16) //slope
44 .writeByte((creatorSize * 64) + (startDistanceOffset * 64));
45 return true;
46 }
47}