From 76e953242b594e8cb096eea1cecfe66e8bd3d011 Mon Sep 17 00:00:00 2001 From: Qblolz <23162132+Qblolz@users.noreply.github.com> Date: Wed, 11 Nov 2026 09:51:15 +0300 Subject: [PATCH 1/2] feat(gm-commands): add the /descendancy command The second ascendancy layer's selection moved out of LocalExile's Core/Player/Commands with the rest of the dev commands (#814). Lists and selects a Descendancy.dat row, clears it, opens the client's selector (0x7b kind 0x4c), refunds its nodes, and sets the three Wildwood Azmeri flag groups. Needs LocalExile/LocalExile#786, which makes Game.SelectDescendancy and Game.Descendancies public. --- mods/gm-commands/GmCommands.cs | 63 ++++++++++++++++++++++++++++++++++ mods/gm-commands/README.md | 2 +- mods/gm-commands/mod.json | 2 +- 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/mods/gm-commands/GmCommands.cs b/mods/gm-commands/GmCommands.cs index cdc5bde..c1ac745 100644 --- a/mods/gm-commands/GmCommands.cs +++ b/mods/gm-commands/GmCommands.cs @@ -1061,6 +1061,69 @@ await ChangeHeldItem(remote, stream, ciphers, conn, i => SocketLayout.Apply(i, t var error = await ChangePassives(remote, stream, ciphers, conn, conn.MainAscendancy.Allocated.ToArray(), false, "/reset_ascendancy", refundPoints: true); await conn.Commands!.Reply(error ?? "Ascendancy passives refunded; you can choose another main ascendancy."); }) + .Add("descendancy", "/descendancy [name|none|open [row|name]|refund ] (dev: the second ascendancy layer 0x33's spare byte selects: Affliction's Wildwood specialisations and the 3.29 Bloodline classes; open shows the client's Descendancy class selector)", async args => + { + if (Game.Descendancies.Rows.Count <= 1) throw new ArgumentException("Descendancy data is missing; run scripts/dev/extract-data.ps1"); + if (args.Length == 0) + { + var current = Game.Descendancies.Rows.FirstOrDefault(r => r.Index == conn.DescendancyRow); + await conn.Commands!.Reply($"Descendancy - {(current is { Index: > 0 } ? current.Name : "none")}.\n" + + string.Join("\n", Game.Descendancies.Rows.Where(r => r.Index != 0).Select(r => $"/descendancy {r.Id}"))); + return; + } + if (args[0].Equals("open", StringComparison.OrdinalIgnoreCase)) + { + // 0x7b kind 0x4c: the client's Descendancy class selector, with the Descendancy.dat row as its first u32. + byte descRow = args.Length > 1 + ? Game.Descendancies.Find(args[1])?.Index ?? byte.Parse(args[1]) + : conn.DescendancyRow; + if (args.Length > 1 && Game.Descendancies.Rows.All(r => r.Index != descRow)) + throw new ArgumentException("no such Descendancy row"); + if (descRow == 0) + throw new ArgumentException("no Descendancy chosen; pass a row name or number, for example /descendancy open 6"); + string descName = Game.Descendancies.Rows.FirstOrDefault(r => r.Index == descRow)?.Name ?? "?"; + await conn.Commands!.Reply($"0x7b kind 0x4c row {descRow} ({descName})"); + await Send(remote, stream, ciphers, InstanceWaypoints.OpenUi(InstanceWaypoints.DescendancySelectUi, descRow), + $"0x007b kind 0x4c row {descRow} (descendancy open)"); + return; + } + if (args[0].Equals("refund", StringComparison.OrdinalIgnoreCase)) + { + if (conn.DescendancyNodes.Count == 0) { await conn.Commands!.Reply("No descendancy nodes are allocated."); return; } + ushort[] nodes = args.Length > 1 && !args[1].Equals("all", StringComparison.OrdinalIgnoreCase) + ? [ushort.Parse(args[1])] + : [.. conn.DescendancyNodes]; + foreach (ushort n in nodes) + if (!conn.DescendancyNodes.Contains(n)) throw new ArgumentException($"{n} is not an allocated descendancy node"); + string? refundError = await ChangePassives(remote, stream, ciphers, conn, nodes, allocate: false, + "/descendancy refund", refundPoints: true); + await conn.Commands!.Reply(refundError ?? $"Refunded {nodes.Length} descendancy node(s)."); + return; + } + if (args[0].Equals("none", StringComparison.OrdinalIgnoreCase)) + { + Game.SelectDescendancy(conn, 0); + await conn.Commands!.Reply("Descendancy cleared. Reloading the area to show the change."); + await ChangeArea(remote, stream, ciphers, conn, new PendingTransfer(conn.Layout.Hash, 0, false), "descendancy none"); + return; + } + string name = string.Join(' ', args); + var row = Game.Descendancies.Find(name) ?? throw new ArgumentException("choose one Id from /descendancy"); + // Affliction's Wildwood rows keep their own gate in the client: the Azmeri class flag and the four point flags + // unlock the tree and its eight points (the 3.29 Bloodline rows use the 0x33 byte alone). + string[] azmeri = row.Index switch + { + 1 => ["AzmeriAreWarden", "WardenPassivePoints1", "WardenPassivePoints2", "WardenPassivePoints3", "WardenPassivePoints4"], + 2 => ["AzmeriAreVoodooShaman", "ShamanPassivePoints1", "ShamanPassivePoints2", "ShamanPassivePoints3", "ShamanPassivePoints4"], + 3 => ["AzmeriArePrimalist", "PrimalistPassivePoints1", "PrimalistPassivePoints2", "PrimalistPassivePoints3", "PrimalistPassivePoints4"], + _ => [], + }; + if (azmeri.Length > 0) await SetQuestFlags(remote, stream, ciphers, conn, azmeri); + Game.SelectDescendancy(conn, row.Index); + await conn.Commands!.Reply($"Descendancy selected - {row.Name} (row {row.Index})" + + (azmeri.Length > 0 ? " with its Azmeri flags" : "") + ". Reloading the area to show its tree."); + await ChangeArea(remote, stream, ciphers, conn, new PendingTransfer(conn.Layout.Hash, 0, false), $"descendancy {row.Name}"); + }) .Add("gold", "/gold (dev: add gold, or take it with a negative amount; the account's, saved)", async args => { if (args.Length == 0 || !long.TryParse(args[0], out long delta)) throw new ArgumentException("an amount of gold (negative takes gold)"); diff --git a/mods/gm-commands/README.md b/mods/gm-commands/README.md index 31e8323..ea6c9e3 100644 --- a/mods/gm-commands/README.md +++ b/mods/gm-commands/README.md @@ -13,7 +13,7 @@ whenever the Game module does. | Movement | `/tp`, `/goto`, `/tour` (with `live.ps1 -Walkmaps`), `/pos` | | Monsters and NPCs | `/spawn_mob`, `/mobs`, `/despawn`, `/kill`, `/mob_mods`, `/mob_tp`, `/mob_move`, `/mob_walk`, `/anim`, `/ai`, `/statue`, `/npc`, `/npcs`, `/npc_place`, `/npc_face` | | Items | `/item`, `/item_give` (Waypoint's item crafter), `/item_tab`, `/gem`, `/gem_xp`, `/adorned`, `/unique_jewel`, `/radius_jewel`, `/impossible_escape`, `/timeless`, `/voices`, `/cluster_jewel`, `/corrupt`, `/item_mod`, `/item_max`, `/item_mods`, `/roll`, `/base_defence`, `/item_state`, `/rarity`, `/sockets` | -| Character | `/set_level`, `/add_xp`, `/gold`, `/add_passive_points`, `/add_refund_points`, `/add_passive`, `/reset_passives`, `/ascendancy`, `/ascendancy_points`, `/reset_ascendancy`, `/atlas_points`, `/waypoints`, `/quest_flag`, `/league_flag`, `/trials`, `/quest_preset` | +| Character | `/set_level`, `/add_xp`, `/gold`, `/add_passive_points`, `/add_refund_points`, `/add_passive`, `/reset_passives`, `/ascendancy`, `/descendancy`, `/ascendancy_points`, `/reset_ascendancy`, `/atlas_points`, `/waypoints`, `/quest_flag`, `/league_flag`, `/trials`, `/quest_preset` | | Stats | `/stat`, `/set_stat`, `/set_speed`, `/set_aoe`, `/god`, `/charges`, `/auras`, `/resistances`, `/crit`, `/block`, `/accuracy`, `/defences`, `/suppression` | | Test hits | `/hit`, `/spellhit`, `/blockhit`, `/blind`, `/heal`, `/death_screen`, `/block_luck`, `/suppression_luck` | | Areas and objects | `/stash_place`, `/guild_stash_place`, `/stash_add`, `/stash`, `/wp_place`, `/wp_state`, `/transition`, `/map_portal`, `/portal_rotation`, `/cosmetic`, `/hideout_keys`, `/atlas`, `/atlas_tree`, `/lab_layout` | diff --git a/mods/gm-commands/mod.json b/mods/gm-commands/mod.json index 585ea38..ee4385a 100644 --- a/mods/gm-commands/mod.json +++ b/mods/gm-commands/mod.json @@ -3,7 +3,7 @@ "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.4.0", + "version": "1.5.0", "compatibleClientVersions": ["0.5.2-beta"], "kind": "feature", "depends": ["Game"] From cd809a20ef4ac7d8a79eee43b300b6cba471c2fb Mon Sep 17 00:00:00 2001 From: Qblolz <23162132+Qblolz@users.noreply.github.com> Date: Wed, 11 Nov 2026 18:49:35 +0300 Subject: [PATCH 2/2] feat(gm-commands): use the Game's Descendancy admission API The game path now accepts 0x3a only for the row the server offered in the current area and checks the Wildwood gate and refunded nodes. The dev command keeps its unrestricted selection through Game.SelectDescendancyForDevelopment and opens the selector through Game.OpenDescendancySelector, so it still records the offer the client answers. --- mods/gm-commands/GmCommands.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mods/gm-commands/GmCommands.cs b/mods/gm-commands/GmCommands.cs index c1ac745..c7576f0 100644 --- a/mods/gm-commands/GmCommands.cs +++ b/mods/gm-commands/GmCommands.cs @@ -1083,8 +1083,7 @@ await ChangeHeldItem(remote, stream, ciphers, conn, i => SocketLayout.Apply(i, t throw new ArgumentException("no Descendancy chosen; pass a row name or number, for example /descendancy open 6"); string descName = Game.Descendancies.Rows.FirstOrDefault(r => r.Index == descRow)?.Name ?? "?"; await conn.Commands!.Reply($"0x7b kind 0x4c row {descRow} ({descName})"); - await Send(remote, stream, ciphers, InstanceWaypoints.OpenUi(InstanceWaypoints.DescendancySelectUi, descRow), - $"0x007b kind 0x4c row {descRow} (descendancy open)"); + await Game.OpenDescendancySelector(remote, stream, ciphers, conn, descRow); return; } if (args[0].Equals("refund", StringComparison.OrdinalIgnoreCase)) @@ -1102,7 +1101,7 @@ await Send(remote, stream, ciphers, InstanceWaypoints.OpenUi(InstanceWaypoints.D } if (args[0].Equals("none", StringComparison.OrdinalIgnoreCase)) { - Game.SelectDescendancy(conn, 0); + Game.SelectDescendancyForDevelopment(conn, 0); await conn.Commands!.Reply("Descendancy cleared. Reloading the area to show the change."); await ChangeArea(remote, stream, ciphers, conn, new PendingTransfer(conn.Layout.Hash, 0, false), "descendancy none"); return; @@ -1119,7 +1118,7 @@ await Send(remote, stream, ciphers, InstanceWaypoints.OpenUi(InstanceWaypoints.D _ => [], }; if (azmeri.Length > 0) await SetQuestFlags(remote, stream, ciphers, conn, azmeri); - Game.SelectDescendancy(conn, row.Index); + Game.SelectDescendancyForDevelopment(conn, row.Index); await conn.Commands!.Reply($"Descendancy selected - {row.Name} (row {row.Index})" + (azmeri.Length > 0 ? " with its Azmeri flags" : "") + ". Reloading the area to show its tree."); await ChangeArea(remote, stream, ciphers, conn, new PendingTransfer(conn.Layout.Hash, 0, false), $"descendancy {row.Name}");