summaryrefslogtreecommitdiff
path: root/packets
diff options
context:
space:
mode:
Diffstat (limited to 'packets')
-rw-r--r--packets/login_failed_packet.gd22
-rw-r--r--packets/map_server/moving_entity_appeared_packet.gd182
2 files changed, 201 insertions, 3 deletions
diff --git a/packets/login_failed_packet.gd b/packets/login_failed_packet.gd
new file mode 100644
index 0000000..93ebf23
--- /dev/null
+++ b/packets/login_failed_packet.gd
@@ -0,0 +1,22 @@
+## rAthena References:
+## - clif_authfail_fd
+class_name LoginFailedPacket
+extends Packet
+
+
+const HEADER := 0x0081
+const BYTE_LENGTH := 3
+
+
+## Byte Type: u8
+## Byte Length: 1
+@warning_ignore("enum_variable_without_default")
+var reason: Constants.LoginFailedReason
+
+
+static func from_bytes(bytes: PackedByteArray) -> LoginFailedPacket:
+ var packet = LoginFailedPacket.new()
+
+ packet.reason = bytes.decode_u8(2)
+
+ return packet
diff --git a/packets/map_server/moving_entity_appeared_packet.gd b/packets/map_server/moving_entity_appeared_packet.gd
index 43b19ae..4ff9a9e 100644
--- a/packets/map_server/moving_entity_appeared_packet.gd
+++ b/packets/map_server/moving_entity_appeared_packet.gd
@@ -1,5 +1,6 @@
## rAthena References:
## - ZC_NOTIFY_MOVEENTRY11
+## - clif_set_unit_walking
class_name MovingEntityAppearedPacket
extends Packet
@@ -20,12 +21,187 @@ var object_type: int
## Byte Length: 4
var entity_id: int
-# TODO
+## Byte Type: u32
+## Byte Length: 4
+var group_id: int
+## Byte Type: u16
+## Byte Length: 2
+var movement_speed: int
+
+## Byte Type: u16
+## Byte Length: 2
+var body_state: int
+
+## Byte Type: u16
+## Byte Length: 2
+var health_state: int
+
+## Byte Type: u32
+## Byte Length: 4
+var effect_state: int
+
+## Byte Type: u16
+## Byte Length: 2
+var job: int
+
+## Byte Type: u16
+## Byte Length: 2
+var head: int
+
+## Byte Type: u32
+## Byte Length: 4
+var weapon: int
+
+## Byte Type: u32
+## Byte Length: 4
+var shield: int
+
+## Byte Type: u16
+## Byte Length: 2
+var accessory: int
+
+## Byte Type: u32
+## Byte Length: 4
+var move_start_time: int
+
+## Byte Type: u16
+## Byte Length: 2
+var accessory2: int
+
+## Byte Type: u16
+## Byte Length: 2
+var accessory3: int
+
+## Byte Type: u16
+## Byte Length: 2
+var head_palette: int
+
+## Byte Type: u16
+## Byte Length: 2
+var body_palette: int
+
+## Byte Type: u16
+## Byte Length: 2
+var head_direction: int
+
+## Byte Type: u16
+## Byte Length: 2
+var robe: int
-static func from_bytes(bytes: PackedByteArray) -> MovingEntityAppearedPacket:
+## Byte Type: u32
+## Byte Length: 4
+var guild_id: int
+
+## Byte Type: u16
+## Byte Length: 2
+var emblem_version: int
+
+## Byte Type: u16
+## Byte Length: 2
+var honor: int
+
+## Byte Type: u32
+## Byte Length: 4
+var virtue: int
+
+## Byte Type: u8
+## Byte Length: 1
+var is_pk_mode_on: bool
+
+## Byte Type: u8
+## Byte Length: 1
+var gender: Constants.Gender
+
+## Byte Type: u8
+## Byte Length: 6
+var position: PackedByteArray
+
+## Byte Type: u8
+## Byte Length: 1
+var size_x: int
+
+## Byte Type: u8
+## Byte Length: 1
+var size_y: int
+
+## Byte Type: u16
+## Byte Length: 2
+var c_level: int
+
+## Byte Type: u16
+## Byte Length: 2
+var font: int
+
+## Byte Type: i32
+## Byte Length: 4
+var maximum_health_points: int
+
+## Byte Type: i32
+## Byte Length: 4
+var health_points: int
+
+## Byte Type: u8
+## Byte Length: 1
+var is_boss: bool
+
+## Byte Type: u16
+## Byte Length: 2
+var body: int
+
+## Byte Length: 24
+var name: String
+
+
+func get_size() -> Vector2:
+ return Vector2(
+ size_x,
+ size_y
+ )
+
+
+static func from_bytes(pbytes: PackedByteArray) -> MovingEntityAppearedPacket:
+ var bytes := ByteStream.from_bytes(pbytes)
+
var packet = MovingEntityAppearedPacket.new()
- packet.packet_length = bytes.decode_u16(2)
+ bytes.advance(2) # skip header
+
+ packet.packet_length = bytes.decode_u16()
+ packet.object_type = bytes.decode_u8()
+ packet.entity_id = bytes.decode_u32()
+ packet.group_id = bytes.decode_u32()
+ packet.movement_speed = bytes.decode_u16()
+ packet.body_state = bytes.decode_u16()
+ packet.health_state = bytes.decode_u16()
+ packet.effect_state = bytes.decode_u32()
+ packet.job = bytes.decode_u16()
+ packet.head = bytes.decode_u16()
+ packet.weapon = bytes.decode_u32()
+ packet.shield = bytes.decode_u32()
+ packet.accessory = bytes.decode_u16()
+ packet.move_start_time = bytes.decode_u32()
+ packet.accessory2 = bytes.decode_u16()
+ packet.accessory3 = bytes.decode_u16()
+ packet.head_palette = bytes.decode_u16()
+ packet.body_palette = bytes.decode_u16()
+ packet.head_direction = bytes.decode_u16()
+ packet.robe = bytes.decode_u16()
+ packet.guild_id = bytes.decode_u32()
+ packet.emblem_version = bytes.decode_u16()
+ packet.honor = bytes.decode_u16()
+ packet.virtue = bytes.decode_u32()
+ packet.is_pk_mode_on = bytes.decode_u8()
+ packet.gender = bytes.decode_u8()
+ packet.position = bytes.get_buffer(6).bytes
+ packet.size_x = bytes.decode_u8()
+ packet.size_y = bytes.decode_u8()
+ packet.c_level = bytes.decode_u16()
+ packet.font = bytes.decode_u16()
+ packet.maximum_health_points = bytes.decode_s32()
+ packet.health_points = bytes.decode_s32()
+ packet.is_boss = bytes.decode_u8()
+ packet.body = bytes.decode_u16()
+ packet.name = bytes.get_string_from_utf8(24)
return packet