1
0
forked from liza/ARDiscard

Allow gear coffers to be discarded

This commit is contained in:
Liza 2024-02-04 09:38:58 +01:00
parent 0d7f9f4aa4
commit a94c5077fc
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 17 additions and 2 deletions

View File

@ -261,4 +261,6 @@ internal static class InternalConfiguration
#endregion #endregion
}.AsReadOnly(); }.AsReadOnly();
public static readonly IList<uint> DiscardableGearCoffers = new List<uint>();
} }

View File

@ -60,6 +60,17 @@ internal sealed class ItemCache
cachedItemInfo.CanBeBoughtFromCalamitySalvager = true; cachedItemInfo.CanBeBoughtFromCalamitySalvager = true;
} }
// only look at msq + regional side quests
foreach (var quest in dataManager.GetExcelSheet<Quest>()!.Where(x => x.JournalGenre.Value?.JournalCategory.Value?.JournalSection.Row is 0 or 1 or 3))
{
foreach (var itemId in quest.ItemReward.Where(x => x > 0))
{
var item = dataManager.GetExcelSheet<Item>()!.GetRow(itemId);
if (item is { Rarity: 1, ItemAction.Row: 388 } && item.RowId != 38809 && item.RowId != 29679)
InternalConfiguration.DiscardableGearCoffers.Add(item.RowId);
}
}
} }
private bool CanDiscardItemsFromQuest(LazyRow<Quest> quest) private bool CanDiscardItemsFromQuest(LazyRow<Quest> quest)
@ -120,13 +131,15 @@ internal sealed class ItemCache
public bool CanBeDiscarded() public bool CanBeDiscarded()
{ {
if (InternalConfiguration.BlacklistedItems.Contains(ItemId) || InternalConfiguration.UltimateWeapons.Contains(ItemId)) if (InternalConfiguration.BlacklistedItems.Contains(ItemId) ||
InternalConfiguration.UltimateWeapons.Contains(ItemId))
return false; return false;
if (UiCategory is UiCategories.Currency or UiCategories.Crystals or UiCategories.Unobtainable) if (UiCategory is UiCategories.Currency or UiCategories.Crystals or UiCategories.Unobtainable)
return false; return false;
if (InternalConfiguration.WhitelistedItems.Contains(ItemId)) if (InternalConfiguration.WhitelistedItems.Contains(ItemId) ||
InternalConfiguration.DiscardableGearCoffers.Contains(ItemId))
return true; return true;
return CanBeBoughtFromCalamitySalvager || return CanBeBoughtFromCalamitySalvager ||