From ed44de89561e831da19f475d2b8aeec755c0fefa Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 6 May 2025 22:37:02 -0400 Subject: [PATCH] "Implement" the Unending Journey Apparently there's a scene that's super easy to use, that omniously says "You cannot consult The Unending Journey at this time". That's cool, though. --- USAGE.md | 1 - resources/scripts/Global.lua | 2 + resources/scripts/tosort/UnendingJourney.lua | 10 +++ src/world/chat_handler.rs | 83 -------------------- 4 files changed, 12 insertions(+), 84 deletions(-) create mode 100644 resources/scripts/tosort/UnendingJourney.lua diff --git a/USAGE.md b/USAGE.md index c3439a3..858801e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -79,7 +79,6 @@ This feature is still a work-in-progress, and not all data is imported yet. These special debug commands start with `!` and are custom to Kawari. * `!setpos `: Teleport to the specified location -* `!spawnplayer`: Spawn another player for debugging, not known to work at the moment * `!spawnnpc`: Spawn a NPC for debugging * `!spawnmonster`: Spawn a monster for debugging * `!playscene `: Plays an event. Only some events are supported for now: diff --git a/resources/scripts/Global.lua b/resources/scripts/Global.lua index 2f5e70d..7910076 100644 --- a/resources/scripts/Global.lua +++ b/resources/scripts/Global.lua @@ -26,6 +26,7 @@ registerAction(9, "actions/FastBlade.lua") registerAction(6221, "items/Fantasia.lua") -- Events +registerEvent(721028, "tosort/UnendingJourney.lua") registerEvent(131079, "warp/WarpInnLimsaLominsa.lua") registerEvent(131080, "warp/WarpInnGridania.lua") registerEvent(131081, "warp/WarpInnUldah.lua") @@ -45,3 +46,4 @@ registerEvent(1245187, "opening/OpeningUldah.lua") -- Commands registerCommand("setpos", "commands/debug/SetPos.lua") registerCommand("classjob", "commands/debug/ClassJob.lua") +registerCommand("setspeed", "commands/debug/SetSpeed.lua") diff --git a/resources/scripts/tosort/UnendingJourney.lua b/resources/scripts/tosort/UnendingJourney.lua new file mode 100644 index 0000000..dfa9fd8 --- /dev/null +++ b/resources/scripts/tosort/UnendingJourney.lua @@ -0,0 +1,10 @@ +-- TODO: actually implement this menu + +function onTalk(target, player) + -- you cannot consult, which is good because we don't know how to implement this anyway + player:play_scene(target, EVENT_ID, 00000, 8192, 0) +end + +function onReturn(scene, results, player) + player:finish_event(EVENT_ID) +end diff --git a/src/world/chat_handler.rs b/src/world/chat_handler.rs index 1bf1ff7..810f516 100644 --- a/src/world/chat_handler.rs +++ b/src/world/chat_handler.rs @@ -54,89 +54,6 @@ impl ChatHandler { let parts: Vec<&str> = chat_message.message.split(' ').collect(); match parts[0] { - "!spawnplayer" => { - let config = get_config(); - - // send player spawn - { - let ipc = ServerZoneIpcSegment { - unk1: 20, - unk2: 0, - op_code: ServerZoneIpcType::PlayerSpawn, - option: 0, - timestamp: timestamp_secs(), - data: ServerZoneIpcData::PlayerSpawn(PlayerSpawn { - account_id: 1000000, - content_id: 1000000, - current_world_id: config.world.world_id, - home_world_id: config.world.world_id, - common: CommonSpawn { - class_job: 35, - name: "Test Actor".to_string(), - hp_curr: 250, - hp_max: 250, - mp_curr: 10000, - mp_max: 10000, - level: 5, - object_kind: ObjectKind::Player(PlayerSubKind::Player), - spawn_index: connection.get_free_spawn_index(), - look: CUSTOMIZE_DATA, - display_flags: DisplayFlag::INVISIBLE - | DisplayFlag::HIDE_HEAD - | DisplayFlag::UNK, - models: [ - 0, // head - 89, // body - 89, // hands - 89, // legs - 89, // feet - 0, // ears - 0, // neck - 0, // wrists - 0, // left finger - 0, // right finger - ], - pos: connection.player_data.position, - ..Default::default() - }, - ..Default::default() - }), - }; - - connection - .send_segment(PacketSegment { - source_actor: 0x106ad804, - target_actor: connection.player_data.actor_id, - segment_type: SegmentType::Ipc, - data: SegmentData::Ipc { data: ipc }, - }) - .await; - } - - // zone in - { - let ipc = ServerZoneIpcSegment { - op_code: ServerZoneIpcType::ActorControl, - timestamp: timestamp_secs(), - data: ServerZoneIpcData::ActorControl(ActorControl { - category: ActorControlCategory::ZoneIn { - warp_finish_anim: 0x0, - raise_anim: 0x0, - }, - }), - ..Default::default() - }; - - connection - .send_segment(PacketSegment { - source_actor: 0x106ad804, - target_actor: connection.player_data.actor_id, - segment_type: SegmentType::Ipc, - data: SegmentData::Ipc { data: ipc }, - }) - .await; - } - } "!spawnnpc" => { let ipc = ServerZoneIpcSegment { op_code: ServerZoneIpcType::NpcSpawn,