Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions EpicLoot/EpicLoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public class EpicLoot : BaseUnityPlugin
public static ConfigEntry<TextAnchor> AbilityBarLayoutAlignment;
public static ConfigEntry<float> AbilityBarIconSpacing;
public static ConfigEntry<float> SetItemDropChance;
public static ConfigEntry<bool> AlwaysDropUniqueLegendaries;
public static ConfigEntry<float> GlobalDropRateModifier;
public static ConfigEntry<float> ItemsToMaterialsDropRatio;
public static ConfigEntry<bool> AlwaysShowWelcomeMessage;
Expand Down Expand Up @@ -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.");
Expand Down
4 changes: 2 additions & 2 deletions EpicLoot/LegendarySystem/UniqueLegendaryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public static bool IsGenericLegendary(LegendaryInfo legendaryInfo)

public static IList<LegendaryInfo> 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);
}
Expand Down