diff --git a/src/save/common/user_data_10.rs b/src/save/common/user_data_10.rs index 1c08235..69642de 100644 --- a/src/save/common/user_data_10.rs +++ b/src/save/common/user_data_10.rs @@ -62,7 +62,6 @@ pub struct ProfileSummaryEquipmentGaitem { impl Read for ProfileSummaryEquipmentGaitem { fn read(br: &mut BinaryReader) -> Result { let mut equipment = ProfileSummaryEquipmentGaitem::default(); - equipment.unk = br.read_u32()?; equipment.unk1 = br.read_u32()?; @@ -91,7 +90,6 @@ impl Read for ProfileSummaryEquipmentGaitem { equipment._0x4_2 = br.read_u32()?; for i in 0..4 { equipment.talismans[i] = br.read_u32()?; } equipment._0x4_3 = br.read_u32()?; - Ok(equipment) } } @@ -135,16 +133,17 @@ impl Write for ProfileSummaryEquipmentGaitem { pub struct ProfileSummaryEquipmentItem { pub left_hand_armaments: [u32; 3], pub right_hand_armaments: [u32; 3], + _0x4: u32, pub arrows: [u32; 2], pub bolts: [u32; 2], - pub _0x4: u32, + _0x8: u64, pub head: u32, pub chest: u32, pub arms: u32, pub legs: u32, - pub _0x4_2: u32, + _0x4_2: u32, pub talismans: [u32; 4], - pub _0x4_3: [u32; 6] + _0x4_3: [u32; 6] } impl Read for ProfileSummaryEquipmentItem { fn read(br: &mut BinaryReader) -> Result { @@ -156,16 +155,18 @@ impl Read for ProfileSummaryEquipmentItem { equipment.right_hand_armaments[1] = br.read_u32()?; equipment.left_hand_armaments[2] = br.read_u32()?; equipment.right_hand_armaments[2] = br.read_u32()?; + equipment._0x4 = br.read_u32()?; equipment.arrows[0] = br.read_u32()?; equipment.bolts[0] = br.read_u32()?; equipment.arrows[1] = br.read_u32()?; equipment.bolts[1] = br.read_u32()?; - equipment._0x4 = br.read_u32()?; + equipment._0x8 = br.read_u64()?; equipment.head = br.read_u32()?; equipment.chest = br.read_u32()?; equipment.arms = br.read_u32()?; equipment.legs = br.read_u32()?; equipment._0x4_2 = br.read_u32()?; + for i in 0..4 { equipment.talismans[i] = br.read_u32()?; } for i in 0..6 { equipment._0x4_3[i] = br.read_u32()?; } @@ -182,11 +183,12 @@ impl Write for ProfileSummaryEquipmentItem { bytes.extend(self.right_hand_armaments[1].to_le_bytes()); bytes.extend(self.left_hand_armaments[2].to_le_bytes()); bytes.extend(self.right_hand_armaments[2].to_le_bytes()); + bytes.extend(self._0x4.to_le_bytes()); bytes.extend(self.arrows[0].to_le_bytes()); bytes.extend(self.bolts[0].to_le_bytes()); bytes.extend(self.arrows[1].to_le_bytes()); bytes.extend(self.bolts[1].to_le_bytes()); - bytes.extend(self._0x4.to_le_bytes()); + bytes.extend(self._0x8.to_le_bytes()); bytes.extend(self.head.to_le_bytes()); bytes.extend(self.chest.to_le_bytes()); bytes.extend(self.arms.to_le_bytes()); diff --git a/src/ui/inventory/add.rs b/src/ui/inventory/add.rs index 36a349c..59cc72a 100644 --- a/src/ui/inventory/add.rs +++ b/src/ui/inventory/add.rs @@ -399,7 +399,13 @@ fn single_item_customization(ui: &mut Ui, inventory_vm: &mut InventoryViewModel, }); } else { - let max_upgrade = if item.data.reinforceTypeId != 0 && item.data.reinforceTypeId % 2200 == 0 {10} else {25}; + let max_upgrade = if item.data.reinforceTypeId != 0 &&( + item.data.reinforceTypeId % 2200 == 0 || + item.data.reinforceTypeId % 2400 == 0 || + item.data.reinforceTypeId % 3200 == 0 || + item.data.reinforceTypeId % 3300 == 0 || + item.data.reinforceTypeId % 8300 == 0 || + item.data.reinforceTypeId % 8500 == 0) {10} else {25}; let field = egui::DragValue::new(regulation_vm.selected_item.upgrade.as_mut().unwrap()) .clamp_range(0..=max_upgrade) .custom_formatter(|n, _| { diff --git a/src/util/regulation.rs b/src/util/regulation.rs index bbc6adc..748eaec 100644 --- a/src/util/regulation.rs +++ b/src/util/regulation.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, io::Error, path::PathBuf, str::FromStr, sync::{Mutex, RwLock}}; +use std::{collections::HashMap, io::Error, str::FromStr, sync::{Mutex, RwLock}}; use aes::cipher::{block_padding::NoPadding, BlockDecryptMut, KeyIvInit}; use binary_reader::{BinaryReader, Endian}; diff --git a/src/vm/inventory/add_bulk.rs b/src/vm/inventory/add_bulk.rs index e8b0443..43d2fcb 100644 --- a/src/vm/inventory/add_bulk.rs +++ b/src/vm/inventory/add_bulk.rs @@ -99,7 +99,13 @@ impl InventoryViewModel { } else {None}; - let is_somber = weapon_param.data.reinforceTypeId != 0 && weapon_param.data.reinforceTypeId % 2200 == 0; + let is_somber = weapon_param.data.reinforceTypeId != 0 && ( + weapon_param.data.reinforceTypeId % 2200 == 0 || + weapon_param.data.reinforceTypeId % 2400 == 0 || + weapon_param.data.reinforceTypeId % 3200 == 0 || + weapon_param.data.reinforceTypeId % 3300 == 0 || + weapon_param.data.reinforceTypeId % 8300 == 0 || + weapon_param.data.reinforceTypeId % 8500 == 0); let upgrade_level = if !is_projectile { if is_somber { Some(((self.bulk_items_weapon_level as f32 + 0.5)/2.5) as i16) diff --git a/src/vm/vm.rs b/src/vm/vm.rs index 6ae7e87..489cf00 100644 --- a/src/vm/vm.rs +++ b/src/vm/vm.rs @@ -183,7 +183,14 @@ pub mod vm { match held_weapon_res { Some(weapon_param) => { // Check if weapon is somber - let is_somber = weapon_param.data.reinforceTypeId != 0 && weapon_param.data.reinforceTypeId % 2200 == 0; + let is_somber = weapon_param.data.reinforceTypeId != 0 && ( + weapon_param.data.reinforceTypeId % 2200 == 0 || + weapon_param.data.reinforceTypeId % 2400 == 0 || + weapon_param.data.reinforceTypeId % 3200 == 0 || + weapon_param.data.reinforceTypeId % 3300 == 0 || + weapon_param.data.reinforceTypeId % 8300 == 0 || + weapon_param.data.reinforceTypeId % 8500 == 0 + ); // Extract weapon level based on wether weapon is somber or not let weapon_level = if is_somber{ @@ -209,7 +216,14 @@ pub mod vm { match storage_weapon_res { Some(weapon_param) => { // Check if weapon is somber - let is_somber = weapon_param.data.reinforceTypeId != 0 && weapon_param.data.reinforceTypeId % 2200 == 0; + let is_somber = weapon_param.data.reinforceTypeId != 0 && ( + weapon_param.data.reinforceTypeId % 2200 == 0 || + weapon_param.data.reinforceTypeId % 2400 == 0 || + weapon_param.data.reinforceTypeId % 3200 == 0 || + weapon_param.data.reinforceTypeId % 3300 == 0 || + weapon_param.data.reinforceTypeId % 8300 == 0 || + weapon_param.data.reinforceTypeId % 8500 == 0 + ); // Extract weapon level based on wether weapon is somber or not let weapon_level = if is_somber{