Added support for new Sheer/Adrenaline related properties

This commit is contained in:
traffic95 2025-05-25 18:27:33 +02:00
parent 0f91278679
commit 2c1d19221a
4 changed files with 222 additions and 21 deletions

View file

@ -70,12 +70,20 @@ table AvatarBattleTemplate {
unk_68: [int];
unk_69: [int];
unk_70: int;
unk_71: int;
weapon_type: int;
element: [int];
hit_type: [int];
unk_element_camp: [string];
unk_75: int;
unk_76: short;
unk_77: int;
unk_78: int;
base_avatar_id: int;
unk_80: int;
rp_max: int;
rp_recover: int;
unk_83: int;
unk_84: [int];
}
table AvatarBattleTemplateTb {

View file

@ -96,12 +96,20 @@ impl<'a> AvatarBattleTemplate<'a> {
pub const VT_UNK_68: flatbuffers::VOffsetT = 140;
pub const VT_UNK_69: flatbuffers::VOffsetT = 142;
pub const VT_UNK_70: flatbuffers::VOffsetT = 144;
pub const VT_UNK_71: flatbuffers::VOffsetT = 146;
pub const VT_WEAPON_TYPE: flatbuffers::VOffsetT = 146;
pub const VT_ELEMENT: flatbuffers::VOffsetT = 148;
pub const VT_HIT_TYPE: flatbuffers::VOffsetT = 150;
pub const VT_UNK_ELEMENT_CAMP: flatbuffers::VOffsetT = 152;
pub const VT_UNK_75: flatbuffers::VOffsetT = 154;
pub const VT_UNK_76: flatbuffers::VOffsetT = 156;
pub const VT_UNK_77: flatbuffers::VOffsetT = 158;
pub const VT_UNK_78: flatbuffers::VOffsetT = 160;
pub const VT_BASE_AVATAR_ID: flatbuffers::VOffsetT = 162;
pub const VT_UNK_80: flatbuffers::VOffsetT = 164;
pub const VT_RP_MAX: flatbuffers::VOffsetT = 166;
pub const VT_RP_RECOVER: flatbuffers::VOffsetT = 168;
pub const VT_UNK_83: flatbuffers::VOffsetT = 170;
pub const VT_UNK_84: flatbuffers::VOffsetT = 172;
#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
@ -113,11 +121,19 @@ impl<'a> AvatarBattleTemplate<'a> {
args: &'args AvatarBattleTemplateArgs<'args>
) -> flatbuffers::WIPOffset<AvatarBattleTemplate<'bldr>> {
let mut builder = AvatarBattleTemplateBuilder::new(_fbb);
if let Some(x) = args.unk_84 { builder.add_unk_84(x); }
builder.add_unk_83(args.unk_83);
builder.add_rp_recover(args.rp_recover);
builder.add_rp_max(args.rp_max);
builder.add_unk_80(args.unk_80);
builder.add_base_avatar_id(args.base_avatar_id);
builder.add_unk_78(args.unk_78);
builder.add_unk_77(args.unk_77);
builder.add_unk_75(args.unk_75);
if let Some(x) = args.unk_element_camp { builder.add_unk_element_camp(x); }
if let Some(x) = args.hit_type { builder.add_hit_type(x); }
if let Some(x) = args.element { builder.add_element(x); }
builder.add_unk_71(args.unk_71);
builder.add_weapon_type(args.weapon_type);
builder.add_unk_70(args.unk_70);
if let Some(x) = args.unk_69 { builder.add_unk_69(x); }
if let Some(x) = args.unk_68 { builder.add_unk_68(x); }
@ -692,11 +708,11 @@ impl<'a> AvatarBattleTemplate<'a> {
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_UNK_70, Some(0)).unwrap()}
}
#[inline]
pub fn unk_71(&self) -> i32 {
pub fn weapon_type(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_UNK_71, Some(0)).unwrap()}
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_WEAPON_TYPE, Some(0)).unwrap()}
}
#[inline]
pub fn element(&self) -> Option<flatbuffers::Vector<'a, i32>> {
@ -733,6 +749,62 @@ impl<'a> AvatarBattleTemplate<'a> {
// which contains a valid value in this slot
unsafe { self._tab.get::<i16>(AvatarBattleTemplate::VT_UNK_76, Some(0)).unwrap()}
}
#[inline]
pub fn unk_77(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_UNK_77, Some(0)).unwrap()}
}
#[inline]
pub fn unk_78(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_UNK_78, Some(0)).unwrap()}
}
#[inline]
pub fn base_avatar_id(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_BASE_AVATAR_ID, Some(0)).unwrap()}
}
#[inline]
pub fn unk_80(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_UNK_80, Some(0)).unwrap()}
}
#[inline]
pub fn rp_max(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_RP_MAX, Some(0)).unwrap()}
}
#[inline]
pub fn rp_recover(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_RP_RECOVER, Some(0)).unwrap()}
}
#[inline]
pub fn unk_83(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(AvatarBattleTemplate::VT_UNK_83, Some(0)).unwrap()}
}
#[inline]
pub fn unk_84(&self) -> Option<flatbuffers::Vector<'a, i32>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(AvatarBattleTemplate::VT_UNK_84, None)}
}
}
impl flatbuffers::Verifiable for AvatarBattleTemplate<'_> {
@ -813,12 +885,20 @@ impl flatbuffers::Verifiable for AvatarBattleTemplate<'_> {
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_68", Self::VT_UNK_68, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_69", Self::VT_UNK_69, false)?
.visit_field::<i32>("unk_70", Self::VT_UNK_70, false)?
.visit_field::<i32>("unk_71", Self::VT_UNK_71, false)?
.visit_field::<i32>("weapon_type", Self::VT_WEAPON_TYPE, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("element", Self::VT_ELEMENT, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("hit_type", Self::VT_HIT_TYPE, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("unk_element_camp", Self::VT_UNK_ELEMENT_CAMP, false)?
.visit_field::<i32>("unk_75", Self::VT_UNK_75, false)?
.visit_field::<i16>("unk_76", Self::VT_UNK_76, false)?
.visit_field::<i32>("unk_77", Self::VT_UNK_77, false)?
.visit_field::<i32>("unk_78", Self::VT_UNK_78, false)?
.visit_field::<i32>("base_avatar_id", Self::VT_BASE_AVATAR_ID, false)?
.visit_field::<i32>("unk_80", Self::VT_UNK_80, false)?
.visit_field::<i32>("rp_max", Self::VT_RP_MAX, false)?
.visit_field::<i32>("rp_recover", Self::VT_RP_RECOVER, false)?
.visit_field::<i32>("unk_83", Self::VT_UNK_83, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_84", Self::VT_UNK_84, false)?
.finish();
Ok(())
}
@ -895,12 +975,20 @@ pub struct AvatarBattleTemplateArgs<'a> {
pub unk_68: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub unk_69: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub unk_70: i32,
pub unk_71: i32,
pub weapon_type: i32,
pub element: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub hit_type: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub unk_element_camp: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
pub unk_75: i32,
pub unk_76: i16,
pub unk_77: i32,
pub unk_78: i32,
pub base_avatar_id: i32,
pub unk_80: i32,
pub rp_max: i32,
pub rp_recover: i32,
pub unk_83: i32,
pub unk_84: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
}
impl<'a> Default for AvatarBattleTemplateArgs<'a> {
#[inline]
@ -977,12 +1065,20 @@ impl<'a> Default for AvatarBattleTemplateArgs<'a> {
unk_68: None,
unk_69: None,
unk_70: 0,
unk_71: 0,
weapon_type: 0,
element: None,
hit_type: None,
unk_element_camp: None,
unk_75: 0,
unk_76: 0,
unk_77: 0,
unk_78: 0,
base_avatar_id: 0,
unk_80: 0,
rp_max: 0,
rp_recover: 0,
unk_83: 0,
unk_84: None,
}
}
}
@ -1277,8 +1373,8 @@ impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> AvatarBattleTemplateBuilder<'a,
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_UNK_70, unk_70, 0);
}
#[inline]
pub fn add_unk_71(&mut self, unk_71: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_UNK_71, unk_71, 0);
pub fn add_weapon_type(&mut self, weapon_type: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_WEAPON_TYPE, weapon_type, 0);
}
#[inline]
pub fn add_element(&mut self, element: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
@ -1301,6 +1397,38 @@ impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> AvatarBattleTemplateBuilder<'a,
self.fbb_.push_slot::<i16>(AvatarBattleTemplate::VT_UNK_76, unk_76, 0);
}
#[inline]
pub fn add_unk_77(&mut self, unk_77: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_UNK_77, unk_77, 0);
}
#[inline]
pub fn add_unk_78(&mut self, unk_78: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_UNK_78, unk_78, 0);
}
#[inline]
pub fn add_base_avatar_id(&mut self, base_avatar_id: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_BASE_AVATAR_ID, base_avatar_id, 0);
}
#[inline]
pub fn add_unk_80(&mut self, unk_80: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_UNK_80, unk_80, 0);
}
#[inline]
pub fn add_rp_max(&mut self, rp_max: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_RP_MAX, rp_max, 0);
}
#[inline]
pub fn add_rp_recover(&mut self, rp_recover: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_RP_RECOVER, rp_recover, 0);
}
#[inline]
pub fn add_unk_83(&mut self, unk_83: i32) {
self.fbb_.push_slot::<i32>(AvatarBattleTemplate::VT_UNK_83, unk_83, 0);
}
#[inline]
pub fn add_unk_84(&mut self, unk_84: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBattleTemplate::VT_UNK_84, unk_84);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> AvatarBattleTemplateBuilder<'a, 'b, A> {
let start = _fbb.start_table();
AvatarBattleTemplateBuilder {
@ -1389,12 +1517,20 @@ impl core::fmt::Debug for AvatarBattleTemplate<'_> {
ds.field("unk_68", &self.unk_68());
ds.field("unk_69", &self.unk_69());
ds.field("unk_70", &self.unk_70());
ds.field("unk_71", &self.unk_71());
ds.field("weapon_type", &self.weapon_type());
ds.field("element", &self.element());
ds.field("hit_type", &self.hit_type());
ds.field("unk_element_camp", &self.unk_element_camp());
ds.field("unk_75", &self.unk_75());
ds.field("unk_76", &self.unk_76());
ds.field("unk_77", &self.unk_77());
ds.field("unk_78", &self.unk_78());
ds.field("base_avatar_id", &self.base_avatar_id());
ds.field("unk_80", &self.unk_80());
ds.field("rp_max", &self.rp_max());
ds.field("rp_recover", &self.rp_recover());
ds.field("unk_83", &self.unk_83());
ds.field("unk_84", &self.unk_84());
ds.finish()
}
}

