RuneHive-Game
Loading...
Searching...
No Matches
SendProjectileTestPacket.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.game.world.position.Position;
5import com.runehive.net.packet.OutgoingPacket;
6
8 private final Position position;
9 private final Position offsetX, offsetY;
11
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}
This class represents a character controlled by a player.
Definition Player.java:125
Represents a single tile on the game world.
Definition Position.java:14
OutgoingPacket(int opcode, int capacity)
SendProjectileTestPacket(Position position, Position offset, int angle, int speed, int gfxMoving, int startHeight, int endHeight, int lockon, int time, int creatorSize, int startDistanceOffset)