diff --git a/attribs.txt b/attribs.txt new file mode 100644 index 0000000..0a88ffb --- /dev/null +++ b/attribs.txt @@ -0,0 +1,10 @@ +7 * 4 // special, int +11 * 4 // xp/rank/age, int +26 * 4 // stats +18 * 4 // skils +18 * 1 // skill tags +27 * 1 ? // trais, bool +11 * 1 ? // type, bool +101 * 4 ? // perks, int +10 * 4 ? // unk ? +10 * 4 ? // addictions, int \ No newline at end of file diff --git a/format.txt b/format.txt index e5e4efc..1d714eb 100644 --- a/format.txt +++ b/format.txt @@ -90,4 +90,23 @@ esh data types int32_t bottom 21 - FString -25 - FString \ No newline at end of file +25 - FString + +Attributes - player stats and skills +Modifiers - same as Attributes but applying new values to Attributes + +Attribute - ESH + int levSincePerk + bool Binary + esbin + u32 section_size + + int stats[7] + int traits[11] + int derived[26] + int skills[18] + bool skill_tags[18] + bool opt_traits[27] + bool type[11] + int perks[111] + int addictions[10] \ No newline at end of file diff --git a/src/fot/world.rs b/src/fot/world.rs index 969dfe4..7c8d338 100644 --- a/src/fot/world.rs +++ b/src/fot/world.rs @@ -12,6 +12,7 @@ use deflate::deflate_bytes_zlib; use inflate::inflate_bytes_zlib; use std::path::Path; +use super::esh::{ESH, ESHValue}; pub struct World { pub offset: usize, @@ -40,7 +41,19 @@ impl World { for (name, value) in &esh.props { println!("{} {}", name, value); } - self.entlist.dump_to_entfile(ent, Path::new("D:\\actor.ent"))?; + //self.entlist.dump_to_entfile(ent, Path::new("D:\\actor.ent"))?; + + println!(""); + if let ESHValue::Binary(attributes) = &esh.props["Attributes"] { + let raw = Raw { offset: 0, size: attributes.len(), mem: attributes.to_vec() }; + let mut rd = ReadStream::new(&raw, 0); + + let size = rd.read_u32()?; + let attrs_esh: ESH = rd.read()?; + for (name, value) in &attrs_esh.props { + println!("{} {}", name, value); + } + } Ok(()) }