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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ works with. The maintainers publish the releases of the mods in this repository.
| [petloot](mods/petloot/) | optional pet pickup with per-character filters, minimum stacks, pause/resume and configurable 2x pet speed |
| [zoom](mods/zoom/) | a wider view in normal play: the camera stands further back, the mouse wheel reaches it, `/zoom` sets how far |
| [itemquantity](mods/itemquantity/) | 10× as many item drops |
| [currencyloot](mods/currencyloot/) | Configurable bonus currency per eligible kill |
| [pob](mods/pob/) | preview and import character builds through an external converter; requires LocalExile #639 |
| [itemrarity](mods/itemrarity/) | 10× the chance of magic, rare and unique equipment |

Expand Down
1 change: 1 addition & 0 deletions mods.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"version": 1,
"mods": [
{ "id": "backpack", "name": "Extra Backpack", "description": "An optional native 20-slot extra backpack for every character class.", "author": "zj1022", "version": "1.0.3", "compatibleClientVersions": ["0.5.1-beta", "0.5.2-beta"], "kind": "feature", "type": "script", "path": "mods/backpack", "depends": [], "settings": false },
{ "id": "currencyloot", "name": "Currency Loot", "description": "Adds configurable bonus rolls for specific currencies on monster kills.", "author": "zj1022", "version": "1.0.0", "compatibleClientVersions": ["0.5.2-beta"], "kind": "feature", "type": "script", "path": "mods/currencyloot", "depends": [], "settings": true },
{ "id": "fastcampaign", "name": "Fast Campaign", "description": "A faster campaign: 5x kill experience, +50% movement speed, and /fast lists the commands that skip ahead.", "author": "LocalExile", "version": "1.1.4", "compatibleClientVersions": ["0.4.3-beta", "0.5.0-beta", "0.5.1-beta", "0.5.2-beta"], "kind": "feature", "type": "project", "path": "mods/fastcampaign", "depends": [], "settings": true },
{ "id": "globalchat", "name": "Global Chat", "description": "Talk to other LocalExile players: global, trade and whisper chat go through the LocalExile global chat server.", "author": "JetStream", "version": "1.1.4", "compatibleClientVersions": ["0.4.3-beta", "0.5.0-beta", "0.5.1-beta", "0.5.2-beta"], "kind": "feature", "type": "project", "path": "mods/globalchat", "depends": [], "settings": true },
{ "id": "gm-commands", "name": "GM Commands", "description": "The development and testing chat commands: teleport, items, monsters, experience, quest flags, test hits and protocol probes.", "author": "LocalExile", "version": "1.5.0", "compatibleClientVersions": ["0.5.2-beta"], "kind": "feature", "type": "project", "path": "mods/gm-commands", "depends": ["Game"], "settings": false },
Expand Down
37 changes: 37 additions & 0 deletions mods/currencyloot/CurrencyLootMod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.Text.Json.Nodes;
using GameServer.Modding;

namespace LocalExile.Mods.CurrencyLoot;

public sealed class CurrencyLootMod : IMod
{
public void Load(IModContext mod)
{
var settings = mod.Settings<JsonObject>();
var rates = new Dictionary<string, (double Rate, int Level)>(StringComparer.OrdinalIgnoreCase);
if (settings["items"] is JsonObject items)
foreach (var (name, value) in items)
{
if (value is not JsonValue amount || !amount.TryGetValue<double>(out double rate)
|| !double.IsFinite(rate) || rate <= 0) continue;
if (Program.Items.Find(name) is not { Supported: true, Stackable: true, Class: "StackableCurrency", Quest: null } type
|| type.Id == ItemDrops.GoldId)
{
mod.Log($"Currency Loot: skipping unknown or unsupported currency '{name}'.");
continue;
}
rates[type.Id] = (Math.Min(rate, 20), type.DropLevel);
if (rates.Count == 40) break;
}
GameEvents.Drops.Add(mod.Manifest.Id, drops =>
{
foreach (var (id, (rate, level)) in rates)
{
if (drops.Monster.Level < level) continue;
int count = (int)rate;
if (rate > count && Random.Shared.NextDouble() < rate - count) count++;
for (int i = 0; i < count; i++) drops.Items.Add(id);
}
});
}
}
12 changes: 12 additions & 0 deletions mods/currencyloot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Currency Loot

Add configurable bonus currency to eligible monster kills alongside the normal loot. Each entry uses the currency's
existing base drop level. The mod accepts supported stackable currency and skips gold and quest items.

Enable with Waypoint or `/mod_enable currencyloot`. It starts disabled and adds no chat commands. Use the
**Bonus currency per kill** setting in Waypoint, or edit `data/mods/currencyloot.json` in the server folder.
Use an exact currency name or metadata ID as the key. A value of `1.25` gives one extra item and a 25% chance
of a second. The default gives an extra Chaos Orb on 5% of eligible kills.

Inspired by the configurable currency drops in [mingyue8621/LocalExile-Mods](https://github.com/mingyue8621/LocalExile-Mods).
Compatible with LocalExile 0.5.2-beta.
11 changes: 11 additions & 0 deletions mods/currencyloot/mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "currencyloot",
"name": "Currency Loot",
"description": "Adds configurable bonus rolls for specific currencies on monster kills.",
"author": "zj1022",
"version": "1.0.0",
"compatibleClientVersions": ["0.5.2-beta"],
"kind": "feature",
"depends": [],
"enabled": false
}
13 changes: 13 additions & 0 deletions mods/currencyloot/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"settings": {
"items": {
"type": "map",
"label": "Bonus currency per kill",
"description": "Use the exact currency name or metadata ID. For example, 0.05 gives one additional item on 5% of eligible kills.",
"default": { "Chaos Orb": 0.05 },
"maxItems": 40,
"value": { "type": "number", "min": 0, "max": 20 }
}
}
}
Loading