Skip to content
Open
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
10 changes: 3 additions & 7 deletions EpicLoot/MagicItemEffects/Riches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ public static class Riches_CharacterDrop_GenerateDropList_Patch
{
public static readonly Dictionary<GameObject, int> RichesTable = new Dictionary<GameObject, int>
{
{ ObjectDB.instance.GetItemPrefab("SilverNecklace"), 30 },
{ ObjectDB.instance.GetItemPrefab("Ruby"), 20 },
{ ObjectDB.instance.GetItemPrefab("AmberPearl"), 10 },
{ ObjectDB.instance.GetItemPrefab("Amber"), 5 },
{ ObjectDB.instance.GetItemPrefab("Coins"), 1 },
{ ObjectDB.instance.GetItemPrefab("Coins"), 1 }
};

[UsedImplicitly]
Expand All @@ -24,8 +20,8 @@ private static void Postfix(CharacterDrop __instance, ref List<KeyValuePair<Game
var playerList = new List<Player>();
Player.GetPlayersInRange(__instance.m_character.transform.position, 100f, playerList);

var richesAmount = Random.Range(10, 100);
var richesChance = playerList.Sum(player => player.m_nview.GetZDO().GetInt("el-rch")) * 0.01f;
var richesAmount = Random.Range(2, 10) * Random.Range(2, 10);
var richesChance = playerList.Sum(player => player.m_nview.GetZDO().GetInt("el-rch")) * 0.01f;
if (richesChance > 1)
{
richesAmount = Mathf.RoundToInt(richesAmount * richesChance);
Expand Down