Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions crates/eldenring/src/cs/chr_ins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ use crate::cs::session_manager::SessionManagerPlayerEntryBase;
use crate::cs::sp_effect::{NpcSpEffectEquipCtrl, SpecialEffect};
use crate::cs::task::{CSEzRabbitNoUpdateTask, CSEzVoidTask};
use crate::cs::world_chr_man::{ChrSetEntry, WorldChrMan};
use crate::cs::{BlockId, CSPlayerMenuCtrl, EquipmentDurabilityStatus, OptionalItemId};
use crate::cs::{
BlockId, CSEzRabbitTask, CSEzUpdateTask, CSPlayerMenuCtrl, EquipmentDurabilityStatus,
OptionalItemId,
};
use crate::dltx::DLString;
use crate::fd4::FD4Time;
use crate::param::{ATK_PARAM_ST, NPC_PARAM_ST};
Expand Down Expand Up @@ -255,11 +258,14 @@ pub struct ChrIns {
/// sfx.
pub mimicry_establishment_param_id: i32,
unk228: u32,
unk22c: u32,
/// Light set ID affecting this character in GParams.
/// Eg. 1100 for main player or 100 for most enemies.
pub gparam_light_set_id: i32,
// Possibly contains some id related to current gparam and attached to chr geometry
unk230: u32,
// Same as above
unk234: u32,
/// Fog ID affecting this character in GParams.
/// Eg. 1100 for main player or 100 for most enemies.
pub gparam_fog_id: i32,
/// Transparency multiplier for the character
/// Controlled by TAE Event 193 SetOpacityKeyframe
pub opacity_keyframes_multiplier: f32,
Expand Down Expand Up @@ -817,6 +823,10 @@ pub struct CSModelIns {
pub model_item: OwnedPtr<CSFD4ModelItem>,
pub model_disp_entity: usize,
pub location_entity: usize,
unk28: usize,
draw_param: [u8; 0xd0],
pub update_task: CSEzUpdateTask<CSEzRabbitTask, Self>,
unk130: [u8; 0x20],
}

#[repr(C)]
Expand Down Expand Up @@ -1047,17 +1057,21 @@ pub enum ChrType {
Local = 0,
WhitePhantom = 1,
Duelist = 2,
Ghost = 3,
/// Name Source: %s_Wander string
WanderGhost = 3,
Ghost1 = 4,
Npc = 5,
Unk6 = 6,
Unk7 = 7,
GrayPhantom = 8,
Unk9 = 9,
BloodstainGhost = 10,
BonfireGhost = 11,
/// Name Source: %s_Replay string
ReplayGhost = 10,
/// Name Source: %s_Display string
DisplayGhost = 11,
Unk12 = 12,
Arena = 13,
/// Name Source: %s_Message string
MessageGhost = 14,
BloodyFinger = 15,
Recusant = 16,
Expand Down
3 changes: 2 additions & 1 deletion crates/eldenring/src/cs/field_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ pub struct WorldBlockInfo {
pub world_area_info_index: i32,
unk3c: u32,
unk40: bool,
unk41: [u8; 0x7],
/// Whether this block is a skybox block (index 99).
pub is_skybox_block: bool,
msb_res_cap: NonNull<()>,
unk50: u64,
unk58: u64,
Expand Down
28 changes: 27 additions & 1 deletion crates/eldenring/src/cs/net_man.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::ptr::NonNull;

use crate::{
DLVector,
cs::{DisplayGhostData, PasswordData},
cs::{MultiplayRole, MultiplayType, SummonParamType},
dltx::DLString,
fd4::{FD4StepBase, FD4StepBaseInterface, FD4Time},
Expand Down Expand Up @@ -62,7 +63,7 @@ pub struct CSNetBloodMessageDb {
pub entries: DLList<OwnedPtr<CSNetBloodMessageDbItem>>,
unk20: usize,
/// Seemingly contains message data for messages created by local user
pub created_data: DLList<usize>,
pub created_data: DLList<OwnedPtr<CSNetBloodMessageCreatedData>>,
// Contains ???
unk40: DLList<usize>,
unk58: usize,
Expand All @@ -75,6 +76,31 @@ pub struct CSNetBloodMessageDb {
unk160: usize,
}

#[repr(C)]
pub struct CSNetBloodMessageCreatedData {
pub player_id: u32,
unk4: [u8; 8],
pub message_id: u64,
pub block_id: BlockId,
unk1c: u32,
pub position: BlockPosition,
pub template1: u16,
pub gesture_param: u16,
pub part1: u16,
pub infix: u16,
pub template2: u16,
pub part2: u16,
unk3c: u16,
pub display_ghost: DisplayGhostData,
pub character_name: [u16; 20],
pub positive_rating: u16,
pub negative_rating: u16,
unkfc: u16,
unkfe: [u8; 2],
pub group_passwords: [PasswordData; 5],
pub net_blood_message_db_item: OwnedPtr<CSNetBloodMessageDbItem>,
}

#[repr(C)]
pub struct CSNetBloodMessageDbItem {
vftable: usize,
Expand Down
41 changes: 29 additions & 12 deletions crates/eldenring/src/cs/player_game_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,9 @@ pub struct PlayerGameData {
unk108: u8,
pub reached_max_rune_memory: u8,
unk10a: [u8; 0xE],
pub password: [u16; 0x8],
unk128: u16,
group_password_1: [u16; 0x8],
unk13a: u16,
group_password_2: [u16; 0x8],
unk14c: u16,
group_password_3: [u16; 0x8],
unk15e: u16,
group_password_4: [u16; 0x8],
unk170: u16,
group_password_5: [u16; 0x8],
unk182: [u8; 0x36],
pub password: PasswordData,
pub group_passwords: [PasswordData; 5],
unk184: [u8; 0x34],
pub sp_effects: [PlayerGameDataSpEffect; 0xD],
/// Level after any buffs and corrections
pub effective_vigor: u32,
Expand Down Expand Up @@ -244,6 +235,32 @@ pub enum PlayerDataInvasionItemType {
RecusantFinger = 2,
}

#[repr(C)]
pub struct PasswordData {
/// Raw wchar_t data with null terminator
pub raw: [u16; 9],
}

impl PasswordData {
/// Checks if the password is empty
pub fn is_empty(&self) -> bool {
self.raw[0] == 0
}
}

impl TryInto<String> for &PasswordData {
type Error = std::string::FromUtf16Error;

fn try_into(self) -> Result<String, Self::Error> {
let len = self
.raw
.iter()
.position(|&c| c == 0)
.unwrap_or(self.raw.len());
String::from_utf16(&self.raw[..len])
}
}

#[repr(C)]
pub struct PlayerDataAttackRating {
pub left_armament_primary: i32,
Expand Down
Loading
Loading