From 19b84f4164b8d91b339385cd28c084b21ec11bf1 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 1 Apr 2025 23:25:11 -0400 Subject: [PATCH] Extract new data from Auracite Now your character's nameday, city-state, guardian and voice is transferred over. There seems to be a problem with the nameday month, not sure who is wrong yet. --- src/lobby/chara_make.rs | 2 +- src/world/database.rs | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/lobby/chara_make.rs b/src/lobby/chara_make.rs index b891e62..ea5e611 100644 --- a/src/lobby/chara_make.rs +++ b/src/lobby/chara_make.rs @@ -7,7 +7,7 @@ pub struct CharaMake { pub customize: CustomizeData, pub unk1: i32, pub guardian: i32, - pub birth_month: i32, + pub birth_month: i32, // TODO: wrong? pub birth_day: i32, pub classjob_id: i32, pub unk2: i32, diff --git a/src/world/database.rs b/src/world/database.rs index 87d78eb..3e6eded 100644 --- a/src/world/database.rs +++ b/src/world/database.rs @@ -74,9 +74,24 @@ impl WorldDatabase { let mut archive = zip::ZipArchive::new(file).unwrap(); + #[derive(Deserialize)] + struct GenericValue { + value: i32, + } + + #[derive(Deserialize)] + struct NamedayValue { + day: i32, + month: i32, + } + #[derive(Deserialize)] struct CharacterJson { name: String, + city_state: GenericValue, + nameday: NamedayValue, + guardian: GenericValue, + voice: i32, } let character: CharacterJson; @@ -103,19 +118,18 @@ impl WorldDatabase { let chara_make = CharaMake { customize, unk1: 73, - guardian: 1, // TODO: extract these as well - birth_month: 1, - birth_day: 1, + guardian: character.guardian.value, + birth_month: character.nameday.month, + birth_day: character.nameday.day, classjob_id: 5, unk2: 1, }; - // TODO: extract city-state // TODO: import inventory self.create_player_data( &character.name, &chara_make.to_json(), - 2, + character.city_state.value as u8, 132, Inventory::default(), );