diff --git a/EpicLoot/EpicLoot.cs b/EpicLoot/EpicLoot.cs index 884bdd427..3e8ab552f 100644 --- a/EpicLoot/EpicLoot.cs +++ b/EpicLoot/EpicLoot.cs @@ -130,6 +130,7 @@ public class EpicLoot : BaseUnityPlugin public static ConfigEntry AbilityBarLayoutAlignment; public static ConfigEntry AbilityBarIconSpacing; public static ConfigEntry SetItemDropChance; + public static ConfigEntry AlwaysDropUniqueLegendaries; public static ConfigEntry GlobalDropRateModifier; public static ConfigEntry ItemsToMaterialsDropRatio; public static ConfigEntry AlwaysShowWelcomeMessage; @@ -232,6 +233,7 @@ private void Awake() _andvaranautRange = SyncedConfig("Balance", "Andvaranaut Range", 20, "Sets the range that Andvaranaut will locate a treasure chest."); _serverConfigLocked = SyncedConfig("Config Sync", "Lock Config", false, new ConfigDescription("[Server Only] The configuration is locked and may not be changed by clients once it has been synced from the server. Only valid for server config, will have no effect on clients.")); SetItemDropChance = SyncedConfig("Balance", "Set Item Drop Chance", 0.15f, "The percent chance that a legendary item will be a set item. Min = 0, Max = 1"); + AlwaysDropUniqueLegendaries = SyncedConfig("Balance", "Always Drop Unique Legendaries", false, "If set to true, general legendaries will drop only when no appropriate unique item found, Set Item Drop Chance is ignored in the case (use SelectionWeight in legendaries.json instead)"); GlobalDropRateModifier = SyncedConfig("Balance", "Global Drop Rate Modifier", 1.0f, "A global percentage that modifies how likely items are to drop. 1 = Exactly what is in the loot tables will drop. 0 = Nothing will drop. 2 = The number of items in the drop table are twice as likely to drop (note, this doesn't double the number of items dropped, just doubles the relative chance for them to drop). Min = 0, Max = 4"); ItemsToMaterialsDropRatio = SyncedConfig("Balance", "Items To Materials Drop Ratio", 0.0f, "Sets the chance that item drops are instead dropped as magic crafting materials. 0 = all items, no materials. 1 = all materials, no items. Values between 0 and 1 change the ratio of items to materials that drop. At 0.5, half of everything that drops would be items and the other half would be materials. Min = 0, Max = 1"); TransferMagicItemToCrafts = SyncedConfig("Balance", "Transfer Enchants to Crafted Items", false, "When enchanted items are used as ingredients in recipes, transfer the highest enchant to the newly crafted item. Default: False."); diff --git a/EpicLoot/LegendarySystem/UniqueLegendaryHelper.cs b/EpicLoot/LegendarySystem/UniqueLegendaryHelper.cs index 134a65441..72326fb58 100644 --- a/EpicLoot/LegendarySystem/UniqueLegendaryHelper.cs +++ b/EpicLoot/LegendarySystem/UniqueLegendaryHelper.cs @@ -60,8 +60,8 @@ public static bool IsGenericLegendary(LegendaryInfo legendaryInfo) public static IList GetAvailableLegendaries(ItemDrop.ItemData baseItem, MagicItem magicItem, bool rollSetItem) { - var availableLegendaries = LegendaryInfo.Values.Where(x => x.IsSetItem == rollSetItem && x.Requirements.CheckRequirements(baseItem, magicItem)).AddItem(GenericLegendaryInfo).ToList(); - if (rollSetItem && availableLegendaries.Count > 1) + var availableLegendaries = LegendaryInfo.Values.Where(x => (x.IsSetItem == rollSetItem || EpicLoot.AlwaysDropUniqueLegendaries.Value) && x.Requirements.CheckRequirements(baseItem, magicItem)).AddItem(GenericLegendaryInfo).ToList(); + if ((rollSetItem || EpicLoot.AlwaysDropUniqueLegendaries.Value) && availableLegendaries.Count > 1) { availableLegendaries.Remove(UniqueLegendaryHelper.GenericLegendaryInfo); }