@@ -705,8 +705,17 @@ function ImportTabClass:ImportItemsAndSkills(charData)
705705 local spectreList = data .spectres
706706 if typeLine :sub (1 , 8 ) == " Spectre:" then
707707 local spectreName = typeLine :sub (10 ) -- gets monster name after "Spectre: "
708+ for _ , property in pairs (skillData .properties ) do
709+ if property .name == " Reservation" and property .values and property .values [1 ] and property .values [1 ][1 ] then
710+ -- Example: "42 [Spirit]"
711+ local reservationValue = property .values [1 ][1 ]:match (" (%d+)" )
712+ if reservationValue then
713+ gemInstance .reservation = tonumber (reservationValue )
714+ end
715+ end
716+ end
708717 for id , spectre in pairs (spectreList ) do
709- if spectre .name == spectreName then
718+ if spectre .name == spectreName and gemInstance . reservation == spectre . spectreReservation then
710719 if not isValueInArray (self .build .spectreList , id ) then
711720 t_insert (self .build .spectreList , id )
712721 end
@@ -718,8 +727,17 @@ function ImportTabClass:ImportItemsAndSkills(charData)
718727 end
719728 if typeLine :sub (1 , 10 ) == " Companion:" then
720729 local companionName = typeLine :sub (12 )
730+ for _ , property in pairs (skillData .properties ) do
731+ if property .name == " Reservation" and property .values and property .values [1 ] and property .values [1 ][1 ] then
732+ -- Example: "42.3% [Spirit]"
733+ local companionReservation = property .values [1 ][1 ]:match (" ([%d%.]+)%%?" )
734+ if companionReservation then
735+ gemInstance .companionReservation = tonumber (companionReservation )
736+ end
737+ end
738+ end
721739 for id , spectre in pairs (spectreList ) do
722- if spectre .name == companionName then
740+ if spectre .name == companionName and gemInstance . companionReservation == spectre . companionReservation then
723741 if not isValueInArray (self .build .beastList , id ) then
724742 t_insert (self .build .beastList , id )
725743 end
0 commit comments