View file

@ -59,21 +59,30 @@ impl AvatarUnit {
};
}
self.add_property(
EPropertyType::SkipDefAtk,
self.get_property(EPropertyType::Atk) * 30 / 100
);
assign!(
HpMax,
Atk,
Def,
BreakStun,
SkipDefAtk,
Def,
Crit,
CritDmg,
SpRecover,
ElementMystery,
ElementAbnormalPower,
AddedDamageRatio,
AddedDamageRatioPhysics,
AddedDamageRatioFire,
AddedDamageRatioIce,
AddedDamageRatioElec,
AddedDamageRatioEther
AddedDamageRatioEther,
RpRecover,
SkipDefDamageRatio
);
self.add_property(EPropertyType::Hp, self.get_property(EPropertyType::HpMax));
@ -102,14 +111,24 @@ impl AvatarUnit {
type PropertyBonusConfig = (EPropertyType, EPropertyType, [i32; 7]);
static CORE_SKILL_SPECIALS: LazyLock<HashMap<u32, PropertyBonusConfig>> =
LazyLock::new(|| {
HashMap::from([(
1121,
HashMap::from([
(
EPropertyType::Atk,
EPropertyType::Def,
[40, 46, 52, 60, 66, 72, 80],
1121,
(
EPropertyType::Atk,
EPropertyType::Def,
[40, 46, 52, 60, 66, 72, 80],
),
),
)])
(
1371,
(
EPropertyType::SkipDefAtk,
EPropertyType::HpMax,
[10, 10, 10, 10, 10, 10, 10],
)
)
])
});
if let Some((bonus_property, scale_property, percentage_per_level)) =
@ -129,15 +148,17 @@ impl AvatarUnit {
use EPropertyType::*;
self.set_dynamic_property(HpMax, HpMaxBase, HpMaxRatio, HpMaxDelta);
self.set_dynamic_property(SpMax, SpMaxBase, None, SpMaxDelta);
self.set_dynamic_property(Atk, AtkBase, AtkRatio, AtkDelta);
self.set_dynamic_property(Def, DefBase, DefRatio, DefDelta);
self.set_dynamic_property(BreakStun, BreakStunBase, BreakStunRatio, BreakStunDelta);
self.set_dynamic_property(SkipDefAtk, SkipDefAtkBase, None, SkipDefAtkDelta);
self.set_dynamic_property(Def, DefBase, DefRatio, DefDelta);
self.set_dynamic_property(Crit, CritBase, None, CritDelta);
self.set_dynamic_property(CritDmg, CritDmgBase, None, CritDmgDelta);
self.set_dynamic_property(Pen, PenBase, None, PenDelta);
self.set_dynamic_property(PenValue, PenValueBase, None, PenValueDelta);
self.set_dynamic_property(SpRecover, SpRecoverBase, SpRecoverRatio, SpRecoverDelta);
self.set_dynamic_property(RpRecover, RpRecoverBase, RpRecoverRatio, RpRecoverDelta);
self.set_dynamic_property(
ElementMystery,
ElementMysteryBase,
@ -150,6 +171,12 @@ impl AvatarUnit {
ElementAbnormalPowerRatio,
ElementAbnormalPowerDelta,
);
self.set_dynamic_property(
AddedDamageRatio,
AddedDamageRatio1,
None,
AddedDamageRatio3,
);
self.set_dynamic_property(
AddedDamageRatioPhysics,
AddedDamageRatioPhysics1,
@ -180,6 +207,12 @@ impl AvatarUnit {
None,
AddedDamageRatioEther3,
);
self.set_dynamic_property(
SkipDefDamageRatio,
SkipDefDamageRatio1,
None,
SkipDefDamageRatio3,
);
}
fn set_dynamic_property(
@ -423,9 +456,12 @@ impl AvatarUnit {
CritDmgBase: crit_damage,
PenBase: pen_rate,
PenValueBase: pen_delta,
SpMaxBase: sp_bar_point,
SpRecoverBase: sp_recover,
ElementMysteryBase: element_mystery,
ElementAbnormalPowerBase: element_abnormal_power
ElementAbnormalPowerBase: element_abnormal_power,
RpMax: rp_max,
RpRecoverBase: rp_recover
);
}

View file

@ -6,14 +6,18 @@ pub enum EPropertyType {
None = 0,
Hp = 1,
HpMax = 111,
SpMax = 115,
RpMax = 119,
Atk = 121,
BreakStun = 122,
SkipDefAtk = 123,
Def = 131,
Crit = 201,
CritDmg = 211,
Pen = 231,
PenValue = 232,
SpRecover = 305,
AddedDamageRatio = 307,
ElementMystery = 312,
ElementAbnormalPower = 314,
AddedDamageRatioPhysics = 315,
@ -21,16 +25,20 @@ pub enum EPropertyType {
AddedDamageRatioIce = 317,
AddedDamageRatioElec = 318,
AddedDamageRatioEther = 319,
RpRecover = 320,
SkipDefDamageRatio = 322,
// battle
HpMaxBattle = 1111,
AtkBattle = 1121,
BreakStunBattle = 1122,
SkipDefAtkBattle = 1123,
DefBattle = 1131,
CritBattle = 1201,
CritDmgBattle = 1211,
PenRatioBattle = 1231,
PenDeltaBattle = 1232,
SpRecoverBattle = 1305,
AddedDamageRatioBattle = 1307,
ElementMysteryBattle = 1312,
ElementAbnormalPowerBattle = 1314,
AddedDamageRatioPhysicsBattle = 1315,
@ -38,10 +46,14 @@ pub enum EPropertyType {
AddedDamageRatioIceBattle = 1317,
AddedDamageRatioElecBattle = 1318,
AddedDamageRatioEtherBattle = 1319,
RpRecoverBattle = 1320,
SkipDefDamageRatioBattle = 1322,
// base
HpMaxBase = 11101,
SpMaxBase = 11501,
AtkBase = 12101,
BreakStunBase = 12201,
SkipDefAtkBase = 12301, // ?? client has 12205 for some reason
DefBase = 13101,
CritBase = 20101,
CritDmgBase = 21101,
@ -50,6 +62,7 @@ pub enum EPropertyType {
SpRecoverBase = 30501,
ElementMysteryBase = 31201,
ElementAbnormalPowerBase = 31401,
RpRecoverBase = 32001,
// ratio
HpMaxRatio = 11102,
AtkRatio = 12102,
@ -57,10 +70,13 @@ pub enum EPropertyType {
DefRatio = 13102,
SpRecoverRatio = 30502,
ElementAbnormalPowerRatio = 31402,
RpRecoverRatio = 32002,
// delta
HpMaxDelta = 11103,
SpMaxDelta = 11503,
AtkDelta = 12103,
BreakStunDelta = 12203,
SkipDefAtkDelta = 12303, // ?? client has 12205 for some reason
DefDelta = 13103,
CritDelta = 20103,
CritDmgDelta = 21103,
@ -69,7 +85,10 @@ pub enum EPropertyType {
SpRecoverDelta = 30503,
ElementMysteryDelta = 31203,
ElementAbnormalPowerDelta = 31403,
RpRecoverDelta = 32003,
// damage ratios 1/3
AddedDamageRatio1 = 30701,
AddedDamageRatio3 = 30703,
AddedDamageRatioPhysics1 = 31501,
AddedDamageRatioPhysics3 = 31503,
AddedDamageRatioFire1 = 31601,
@ -80,6 +99,8 @@ pub enum EPropertyType {
AddedDamageRatioElec3 = 31803,
AddedDamageRatioEther1 = 31901,
AddedDamageRatioEther3 = 31903,
SkipDefDamageRatio1 = 32201,
SkipDefDamageRatio3 = 32203,
// --- custom
// growth
HpMaxGrowth = 99991110,