diff --git a/src/GameLogic/CharacterExtensions.cs b/src/GameLogic/CharacterExtensions.cs index d4fe91500..8eb5706ea 100644 --- a/src/GameLogic/CharacterExtensions.cs +++ b/src/GameLogic/CharacterExtensions.cs @@ -52,9 +52,17 @@ public static bool HasFullAncientSetEquipped(this Character character) i.ItemSlot <= InventoryConstants.LastEquippableItemSlotIndex && i.ItemSlot >= InventoryConstants.FirstEquippableItemSlotIndex && i.ItemSetGroups.Any(group => group.AncientSetDiscriminator > 0)) - .Select(i => new { Item = i.Definition, Set = i.ItemSetGroups.First(s => s.AncientSetDiscriminator > 0) }); - var ancientSets = equippedAncientSetItems.Select(i => i.Set).Distinct(); - return ancientSets.Any(set => set.ItemSetGroup?.Items.All(setItem => equippedAncientSetItems.Any(i => i.Item == setItem.ItemDefinition && i.Set == set)) ?? false); + .Select(i => + new + { + Item = i.Definition, + Set = i.ItemSetGroups.First(s => s.AncientSetDiscriminator > 0), + }); + var ancientSets = equippedAncientSetItems.Select(i => i.Set.ItemSetGroup).WhereNotNull().Distinct(); + return ancientSets.Any(set => + set.Items.All(setItem => equippedAncientSetItems.Any(i => + object.Equals(i.Item, setItem.ItemDefinition) + && object.Equals(i.Set.ItemSetGroup, set)))); } /// diff --git a/src/GameLogic/ItemExtensions.cs b/src/GameLogic/ItemExtensions.cs index 6a6f63441..5a92fc5c2 100644 --- a/src/GameLogic/ItemExtensions.cs +++ b/src/GameLogic/ItemExtensions.cs @@ -87,7 +87,7 @@ public static byte GetMaximumDurabilityOfOnePiece(this Item item) /// public static bool IsAncient(this Item item) { - return item.ItemOptions.Any(link => link.ItemOption?.OptionType == ItemOptionTypes.AncientBonus); + return item.ItemSetGroups.Any(itemSet => itemSet.AncientSetDiscriminator > 0); } /// @@ -305,6 +305,13 @@ public static ItemAppearance GetAppearance(this Item item) .Select(option => option.ItemOption!.OptionType!) .Distinct() .ForEach(appearance.VisibleOptions.Add); + if (item.IsAncient()) + { + // 1. The ancient option is not included in the item.ItemOptions. + // 2. The bonus option is not always existing for ancient items. And it's not marked as visible. + // -> we check it based on the item set group. + appearance.VisibleOptions.Add(ItemOptionTypes.AncientOption); + } return appearance; }