From d507547dd3265a736756e4addcb18fc76a544346 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 18 Apr 2025 12:38:02 -0400 Subject: [PATCH] Fix action results not working The opcode wasn't updated for 7.20h, and I think was overlapping with some status effect list one (hence the weird stuff happening in the update showcase video.) Also updated the testdata, even though it wasn't needed. I also added back the actor hp/mp update, because I deleted that thinking it would fix something but it didn't. --- resources/opcodes.json | 2 +- resources/tests/action_result.bin | Bin 124 -> 124 bytes src/bin/kawari-world.rs | 6 ++++++ src/world/ipc/action_result.rs | 20 ++++++++++++++------ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/resources/opcodes.json b/resources/opcodes.json index 75e63fd..3e971eb 100644 --- a/resources/opcodes.json +++ b/resources/opcodes.json @@ -147,7 +147,7 @@ }, { "name": "ActionResult", - "opcode": 508, + "opcode": 447, "size": 124 }, { diff --git a/resources/tests/action_result.bin b/resources/tests/action_result.bin index 57bd4886db565bbe66059690b3e041474a99aba3..1c42e301e1d27ce013fa819b7ee4472a5f37e049 100644 GIT binary patch delta 47 qcmb=ak#XW todo!() } } + + let actor = *actor; + connection.update_hp_mp(actor.id, actor.hp, 10000).await; } let ipc = ServerZoneIpcSegment { @@ -733,6 +736,9 @@ async fn client_loop( flag: 1, effect_count: effects_builder.effects.len() as u8, effects, + unk1: 2662353, + unk2: 3758096384, + hidden_animation: 1, ..Default::default() }), ..Default::default() diff --git a/src/world/ipc/action_result.rs b/src/world/ipc/action_result.rs index cba68de..0971bc1 100644 --- a/src/world/ipc/action_result.rs +++ b/src/world/ipc/action_result.rs @@ -69,17 +69,20 @@ mod tests { let mut buffer = Cursor::new(&buffer); let action_result = ActionResult::read_le(&mut buffer).unwrap(); - assert_eq!(action_result.main_target.object_id, ObjectId(0x400097d0)); - assert_eq!( - action_result.target_id_again.object_id, - ObjectId(0x400097d0) - ); + assert_eq!(action_result.main_target.object_id, ObjectId(0x40070E42)); assert_eq!(action_result.action_id, 31); + assert_eq!(action_result.unk1, 2662353); // TODO: probably means this field is wrong assert_eq!(action_result.animation_lock_time, 0.6); - assert_eq!(action_result.rotation, 1.9694216); + assert_eq!(action_result.unk2, 3758096384); // TODO: ditto + assert_eq!(action_result.hidden_animation, 1); + assert_eq!(action_result.rotation, 1.207309); assert_eq!(action_result.action_animation_id, 31); + assert_eq!(action_result.variation, 0); assert_eq!(action_result.flag, 1); + assert_eq!(action_result.unk3, 0); assert_eq!(action_result.effect_count, 1); + assert_eq!(action_result.unk4, 0); + assert_eq!(action_result.unk5, [0; 6]); // effect 0: attack assert_eq!(action_result.effects[0].kind, EffectKind::Damage); @@ -92,5 +95,10 @@ mod tests { // effect 1: start action combo assert_eq!(action_result.effects[1].kind, EffectKind::BeginCombo); + + assert_eq!( + action_result.target_id_again.object_id, + ObjectId(0x40070E42) + ); } }