Skip to content
Merged
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ works with. The maintainers publish the releases of the mods in this repository.
| [globalchat](mods/globalchat/) | talk to other LocalExile players through the LocalExile global chat server |
| [waypoint-tools](mods/waypoint-tools/) | lets Waypoint's tools reach the game without the client control bridge: the item crafter gives its items through it |
| [backpack](mods/backpack/) | an optional native 20-slot extra backpack for every class, with safe recovery after disable |
| [petloot](mods/petloot/) | optional pet pickup with per-character item filters, minimum stacks and pause/resume |
| [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 |
| [pob](mods/pob/) | preview and import character builds through an external converter; requires LocalExile #639 |
Expand Down
2 changes: 1 addition & 1 deletion mods.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{ "id": "itemquantity", "name": "Item Quantity", "description": "10 times as many item drops from every kill.", "author": "LocalExile", "version": "1.1.3", "compatibleClientVersions": ["0.4.3-beta", "0.5.0-beta", "0.5.1-beta"], "kind": "feature", "type": "project", "path": "mods/itemquantity", "depends": [], "settings": true },
{ "id": "itemrarity", "name": "Item Rarity", "description": "10 times the chance of magic, rare and unique equipment.", "author": "LocalExile", "version": "1.1.3", "compatibleClientVersions": ["0.4.3-beta", "0.5.0-beta", "0.5.1-beta"], "kind": "feature", "type": "project", "path": "mods/itemrarity", "depends": [], "settings": true },
{ "id": "liveeconomy", "name": "Live Economy", "description": "Faustus's Currency Exchange as a live market: the official Path of Exile leagues' prices, a spread, depth, and orders that fill with time.", "author": "JetStream", "version": "1.1.3", "compatibleClientVersions": ["0.4.3-beta", "0.5.0-beta", "0.5.1-beta"], "kind": "feature", "type": "project", "path": "mods/liveeconomy", "depends": [], "settings": true },
{ "id": "petloot", "name": "Pet Loot", "description": "Worn pets collect selected currency with per-character filters and an immediate pause switch.", "author": "zj1022", "version": "1.0.5", "compatibleClientVersions": ["0.5.1-beta"], "kind": "feature", "type": "script", "path": "mods/petloot", "depends": ["Game", "Cosmetics"], "settings": true },
{ "id": "petloot", "name": "Pet Loot", "description": "Worn pets collect selected currency with per-character filters and an immediate pause switch.", "author": "zj1022", "version": "1.1.0", "compatibleClientVersions": ["0.5.1-beta"], "kind": "feature", "type": "script", "path": "mods/petloot", "depends": ["Game", "Cosmetics"], "settings": true },
{ "id": "pob", "name": "POB", "description": "Preview and import a character build through a configured external PoB converter.", "author": "nikolos89", "version": "1.0.2", "compatibleClientVersions": ["0.4.3-beta", "0.5.0-beta", "0.5.1-beta"], "kind": "feature", "type": "project", "path": "mods/pob", "depends": [], "settings": true },
{ "id": "waypoint-tools", "name": "Waypoint Tools", "description": "Lets Waypoint's tools reach the game without the client control bridge: the item crafter gives its items through it.", "author": "Waypoint", "version": "1.0.3", "compatibleClientVersions": ["0.4.3-beta", "0.5.0-beta", "0.5.1-beta"], "kind": "feature", "type": "project", "path": "mods/waypoint-tools", "depends": ["Game"], "settings": false },
{ "id": "zoom", "name": "Zoom", "description": "A wider view in normal play: the camera stands further back, and /zoom sets how far.", "author": "evrydayjunglist", "version": "1.0.0", "compatibleClientVersions": ["0.5.1-beta"], "kind": "feature", "type": "project", "path": "mods/zoom", "depends": ["Game"], "settings": true }
Expand Down
32 changes: 26 additions & 6 deletions mods/petloot/PetLootMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@

public sealed class PetLootMod : IMod
{
public sealed record Profile(bool Enabled, bool Gold, int Range, bool CommonCurrency, Dictionary<string, int> Rules);
public sealed record Profile(bool Enabled, bool Gold, int Range, bool CommonCurrency, Dictionary<string, int> Rules)
{
public double MovementSpeed { get; init; } = 2;
}
public sealed record Choices(bool Enabled, bool Gold, int Range, bool CommonCurrency,
Dictionary<string, int> Rules, Dictionary<string, Profile> Profiles);
Dictionary<string, int> Rules, Dictionary<string, Profile> Profiles)
{
public double MovementSpeed { get; init; } = 2;
}

static readonly HashSet<string> Common = new(StringComparer.OrdinalIgnoreCase)
{
Expand Down Expand Up @@ -36,7 +42,13 @@ public void Load(IModContext context)
choices = loaded with { Rules = Normalize(loaded.Rules), Profiles = loaded.Profiles.ToDictionary(p => p.Key,
p => p.Value with { Rules = Normalize(p.Value.Rules) }) };
GameEvents.Tick.Add(mod.Manifest.Id, Tick);
GameEvents.Command(mod.Manifest.Id, "petloot", "/petloot [on|off|toggle|list|nearby|gold|common|range|allow|block|remove|reset]", Command);
GameEvents.MovementSpeed.Add(mod.Manifest.Id, (conn, id, speed) =>
{
if (!mod.Lifetime.IsActive) return speed;
lock (conn.Pets)
return conn.Pets.ContainsKey(id) ? speed * ProfileOf(conn).MovementSpeed : speed;
});
GameEvents.Command(mod.Manifest.Id, "petloot", "/petloot [on|off|toggle|list|nearby|gold|common|range|speed|allow|block|remove|reset]", Command);
mod.Log("opt-in pet pickup; /petloot for this character's rules.");
}

Expand All @@ -54,7 +66,8 @@ Profile ProfileOf(ClientState conn)
{
lock (choicesGate)
return choices.Profiles.GetValueOrDefault(Key(conn))
?? new(choices.Enabled, choices.Gold, choices.Range, choices.CommonCurrency, choices.Rules);
?? new(choices.Enabled, choices.Gold, choices.Range, choices.CommonCurrency, choices.Rules)
{ MovementSpeed = choices.MovementSpeed };
}

sealed record Candidate(uint Id, WorldItemObject Item, ItemCatalog.BaseType Type);
Expand Down Expand Up @@ -172,9 +185,9 @@ async Task Command(ClientState conn, string[] args)
if (action is "status" or "list")
{
string rules = string.Join(", ", profile.Rules.OrderBy(r => r.Key).Select(r => $"{r.Key}: {(r.Value == 0 ? "blocked" : "min " + r.Value)}"));
await conn.Commands!.Reply($"Pet Loot: {(profile.Enabled ? "on" : "paused")}; gold {profile.Gold}; common currency {profile.CommonCurrency}; range {profile.Range}.\n"
await conn.Commands!.Reply($"Pet Loot: {(profile.Enabled ? "on" : "paused")}; gold {profile.Gold}; common currency {profile.CommonCurrency}; range {profile.Range}; pet speed {profile.MovementSpeed.ToString(System.Globalization.CultureInfo.InvariantCulture)}x.\n"
+ $"Overrides: {(rules.Length == 0 ? "none" : rules)}\n"
+ "/petloot on|off|toggle; gold|common on|off; range 5-80; allow <item> [minimum]; block|remove <item>; nearby; reset");
+ "/petloot on|off|toggle; gold|common on|off; range 5-80; speed 0.25-10; allow <item> [minimum]; block|remove <item>; nearby; reset");
return;
}
if (action == "nearby")
Expand All @@ -189,6 +202,13 @@ async Task Command(ClientState conn, string[] args)
profile = action == "gold" ? profile with { Gold = args[1] == "on" } : profile with { CommonCurrency = args[1] == "on" };
else if (action == "range" && args.Length == 2 && int.TryParse(args[1], out int range) && range is >= 5 and <= 80)
profile = profile with { Range = range };
else if (action == "speed")
{
if (args.Length != 2 || !double.TryParse(args[1], System.Globalization.NumberStyles.Float,
System.Globalization.CultureInfo.InvariantCulture, out double speed) || !double.IsFinite(speed) || speed is < .25 or > 10)
{ await conn.Commands!.Reply("Use /petloot speed <0.25-10>; 1 is normal, 2 is double speed."); return; }
profile = profile with { MovementSpeed = speed };
}
else if (action is "allow" or "block" or "remove" && args.Length > 1)
{
int minimum = 1, end = args.Length;
Expand Down
12 changes: 11 additions & 1 deletion mods/petloot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ An opt-in mod: a worn cosmetic pet walks to nearby selected currency and picks i
enable it with `/mod_enable petloot` or Waypoint. `/petloot off` pauses pickup for this character, including after an
area change or restart; `/petloot on` resumes it. Removing or disabling the mod leaves normal pets following the player.

Requires LocalExile v0.5.1-beta or later, the first release with PR #737: the game's saved pickup and cosmetic pet walking methods. Pickup runs in leagues with both Game and Cosmetics.
Requires [LocalExile PR #1045](https://github.com/LocalExile/LocalExile/pull/1045), which adds the movement-speed hook.
The manifest lists the current release pending a release containing that hook. Pickup runs in leagues with both Game and Cosmetics.

## Movement speed

Worn pets move at **2x** their normal owner-relative speed by default, while following, collecting and returning.
Set the multiplier in Waypoint or with `/petloot speed 2` (0.25–10); `/petloot speed 1` restores normal speed.
The multiplier belongs to the character's saved profile, and existing profiles without a speed value start at 2x.
`/petloot off` pauses collection while keeping this movement setting. Disabling or removing the mod restores ordinary
pet speed on the next player tick, including a walk already in progress. Other entities and the player's speed are unchanged.

## Filters

Expand All @@ -30,6 +39,7 @@ Gold disabled here means **pet pickup** disabled: the game's ordinary nearby gol
- `/petloot common on|off`: common-currency preset.
- `/petloot gold on|off`: pet gold pickup.
- `/petloot range 40`: collection radius, 5–80 cells.
- `/petloot speed 2`: pet movement multiplier, 0.25–10 (default 2).
- `/petloot nearby`: up to twelve nearby names, stack sizes and metadata ids.
- `/petloot reset`: discard this character's overrides and use server defaults.

Expand Down
2 changes: 1 addition & 1 deletion mods/petloot/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Pet Loot",
"description": "Worn pets collect selected currency with per-character filters and an immediate pause switch.",
"author": "zj1022",
"version": "1.0.5",
"version": "1.1.0",
"compatibleClientVersions": ["0.5.1-beta"],
"kind": "feature",
"depends": ["Game", "Cosmetics"],
Expand Down
18 changes: 18 additions & 0 deletions mods/petloot/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,27 @@
"min": 0,
"max": 65535
}
},
"movementSpeed": {
"type": "number",
"default": 2,
"min": 0.25,
"max": 10,
"format": "multiplier",
"label": "Pet movement speed",
"description": "Multiplier for following, collecting and returning; 1 is normal speed, 2 is double speed."
}
}
}
},
"movementSpeed": {
"type": "number",
"default": 2,
"min": 0.25,
"max": 10,
"format": "multiplier",
"label": "Pet movement speed",
"description": "Multiplier for following, collecting and returning; 1 is normal speed, 2 is double speed."
}
}
}
Loading