1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-07-17 18:47:46 +00:00
kawari/src/ipc/zone/client_trigger.rs
Joshua Goins 94ed036431 Add script for the Teleport action
This makes the Teleport action functional now, although it looks pretty
rough as it warps you instantly instead of waiting for the action to
actually finish.
2025-05-11 10:12:02 -04:00

48 lines
1 KiB
Rust

use binrw::binrw;
#[binrw]
#[derive(Debug, Eq, PartialEq, Clone)]
pub enum ClientTriggerCommand {
#[brw(magic = 0x3u16)]
SetTarget {
#[brw(pad_before = 2)]
actor_id: u32,
},
#[brw(magic = 0xC81u16)]
Unk1 {},
#[brw(magic = 0xC9u16)]
Unk2 {},
#[brw(magic = 0x1F9u16)]
ChangePose {
#[brw(pad_before = 2)] // padding
unk1: u32,
pose: u32,
},
#[brw(magic = 0x1FAu16)]
ReapplyPose {
#[brw(pad_before = 2)] // padding
unk1: u32,
pose: u32,
},
#[brw(magic = 0xCAu16)]
TeleportQuery {
#[brw(pad_before = 2)]
aetheryte_id: u32,
// TODO: fill out the rest
},
}
#[binrw]
#[derive(Debug, Clone)]
pub struct ClientTrigger {
#[brw(pad_size_to = 32)] // take into account categories without params
pub trigger: ClientTriggerCommand,
}
impl Default for ClientTrigger {
fn default() -> Self {
Self {
trigger: ClientTriggerCommand::SetTarget { actor_id: 0 },
}
}
}