@@ -92,7 +92,7 @@ impl OptimizerExporter {
92
92
. filter_map ( |b| export_proto_hero ( & self . database , & b) )
93
93
. collect ( ) ;
94
94
95
- self . current_trailblazer_path = trailblazer_id_to_path ( hero. cur_basic_type . value ( ) as u32 ) ;
95
+ self . current_trailblazer_path = avatar_path_lookup ( & self . database , hero. cur_basic_type . value ( ) as u32 ) ;
96
96
if let Some ( path) = self . current_trailblazer_path {
97
97
info ! ( path, "found current trailblazer path" ) ;
98
98
} else {
@@ -176,7 +176,7 @@ impl Exporter for OptimizerExporter {
176
176
let cmd = command. parse_proto :: < GetHeroBasicTypeInfoScRsp > ( ) ;
177
177
match cmd {
178
178
Ok ( cmd) => {
179
- self . add_trailblazer_data ( cmd)
179
+ self . add_trailblazer_data ( cmd) ;
180
180
}
181
181
Err ( error) => {
182
182
warn ! ( %error, "could not parse trailblazer data command" ) ;
@@ -313,7 +313,8 @@ impl Database {
313
313
314
314
// trailblazer
315
315
if avatar_id >= 8000 {
316
- Some ( "Trailblazer" . to_string ( ) )
316
+ let path = avatar_path_lookup ( self , avatar_id) ?;
317
+ Some ( format ! ( "Trailblazer{}" , path) )
317
318
} else {
318
319
let cfg = self . avatar_config . get ( & avatar_id) ?;
319
320
cfg. AvatarName . lookup ( & self . text_map ) . map ( |s| s. to_string ( ) )
@@ -339,7 +340,7 @@ fn export_proto_relic(db: &Database, proto: &ProtoRelic) -> Option<Relic> {
339
340
let slot = slot_type_to_export ( & relic_config. Type ) ;
340
341
let rarity = relic_config. MaxLevel / 3 ;
341
342
let mainstat = main_stat_to_export ( & main_affix_config. Property ) . to_string ( ) ;
342
- let location = db. lookup_avatar_name ( proto. base_avatar_id ) . unwrap_or ( "" . to_string ( ) ) ;
343
+ let location = db. lookup_avatar_name ( proto. equip_avatar_id ) . unwrap_or ( "" . to_string ( ) ) ;
343
344
344
345
debug ! ( rarity, set, slot, slot, mainstat, location, "detected" ) ;
345
346
@@ -478,7 +479,7 @@ fn export_proto_light_cone(db: &Database, proto: &ProtoLightCone) -> Option<Ligh
478
479
479
480
debug ! ( light_cone=key, level, superimposition, "detected" ) ;
480
481
481
- let location = db. lookup_avatar_name ( proto. base_avatar_id )
482
+ let location = db. lookup_avatar_name ( proto. equip_avatar_id )
482
483
. unwrap_or ( "" . to_string ( ) ) ;
483
484
484
485
Some ( LightCone {
@@ -514,7 +515,7 @@ fn export_proto_character(db: &Database, proto: &ProtoCharacter) -> Option<Chara
514
515
}
515
516
516
517
fn export_proto_hero ( db : & Database , proto : & HeroBasicTypeInfo ) -> Option < Character > {
517
- let path = trailblazer_id_to_path ( proto. basic_type . value ( ) as u32 ) ?;
518
+ let path = avatar_path_lookup ( db , proto. basic_type . value ( ) as u32 ) ?;
518
519
let key = format ! ( "Trailblazer{}" , path) ;
519
520
520
521
let span = info_span ! ( "character" , key) ;
@@ -535,17 +536,19 @@ fn export_proto_hero(db: &Database, proto: &HeroBasicTypeInfo) -> Option<Charact
535
536
} )
536
537
}
537
538
538
- fn trailblazer_id_to_path ( id : u32 ) -> Option < & ' static str > {
539
- match id {
540
- 8001 | 8002 => Some ( "Destruction" ) ,
541
- 8003 | 8004 => Some ( "Preservation" ) ,
542
- 8005 | 8006 => Some ( "Hunt" ) ,
543
- 8007 | 8008 => Some ( "Erudition" ) ,
544
- 8009 | 8010 => Some ( "Harmony" ) ,
545
- 8011 | 8012 => Some ( "Nihility" ) ,
546
- 8013 | 8014 => Some ( "Abundance" ) ,
539
+ fn avatar_path_lookup ( db : & Database , avatar_id : u32 ) -> Option < & ' static str > {
540
+ let hero_config = db. avatar_config . get ( & avatar_id) ;
541
+ let avatar_base_type = hero_config. unwrap ( ) . AvatarBaseType . as_str ( ) ;
542
+ match avatar_base_type {
543
+ "Knight" => Some ( "Preservation" ) ,
544
+ "Rogue" => Some ( "Hunt" ) ,
545
+ "Mage" => Some ( "Erudition" ) ,
546
+ "Warlock" => Some ( "Nihility" ) ,
547
+ "Warrior" => Some ( "Destruction" ) ,
548
+ "Shaman" => Some ( "Harmony" ) ,
549
+ "Priest" => Some ( "Abundance" ) ,
547
550
_ => {
548
- debug ! ( ?id , "unknown path" ) ;
551
+ debug ! ( ?avatar_base_type , "unknown path" ) ;
549
552
None
550
553
}
551
554
}
0 commit comments