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 mods.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{ "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": "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": "pob", "name": "POB", "description": "Preview and import a character build through a configured external PoB converter.", "author": "nikolos89", "version": "1.0.3", "compatibleClientVersions": ["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
11 changes: 11 additions & 0 deletions mods/pob/Converter/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<LocalExileRoot Condition="'$(LocalExileRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)', 'GameServer.slnx'))</LocalExileRoot>
<LocalExileRoot Condition="'$(LocalExileRoot)' == ''">$(MSBuildThisFileDirectory)..\..\..\..\LocalExile\</LocalExileRoot>
<LocalExileDir>$([MSBuild]::EnsureTrailingSlash('$(LocalExileRoot)'))</LocalExileDir>
</PropertyGroup>
</Project>
339 changes: 339 additions & 0 deletions mods/pob/Converter/LICENSE

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions mods/pob/Converter/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The bounded PoB parser, item conversion, passive validation and native table readers were adapted from
LocalExile feature/pob-import commit 5394de0a5208bb2407491cf986fab5455714bdc8:
https://github.com/evrydayjunglist/evryPath/tree/5394de0a5208bb2407491cf986fab5455714bdc8
The tattoo catalogue, target-set and limit rules (PathOfBuildingTattoos.cs) were adapted from LocalExile main
commit ec522f1876690c0b203636bf78b508f308365163:
https://github.com/LocalExile/LocalExile/tree/ec522f1876690c0b203636bf78b508f308365163

This standalone converter is supplied as source with the POB mod. It prepares builds using the server's extracted
tables and read-only catalogue; the Gateway owns the final save transaction. No Path of Building executable,
game tables, client files or .NET runtime are distributed in this source folder.

Microsoft.Data.Sqlite and its SQLite native dependencies retain their upstream license notices in operator-built output.
.NET and Microsoft.Data.Sqlite: Copyright Microsoft Corporation and contributors, MIT.
SQLitePCLRaw: Copyright SourceGear, LLC, Apache License 2.0.
Native SQLite is in the public domain: https://www.sqlite.org/copyright.html

Converter sources adapted from LocalExile retain its GNU GPL version 2 license (LICENSE).
The Apache-licensed mod front end communicates with the separate converter over JSON stdin/stdout.
16 changes: 16 additions & 0 deletions mods/pob/Converter/PobImport.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AssemblyName>PobImport</AssemblyName>
<InvariantGlobalization>true</InvariantGlobalization>
<NoWarn>$(NoWarn);CS8618;CS8632</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.12" />
<Compile Include="$(LocalExileDir)src/GameServer.Gateway/Item/StatDescriptions.cs" Link="Server/StatDescriptions.cs" />
<Compile Include="$(LocalExileDir)src/GameServer.Core/Tables/ClientTables.cs" Link="Server/ClientTables.cs" />
<Compile Include="$(LocalExileDir)src/GameServer.Core/Tables/ClientTable.cs" Link="Server/ClientTable.cs" />
<Compile Include="$(LocalExileDir)Modules/Core/Game/Item/CatalystQuality.cs" Link="Server/CatalystQuality.cs" />
<Compile Include="$(LocalExileDir)Modules/Core/Game/Item/HeistModifierMagnitudes.cs" Link="Server/HeistModifierMagnitudes.cs" />
</ItemGroup>
</Project>
101 changes: 101 additions & 0 deletions mods/pob/Converter/Source/IndexedMods.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
using System.Globalization;
using System.Text.Json;
using System.Text.RegularExpressions;
using GameServer.Core.Protocol.Instance;

// 3.29.3b FUN_1424c6020 cases 0x27/0x28/0x3a resolve the numeric stat through the
// Index column of these tables, not a zero-based row number or a displayed numeric roll.
static class IndexedMods
{
// PoB combines identical stat lines: two tattoos expose one "-2" line, while each
// native modifier still carries its own -1 and companion stat. Expand only a complete
// set of native tattoo companions; never reinterpret a lone penalty or a Heist enchant.
public static (IReadOnlyList<ModText.Line> Lines, int[] Source) ExpandSockets(
IReadOnlyList<ModText.Line> lines, IReadOnlyDictionary<string, string[]> entries)
{
var expanded = new List<ModText.Line>();
var source = new List<int>();
for (int i = 0; i < lines.Count; i++)
{
var line = lines[i];
var match = Match(line.Text, @"^-(?<count>[2-3]) to maximum Sockets$");
int copies = 1;
if (match.Success)
{
int count = Number(match, "count");
int companions = lines.Count(other => other.Section == line.Section && entries.Any(e =>
e.Key.StartsWith("DeepwaterTattooEnchant", StringComparison.Ordinal)
&& e.Value.Length == 2 && e.Value.Contains("-1 to maximum Sockets")
&& e.Value.Any(text => text != "-1 to maximum Sockets" && string.Equals(text, other.Text, StringComparison.OrdinalIgnoreCase))));
if (companions == count) copies = count;
}
for (int n = 0; n < copies; n++)
{
expanded.Add(copies > 1 ? line with { Text = "-1 to maximum Sockets" } : line);
source.Add(i);
}
}
return (expanded, source.ToArray());
}

static readonly Lazy<Dictionary<string, int>> Skills = new(() => Names("IndexableSkillGems", "Name1"));
static readonly Lazy<Dictionary<string, int>> Supports = new(() => Names("IndexableSupportGems", "Name"));
static readonly Lazy<Dictionary<string, int>> NonActive = new(() => Names("IndexableNonActiveSupportGems", "Name"));

static Dictionary<string, int> Names(string table, string field)
{
using var doc = NativeData.Read($"data/tables/{table}.json");
return doc.RootElement.EnumerateArray().GroupBy(r => r.GetProperty(field).GetString()!, StringComparer.OrdinalIgnoreCase)
.ToDictionary(g => g.Key, g => g.First().GetProperty("Index").GetInt32(), StringComparer.OrdinalIgnoreCase);
}

static Match Match(string line, string pattern) => Regex.Match(line, pattern, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
static int Number(Match m, string group) => int.Parse(m.Groups[group].Value, CultureInfo.InvariantCulture);

public static IReadOnlyList<ModText.Found> Resolve(IReadOnlyList<ModText.Line> lines, Item item, ModCatalog mods)
{
var result = new List<ModText.Found>();
var used = new HashSet<string>();
for (int i = 0; i < lines.Count; i++)
{
var line = lines[i];
if (item.Rarity != ItemRarity.Unique || line.Section != ModSection.Explicit) continue;
string? id = null;
Dictionary<string, int>? values = null;
var skill = Match(line.Text, @"^(?<level>[+-]\d+) to Level of all (?<name>.+) Gems$");
var pearl = Match(line.Text, @"^Skills Socketed in your (?<slot>Helmet|Gloves|Boots) are Supported by level (?<level>\d+) (?<name>.+)$");
var tree = Match(line.Text, @"^Skills granted by your Passive Tree are Supported by level (?<level>\d+) (?<name>.+)$");
var support = Match(line.Text, @"^Socketed Gems are Supported by Level (?<level>\d+) (?<name>.+)$");
if (skill.Success && Skills.Value.TryGetValue(skill.Groups["name"].Value, out int skillIndex))
{
id = "RandomSkillUnique__1";
values = new() { ["random_skill_gem_level_+_level"] = Number(skill, "level"), ["random_skill_gem_level_+_index"] = skillIndex };
}
else if ((pearl.Success || tree.Success) && NonActive.Value.TryGetValue((pearl.Success ? pearl : tree).Groups["name"].Value, out int pearlIndex))
{
var match = pearl.Success ? pearl : tree;
int slot = !pearl.Success ? 4 : pearl.Groups["slot"].Value.ToLowerInvariant() switch { "helmet" => 1, "gloves" => 2, _ => 3 };
int n = used.Contains("UniquePearlSupportOne") ? 2 : 1;
id = n == 1 ? "UniquePearlSupportOne" : "UniquePearlSupportTwo";
values = new() { [$"local_pearl_random_support_gem_{n}_slot_index"] = slot,
[$"local_pearl_random_support_gem_{n}_index"] = pearlIndex, [$"local_pearl_random_support_gem_{n}_level"] = Number(match, "level") };
}
else if (support.Success && Supports.Value.TryGetValue(support.Groups["name"].Value, out int supportIndex))
{
int level = Number(support, "level");
bool high = level >= 25;
id = high ? "RandomSupportUnique__2" : "RandomSupportUnique__1";
string suffix = high ? "_1" : "";
values = new() { [$"local_random_support_gem_index{suffix}"] = supportIndex, [$"local_random_support_gem_level{suffix}"] = level };
}
if (id is null || values is null || used.Contains(id) || mods.ById(id) is not { } mod
|| mod.Stats.Any(s => !values.ContainsKey(s.Id))) continue;
// Out-of-roll levels can be retained, but an index must always name an actual native entry.
int[] native = [.. mod.Stats.Select(s => values[s.Id])];
bool outside = mod.Stats.Where((s, n) => native[n] < Math.Min(s.Min, s.Max) || native[n] > Math.Max(s.Min, s.Max)).Any();
used.Add(id);
result.Add(new(new(line.Section, mod.Hash, native), [i], outside));
}
return result;
}
}
Loading
Loading