feat: SK backlog from test through 2026.11.22.48 (Trade Shop, Oracle, quests, loot, nav)
Squash of test/main-merge-2026-10-25 onto aelrynth main 2026.11.19.1 for the standing sk PR. Includes Trade Shop, Oracle wiki/ILT tracker, quest runs, loot checklist, RynthNav, VTank import. HandWrittenVersion remains 0.5.0-legacy-ui. See Changelog/2026-11-22-sk-backlog-test-merge.md.
This commit is contained in:
parent
660e6b5b1c
commit
dc08e1abba
521 changed files with 47247 additions and 795 deletions
218
Tools/RynthOracle.Tests/FandomTests.cs
Normal file
218
Tools/RynthOracle.Tests/FandomTests.cs
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using RynthCore.Plugin.RynthOracle;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
using RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// RynthOracle's own wiki feed from the AC Community Wiki (asheron.fandom.com) and the Quests tab's Wiki, Kill
|
||||
// Tasks, Society and Contracts lists on every server (2026-11-21, Silentkelpie: "under oracle duplicate itl
|
||||
// functions ... tabs for quests, kill task, socity quests, contracts ... should not be gated behind any server
|
||||
// check"). The pages are the wiki's own (2026-11-21), cut down.
|
||||
internal static partial class Program
|
||||
{
|
||||
private const string FandomDrudge = """
|
||||
{{Quest Summary
|
||||
| Kill Task = Yes
|
||||
| Quest Type = Solo
|
||||
| Level = Any
|
||||
| Recommended Level = 20+
|
||||
| Starts With = [[Jarvis Hammerstone]]
|
||||
| Starts At = 25.6N, 49.4E in [[Cragstone]]
|
||||
| Route =
|
||||
| Repeat Timer = 20 Hours
|
||||
| Time to Complete =
|
||||
| Contracts =
|
||||
}}
|
||||
== Walkthrough & Notes ==
|
||||
# Kill 100 [[Drudge Lurker]]s.
|
||||
# Return to [[Jarvis Hammerstone]] for your rewards.
|
||||
|
||||
== Rewards ==
|
||||
{{Rewards Table
|
||||
| Quest Task =
|
||||
| Max XP Reward = 441,350 | Percent of Level = 50 | Level Cap = 30
|
||||
| Title Reward = Drudge Doom
|
||||
}}
|
||||
""";
|
||||
|
||||
private const string FandomAdept = """
|
||||
{{Quest Summary
|
||||
| Level = 180
|
||||
| Society Rank = Initiate
|
||||
| Quest Type = Solo
|
||||
| Starts With = [[Aldrion of the Celestial Hand]] ([[Celestial Hand|CH]])
|
||||
| Starts At = [[Faction Stronghold]] (east wing)
|
||||
| Repeat Timer = Non Repeatable
|
||||
}}
|
||||
== Walkthrough & Notes ==
|
||||
# Take the [[Neydisa Castle]] portal in [[Town Network]] (South Wing) and run north to 74.8N, 18.4E. Enter the [[Rogue Delvings]].
|
||||
# At the end of each wing is a named Captain surrounded by Scouts that will give you a key (if same faction) or will drop the key on his corpse (if opposing faction).
|
||||
## {{Itemlink|Donnarion's Key}} : can be found in the west wing
|
||||
""";
|
||||
|
||||
private const string FandomContract = """
|
||||
{{Intro
|
||||
| Patch Introduced = [[Stirrings in the Dark]]
|
||||
| Related Quests = [[Aerbax's Citadel]]
|
||||
| Updated =
|
||||
}}
|
||||
{{Item
|
||||
| Name = Contract for Aerbax's Defeat
|
||||
| Icon Image = Contract for Aerbax's Defeat Icon.png
|
||||
| Description = The Shadow of Aerbax must be defeated.
|
||||
| Recommended Level = 150
|
||||
}}
|
||||
== Notes ==
|
||||
* Purchased from [[Hanadi the Barkeeper]] in the Sho hall of the [[Town Network]].
|
||||
|
||||
[[Category:Contracts]]
|
||||
""";
|
||||
|
||||
private const string FandomCitadel = """
|
||||
{{Quest Summary
|
||||
| Quest Type = Fellowship
|
||||
| Starts With = [[Hanadi the Barkeeper]]
|
||||
| Repeat Timer = 20 Hours
|
||||
| Contracts = [[Contract for Aerbax's Defeat]]
|
||||
}}
|
||||
== Walkthrough & Notes ==
|
||||
# Use the contract, then enter [[Aerbax's Citadel]].
|
||||
# Defeat the Shadow of Aerbax.
|
||||
""";
|
||||
|
||||
private static void Fandom()
|
||||
{
|
||||
// ── The pages ────────────────────────────────────────────────────
|
||||
GuideQuest drudge = WikiQuestParser.Parse("Drudge Lurker Kill Task", FandomDrudge, 11, FandomFeed.WikiBase);
|
||||
Check(drudge.Url == "https://asheron.fandom.com/wiki/Drudge_Lurker_Kill_Task" && drudge.IsKillTask && drudge.KillTarget == 100 && drudge.RepeatSec == 72000,
|
||||
"fandom: a kill task page, the fandom's address");
|
||||
Check(drudge.Steps.Count == 2 && drudge.StartsWith == "Jarvis Hammerstone", "fandom: its steps and start");
|
||||
GuideQuest adept = WikiQuestParser.Parse("Adept Test", FandomAdept, 12, FandomFeed.WikiBase);
|
||||
Check(adept.SocietyRank == "Initiate" && adept.IsOneTime && adept.Steps.Count >= 2, $"fandom: a society quest's rank from its box ({adept.SocietyRank}|{adept.RepeatSec}|{adept.Steps.Count}|{string.Join(",", adept.Loot)}|{string.Join(";", adept.Steps.SelectMany(x => x.Items))})");
|
||||
Check(adept.Loot.Contains("Donnarion's Key"), "fandom: the items a step names are the quest's loot (its loot profile)");
|
||||
Check(WikiQuestParser.IsContractPage("Contract for Aerbax's Defeat", FandomContract) && !WikiQuestParser.IsContractPage("Adept Test", FandomAdept),
|
||||
"fandom: a contract page");
|
||||
GuideContract con = WikiQuestParser.ParseContract("Contract for Aerbax's Defeat", FandomContract, 13, FandomFeed.WikiBase);
|
||||
Check(con.Name == "Contract for Aerbax's Defeat" && con.Description == "The Shadow of Aerbax must be defeated." && con.Level == "150",
|
||||
"fandom contract: name, description, level");
|
||||
Check(con.Npc == "Hanadi the Barkeeper" && con.Where.StartsWith("Purchased from Hanadi the Barkeeper in the Sho hall", StringComparison.Ordinal),
|
||||
"fandom contract: where it comes from, and who");
|
||||
Check(con.Quests.SequenceEqual(new[] { "Aerbax's Citadel" }) && con.Rev == 13, "fandom contract: the quest it is for");
|
||||
Check(GuideStamp.Clean("x") == "x" && adept.AllStamps().Count() == 0, "fandom: no stamps on the AC Community Wiki");
|
||||
|
||||
// ── The feed's own logic ─────────────────────────────────────────
|
||||
Check(FandomFeed.RankOf("Category:Society Quests: Knight Rank") == "Knight" && FandomFeed.RankOf("Category:Society Quests: Initiate Rank") == "Initiate"
|
||||
&& FandomFeed.RankOf("Category:Joining a Society Quests") == "Joining" && FandomFeed.RankOf("Category:Kill Tasks") == "",
|
||||
"fandom feed: the rank from the society sub-category");
|
||||
Check(FandomFeed.SkipCategory("Category:Quest Items") && FandomFeed.SkipCategory("Category:Contract Brokers and Barkeeps")
|
||||
&& !FandomFeed.SkipCategory("Category:Kill Tasks by Level") && !FandomFeed.SkipCategory("Category:Society Quests: Adept Rank"),
|
||||
"fandom feed: item and NPC categories are not followed");
|
||||
var (pages, subs, cont) = MediaWikiJson.Members("""{"continue":{"cmcontinue":"page|X","continue":"-||"},"query":{"categorymembers":[{"ns":0,"title":"Adept Test"},{"ns":14,"title":"Category:Society Quests: Adept Rank"},{"ns":6,"title":"File:x.png"}]}}""", "categorymembers");
|
||||
Check(pages.SequenceEqual(new[] { "Adept Test" }) && subs.SequenceEqual(new[] { "Category:Society Quests: Adept Rank" }) && cont.Count == 2,
|
||||
"fandom feed: a category page, its sub-categories and the continue");
|
||||
var old = new QuestGuide { Parser = WikiQuestParser.Version, UpdatedUtc = DateTime.UtcNow };
|
||||
old.Quests.Add(drudge);
|
||||
old.Contracts.Add(con);
|
||||
var revs = new Dictionary<string, long> { ["Drudge Lurker Kill Task"] = 11, ["Contract for Aerbax's Defeat"] = 14, ["Adept Test"] = 12, ["Gone"] = 1 };
|
||||
Check(FandomFeed.PagesToRead(old, revs).OrderBy(x => x).SequenceEqual(new[] { "Adept Test", "Contract for Aerbax's Defeat", "Gone" }),
|
||||
"fandom feed: only new and edited pages are read");
|
||||
Check(FandomFeed.PagesToRead(new QuestGuide { Parser = 1, Quests = { drudge } }, revs).Count == 4, "fandom feed: every page for an older reader");
|
||||
QuestGuide merged = FandomFeed.Merge(old, revs, new Dictionary<string, GuideQuest> { ["Adept Test"] = adept }, new Dictionary<string, GuideContract>());
|
||||
Check(merged.Quests.Select(q => q.Title).SequenceEqual(new[] { "Adept Test", "Drudge Lurker Kill Task" }) && merged.Contracts.Count == 1 && merged.Source == "fandom",
|
||||
"fandom feed: the merge keeps unchanged pages and takes fresh ones");
|
||||
Check(FandomFeed.Due(new QuestGuide(), DateTime.UtcNow) && !FandomFeed.Due(old, DateTime.UtcNow) && FandomFeed.Due(old, DateTime.UtcNow.AddHours(25)),
|
||||
"fandom feed: read at login when none, or a day old");
|
||||
|
||||
// The guide file keeps the society ranks and the contracts.
|
||||
GuideQuest citadel = WikiQuestParser.Parse("Aerbax's Citadel", FandomCitadel, 15, FandomFeed.WikiBase);
|
||||
var g = new QuestGuide { Source = "fandom", Parser = WikiQuestParser.Version, UpdatedUtc = DateTime.UtcNow, Quests = { adept, citadel, drudge }, Contracts = { con } };
|
||||
g.KillTasks.Add("Drudge Lurker Kill Task");
|
||||
g.Society["Collect Gear Knight Parts"] = "Initiate";
|
||||
QuestGuide back = QuestGuide.Parse(g.ToJson());
|
||||
Check(back.Contracts.Count == 1 && back.Contracts[0].Npc == "Hanadi the Barkeeper" && back.Contracts[0].Quests[0] == "Aerbax's Citadel"
|
||||
&& back.Society["Collect Gear Knight Parts"] == "Initiate" && back.Find("Adept Test")!.SocietyRank == "Initiate",
|
||||
"fandom guide json: contracts and society ranks round-trip");
|
||||
|
||||
// ── The tabs, off Infinite Leaftide ──────────────────────────────
|
||||
string file = Path.Combine(Path.GetTempPath(), "RynthOracleTests-" + Guid.NewGuid().ToString("N") + "-fandom.json");
|
||||
OracleContext c = On("");
|
||||
c.Fandom = new FandomFeed(file);
|
||||
Check(c.Fandom.Guide.Quests.Count == 0 && c.Fandom.Status == "not read yet", "fandom feed: nothing saved yet");
|
||||
c.Fandom.Use(back);
|
||||
Check(c.WikiIsFandom && ReferenceEquals(c.Wiki, c.Fandom.Guide) && c.FindWiki("Aerbax's Citadel") != null, "context: the AC Wiki is the wiki in use off ILT");
|
||||
var view = new OracleView(c);
|
||||
var host = new UiHost();
|
||||
UiWindow main = host.Add(new UiWindow("RynthOracle/Oracle", "Oracle") { Visible = true });
|
||||
c.Settings.QuestGuideView = true;
|
||||
c.Settings.TabName = OracleView.TabQuests;
|
||||
List<GuideTab> tabs = view.GuideTabs();
|
||||
Check(tabs.Contains(GuideTab.Wiki) && tabs.Contains(GuideTab.KillTasks) && tabs.Contains(GuideTab.Society) && tabs.Contains(GuideTab.Contracts) && !tabs.Contains(GuideTab.Qb),
|
||||
"fandom tabs: Wiki, Kill Tasks, Society and Contracts on any server");
|
||||
|
||||
view.ShowGuide(GuideTab.Wiki, "w:Adept Test");
|
||||
string body = Frame(host, main, view, "fandom, wiki");
|
||||
Check(body.Contains("AC Wiki") && body.Contains("AC Wiki: 3 quests, 1 contracts"), "fandom tabs: the tab and the source line say AC Wiki");
|
||||
Check(body.Contains("###g.r.w:Adept Test") && body.Contains("###g.r.w:Drudge Lurker Kill Task") && body.Contains("###g.r.w:Aerbax's Citadel"), "fandom tabs: every wiki quest");
|
||||
Check(body.Contains("###g.run") && body.Contains("###g.loot") && body.Contains("###g.lootprofile"), "fandom tabs: Run this quest, its loot and loot profile");
|
||||
|
||||
view.ShowGuide(GuideTab.KillTasks, "w:Drudge Lurker Kill Task");
|
||||
body = Frame(host, main, view, "fandom, kill tasks");
|
||||
Check(body.Contains("###g.r.w:Drudge Lurker Kill Task") && !body.Contains("###g.r.w:Adept Test") && body.Contains("0 / 100"), "fandom tabs: the kill tasks");
|
||||
Check(body.Contains("Kills: not started (the task is 100 kills)"), "fandom tabs: the kill line off ILT");
|
||||
|
||||
view.ShowGuide(GuideTab.Society, "w:Adept Test");
|
||||
body = Frame(host, main, view, "fandom, society");
|
||||
Check(body.Contains("Initiate: Adept Test") && !body.Contains("###g.r.w:Drudge Lurker Kill Task"), "fandom tabs: society quests by rank");
|
||||
|
||||
view.ShowGuide(GuideTab.Contracts, "c:Contract for Aerbax's Defeat");
|
||||
body = Frame(host, main, view, "fandom, contracts");
|
||||
Check(body.Contains("###g.r.c:Contract for Aerbax's Defeat") && body.Contains("Purchased from Hanadi the Barkeeper") && body.Contains("###g.c.go"),
|
||||
"fandom tabs: a contract, where it comes from, Go");
|
||||
Check(body.Contains("###g.c.q.0") && body.Contains("Aerbax's Citadel"), "fandom tabs: the contract's quest, Open");
|
||||
|
||||
// A quest the wiki has no stamps for takes its state from the quest list's flag of the same name.
|
||||
Quest? listed = c.Catalog.Quests.FirstOrDefault(q => !q.IsNew && q.Name.Length > 0 && q.MinDelta <= 0 && !q.Flag.Contains(' '));
|
||||
if (listed != null)
|
||||
{
|
||||
var g2 = new QuestGuide { Source = "fandom", Parser = WikiQuestParser.Version, UpdatedUtc = DateTime.UtcNow,
|
||||
Quests = { new GuideQuest { Title = listed.DisplayName, Url = "u", Steps = { new GuideStep { Text = "Do it." } } } } };
|
||||
c.Fandom.Use(g2);
|
||||
c.Flags.OnChatLine($"{listed.Flag} - 1 solves ({new DateTimeOffset(DateTime.UtcNow.AddDays(-1)).ToUnixTimeSeconds()})\"x\" 1 0", c.NowMs);
|
||||
c.Flags.Tick(c.NowMs + 5_000);
|
||||
view.ShowGuide(GuideTab.Wiki, "w:" + listed.DisplayName);
|
||||
body = Frame(host, main, view, "fandom, catalog state");
|
||||
Check(listed.IsComplete(c.Flags) && body.Contains("Fully done: its flag is held"), "fandom tabs: a stampless quest's state from the quest list");
|
||||
}
|
||||
// A server's own wiki guide ("RynthServer.QuestGuide", RynthConquest's) over the AC Community Wiki's.
|
||||
c.Fandom.Use(back);
|
||||
var sg = new QuestGuide { Source = "conquest", Parser = WikiQuestParser.Version, UpdatedUtc = DateTime.UtcNow };
|
||||
var darsh = new GuideQuest { Title = "Darshmaul the Brutal", Url = "https://conquestac.fandom.com/wiki/Darshmaul_the_Brutal", Type = "Conquest", Repeat = "Daily", RepeatSec = 72000 };
|
||||
darsh.Steps.Add(new GuideStep { Text = "Portal to Fort 33.6S 74.9E", Coords = { "33.6S, 74.9E" } });
|
||||
darsh.Steps.Add(new GuideStep { Text = "Give to Vovran 33.4S 72.8E", Coords = { "33.4S, 72.8E" }, Stamps = { "assaultonaimaru" } });
|
||||
sg.Quests.Add(darsh);
|
||||
sg.Quests.Add(new GuideQuest { Title = "Adept Test", Url = "server", Steps = { new GuideStep { Text = "The server's way." } } });
|
||||
string sgFile = Path.Combine(Path.GetTempPath(), "RynthOracleTests-" + Guid.NewGuid().ToString("N") + "-server-guide.json");
|
||||
File.WriteAllText(sgFile, sg.ToJson());
|
||||
c.ServerGuide.Client.Take("{\"schema\":1,\"path\":" + System.Text.Json.JsonSerializer.Serialize(sgFile) + ",\"revision\":1,\"running\":false,\"login\":true,\"status\":\"read\",\"tag\":\"Conquest\"}");
|
||||
Check(c.ServerGuide.Client.Tag == "Conquest" && c.ServerGuide.Client.Guide.Quests.Count == 2, "server guide: taken from the plugin's info");
|
||||
Check(!c.WikiIsFandom && c.Wiki.Find("Darshmaul the Brutal") != null && c.Wiki.Find("Drudge Lurker Kill Task") != null && c.Wiki.Quests.Count == 4,
|
||||
"server guide: its quests over the AC Wiki's");
|
||||
Check(c.Wiki.Find("Adept Test")!.Url == "server", "server guide: its quest of the same name wins");
|
||||
Check(c.Wiki.Contracts.Count == 1 && c.WikiLabel == "Conquest Wiki", "server guide: the AC Wiki's contracts kept; the tab is the server's wiki");
|
||||
view.ShowGuide(GuideTab.Wiki, "w:Darshmaul the Brutal");
|
||||
body = Frame(host, main, view, "server guide");
|
||||
Check(body.Contains("Conquest Wiki") && body.Contains("###g.r.w:Darshmaul the Brutal") && body.Contains("###g.run"), "server guide: the tab, its quest, Run this quest");
|
||||
c.ServerGuide.Clear();
|
||||
Check(c.WikiIsFandom && c.WikiLabel == "AC Wiki", "server guide: gone with the server");
|
||||
try { File.Delete(sgFile); } catch { }
|
||||
|
||||
c.Settings.QuestGuideView = false;
|
||||
try { File.Delete(file); } catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
419
Tools/RynthOracle.Tests/GearTests.cs
Normal file
419
Tools/RynthOracle.Tests/GearTests.cs
Normal file
|
|
@ -0,0 +1,419 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RynthCore.Plugin.RynthOracle;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
using RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// The Gear tab (2026-10-19, UB-ILT's Gear overlap and Paragon gear for every server): the
|
||||
/// portal.dat spell table and set reader, the overlap / ward / bane / set analysis, the ratings
|
||||
/// list, and both views through the engine's parser.
|
||||
/// </summary>
|
||||
internal static partial class Program
|
||||
{
|
||||
private const uint MetaEnchant = 1, MetaProjectile = 2;
|
||||
private const uint TargetCreature = 0x10, TargetArmor = 0x6, TargetWeapon = 0x8101;
|
||||
|
||||
private static void Gear()
|
||||
{
|
||||
GearSpellTable();
|
||||
GearRealDat();
|
||||
GearNamesAndMath();
|
||||
GearOverlap();
|
||||
GearRatings();
|
||||
GearPages();
|
||||
}
|
||||
|
||||
// ── portal.dat ───────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>A SpellTable file as ACE.DatLoader reads it: spells, then equipment sets.</summary>
|
||||
private static byte[] SpellTableBytes((uint Id, string Name, uint School, uint Cat, uint Power, uint Meta, uint Target)[] spells,
|
||||
(uint Set, (uint Tier, uint[] Ids)[] Tiers)[] sets)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
var w = new BinaryWriter(ms);
|
||||
void Obf(string s)
|
||||
{
|
||||
byte[] b = Encoding.Latin1.GetBytes(s);
|
||||
for (int i = 0; i < b.Length; i++) b[i] = (byte)((b[i] << 4) | (b[i] >> 4));
|
||||
w.Write((ushort)b.Length);
|
||||
w.Write(b);
|
||||
while (ms.Position % 4 != 0) w.Write((byte)0);
|
||||
}
|
||||
w.Write(PortalSpellBook.SpellTableFileId);
|
||||
w.Write((ushort)spells.Length);
|
||||
w.Write((ushort)64);
|
||||
foreach (var s in spells)
|
||||
{
|
||||
w.Write(s.Id);
|
||||
Obf(s.Name);
|
||||
Obf("A test spell.");
|
||||
w.Write(s.School); w.Write(0u); w.Write(s.Cat); w.Write(0u); w.Write(10u);
|
||||
w.Write(0f); w.Write(0f);
|
||||
w.Write(s.Power);
|
||||
w.Write(1f); w.Write(1u); w.Write(0f);
|
||||
w.Write(s.Meta); w.Write(0u);
|
||||
if (s.Meta == 1 || s.Meta == 12) { w.Write(3600d); w.Write(0f); w.Write(0f); }
|
||||
else if (s.Meta == 7) w.Write(60d);
|
||||
for (int i = 0; i < 8; i++) w.Write(0u);
|
||||
w.Write(0u); w.Write(0u); w.Write(0u);
|
||||
w.Write(0d); w.Write(0f); w.Write(0u);
|
||||
w.Write(s.Target);
|
||||
w.Write(0u);
|
||||
}
|
||||
w.Write((ushort)sets.Length);
|
||||
w.Write((ushort)16);
|
||||
foreach (var set in sets)
|
||||
{
|
||||
w.Write(set.Set);
|
||||
w.Write((ushort)set.Tiers.Length);
|
||||
w.Write((ushort)8);
|
||||
foreach (var (tier, ids) in set.Tiers)
|
||||
{
|
||||
w.Write(tier);
|
||||
w.Write(ids.Length);
|
||||
foreach (uint id in ids) w.Write(id);
|
||||
}
|
||||
}
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
private static readonly (uint, string, uint, uint, uint, uint, uint)[] TestSpells =
|
||||
{
|
||||
(1, "Major Strength", 4, 261, 15, MetaEnchant, TargetCreature),
|
||||
(2, "Legendary Strength", 4, 261, 35, MetaEnchant, TargetCreature),
|
||||
(3, "Legendary Flame Ward", 2, 287, 25, MetaEnchant, TargetCreature),
|
||||
(4, "Epic Flame Ward", 2, 287, 20, MetaEnchant, TargetCreature),
|
||||
(5, "Legendary Slashing Bane", 3, 395, 4, MetaEnchant, TargetArmor),
|
||||
(6, "Major Slashing Bane", 3, 395, 2, MetaEnchant, TargetArmor),
|
||||
(7, "Legendary Defender", 3, 329, 9, MetaEnchant, TargetWeapon),
|
||||
(8, "Legendary Willpower", 4, 265, 35, MetaEnchant, TargetCreature),
|
||||
(9, "Flame Bolt Proc", 1, 77, 100, MetaProjectile, TargetCreature),
|
||||
(10, "Frost Bolt Proc", 1, 77, 120, MetaProjectile, TargetCreature),
|
||||
(11, "Set Bonus Spell", 4, 600, 50, MetaEnchant, TargetCreature),
|
||||
(12, "Set Bonus Spell II", 4, 600, 60, MetaEnchant, TargetCreature),
|
||||
};
|
||||
|
||||
private static PortalSpellBook TestBook()
|
||||
{
|
||||
byte[] raw = SpellTableBytes(TestSpells, new[] { (13u, new[] { (2u, new uint[] { 11 }), (4u, new uint[] { 12 }) }) });
|
||||
var (spells, sets) = PortalSpellBook.Parse(raw);
|
||||
return PortalSpellBook.FromParsed(spells, sets);
|
||||
}
|
||||
|
||||
private static void GearSpellTable()
|
||||
{
|
||||
byte[] raw = SpellTableBytes(TestSpells, new[] { (13u, new[] { (2u, new uint[] { 11 }), (4u, new uint[] { 12 }) }) });
|
||||
var (spells, sets) = PortalSpellBook.Parse(raw);
|
||||
Check(spells.Count == TestSpells.Length, $"spell table: every spell read ({spells.Count})");
|
||||
Check(spells[5].Name == "Legendary Slashing Bane" && spells[5].Category == 395 && spells[5].Power == 4,
|
||||
"spell table: name, family and power");
|
||||
Check(spells[5].IsItemTarget && !spells[3].IsItemTarget, "spell table: a bane is cast on an item, a ward on the character");
|
||||
Check(spells[1].IsEnchantment && !spells[9].IsEnchantment, "spell table: enchantments and projectiles told apart");
|
||||
Check(sets.Count == 1 && sets[13].Tiers.Count == 2 && sets[13].HighestTier == 4, "spell table: the equipment set and its tiers");
|
||||
|
||||
SpellSetDef d = sets[13];
|
||||
Check(d.SpellsAt(1).Length == 0, "set: below the first tier, no bonus");
|
||||
Check(d.SpellsAt(2).SequenceEqual(new uint[] { 11 }) && d.SpellsAt(3).SequenceEqual(new uint[] { 11 }), "set: a level between tiers takes the lower tier");
|
||||
Check(d.SpellsAt(9).SequenceEqual(new uint[] { 12 }) && d.TierAt(9) == 4, "set: a level past the top is capped at the highest tier");
|
||||
|
||||
var (cut, _) = PortalSpellBook.Parse(raw.Take(raw.Length / 2).ToArray());
|
||||
Check(cut.Count > 0 && cut.Count < TestSpells.Length, $"spell table: a cut-short file keeps what it read ({cut.Count})");
|
||||
}
|
||||
|
||||
/// <summary>The real client's table, when this machine has one (skipped otherwise).</summary>
|
||||
private static void GearRealDat()
|
||||
{
|
||||
const string path = @"C:\Turbine\Asheron's Call\client_portal.dat";
|
||||
if (!File.Exists(path)) { Console.WriteLine(" gear: no client_portal.dat here, real table check skipped"); return; }
|
||||
using var dat = new RynthCore.Plugin.RynthAi.Raycasting.DatDatabase();
|
||||
if (!dat.Open(path)) { Check(false, "real portal.dat opens"); return; }
|
||||
byte[]? raw = dat.GetFileData(PortalSpellBook.SpellTableFileId);
|
||||
Check(raw != null, "real portal.dat has the spell table");
|
||||
if (raw == null) return;
|
||||
var (spells, sets) = PortalSpellBook.Parse(raw);
|
||||
Check(spells.Count > 6000, $"real table: {spells.Count} spells");
|
||||
Check(spells.TryGetValue(6097, out PortalSpell bane) && bane.Name == "Legendary Slashing Bane" && bane.Category == 395 && bane.IsItemTarget,
|
||||
"real table: Legendary Slashing Bane is an item spell of family 395");
|
||||
Check(spells.TryGetValue(6082, out PortalSpell ward) && ward.Name == "Legendary Flame Ward" && ward.Category == 287 && !ward.IsItemTarget,
|
||||
"real table: Legendary Flame Ward is a character spell of family 287");
|
||||
Check(sets.Count > 100 && sets.TryGetValue(13, out SpellSetDef? s13) && s13.SpellsAt(3).Length > 0, $"real table: {sets.Count} equipment sets");
|
||||
Console.WriteLine($" gear: real portal.dat, {spells.Count} spells, {sets.Count} sets");
|
||||
}
|
||||
|
||||
private static void GearNamesAndMath()
|
||||
{
|
||||
Check(GearNames.FamilyLabel(403) == "Slash Ward", "family label: " + GearNames.FamilyLabel(403));
|
||||
Check(GearNames.FamilyLabel(395) == "Slash Resistance", "bane family label: " + GearNames.FamilyLabel(395));
|
||||
Check(GearNames.FamilyLabel(261) == "Strength Increase", "cantrip family label: " + GearNames.FamilyLabel(261));
|
||||
Check(GearNames.FamilyLabel(99_999) == "Family 99999" && GearNames.FamilyLabel(0) == "?", "an unknown family still shows its number");
|
||||
Check(GearNames.SetName(138) == "Paragon Missile" && GearNames.SetName(0) == "-" && GearNames.SetName(9_999) == "Set 9999", "set names");
|
||||
Check(GearNames.Pretty("ShimmeringShadowsSet") == "Shimmering Shadows Set" && GearNames.Pretty("PKDamage") == "PK Damage",
|
||||
"CamelCase to words: " + GearNames.Pretty("PKDamage"));
|
||||
|
||||
Check(GearMath.ItemLevel(50, 10, 20, 1) == 5, "item level: fixed cost per level");
|
||||
Check(GearMath.ItemLevel(70, 10, 20, 2) == 3, "item level: each level costs double (10 + 20 + 40)");
|
||||
Check(GearMath.ItemLevel(15, 10, 20, 3) == 1 && GearMath.ItemLevel(50, 10, 20, 3) == 4, "item level: fixed plus base");
|
||||
Check(GearMath.ItemLevel(1_000, 10, 20, 1) == 20, "item level: capped at the maximum");
|
||||
Check(GearMath.ItemLevel(1_000, 0, 20, 1) == 0, "item level: no base experience, no level");
|
||||
}
|
||||
|
||||
/// <summary>Worn pieces built by hand (the test spells above).</summary>
|
||||
private static List<GearPiece> TestPieces() => new()
|
||||
{
|
||||
new GearPiece { Id = 0x8000_0001, Name = "Chest", ItemType = GearAnalysis.ItemArmor, Equipped = true, Appraised = true,
|
||||
Inscribed = new uint[] { 2, 5 }, OnItem = new uint[] { 6 }, Ratings = new[] { (371, 3), (373, 2) } },
|
||||
new GearPiece { Id = 0x8000_0002, Name = "Ring", ItemType = GearAnalysis.ItemJewelry, Equipped = true, Appraised = true,
|
||||
Inscribed = new uint[] { 1, 8 }, SetId = 13, Ratings = new[] { (370, 4) } },
|
||||
new GearPiece { Id = 0x8000_0003, Name = "Bracelet", ItemType = GearAnalysis.ItemJewelry, Equipped = true, Appraised = true,
|
||||
Inscribed = new uint[] { 8, 9 }, SetId = 13 },
|
||||
new GearPiece { Id = 0x8000_0004, Name = "Fire Sword", ItemType = GearAnalysis.ItemMelee, Equipped = true, Appraised = true,
|
||||
Inscribed = new uint[] { 7, 10, 99_999 }, DamageType = 0x10, Ratings = new[] { (370, 5), (374, 2) } },
|
||||
new GearPiece { Id = 0x8000_0005, Name = "Unread Gloves", ItemType = GearAnalysis.ItemArmor, Equipped = true, Appraised = false },
|
||||
};
|
||||
|
||||
private static GearReport TestReport(GearScanner scanner)
|
||||
{
|
||||
var pieces = TestPieces();
|
||||
return GearAnalysis.Analyze(pieces, new uint[] { 3, 4, 2 }, scanner.Lookup,
|
||||
id => scanner.Book.TryGetSet((uint)id, out SpellSetDef d) ? d : null, "Tester", new DateTime(2026, 10, 19, 17, 0, 0));
|
||||
}
|
||||
|
||||
private static void GearOverlap()
|
||||
{
|
||||
var scanner = new GearScanner { Book = TestBook() };
|
||||
GearReport r = TestReport(scanner);
|
||||
|
||||
Check(r.Equipped == 5 && r.NotAppraised == 1, $"overlap: 5 worn, 1 not appraised ({r.NotAppraised})");
|
||||
Check(r.UnknownSpells == 1, $"overlap: the spell no table knows is counted ({r.UnknownSpells})");
|
||||
|
||||
OverlapRow? str = r.Rows.FirstOrDefault(x => x.Category == 261);
|
||||
Check(str != null && str.Kind == OverlapKind.Overlap && str.Winner.Spell.Id == 2 && str.Scope == "",
|
||||
"overlap: Major and Legendary Strength compete on the character, Legendary wins");
|
||||
Check(str != null && str.Summary.Contains("(beat)"), "overlap: the losing source is marked (beat): " + str?.Summary);
|
||||
|
||||
OverlapRow? will = r.Rows.FirstOrDefault(x => x.Category == 265);
|
||||
Check(will != null && will.Kind == OverlapKind.Duplicate && will.Summary.Contains("(extra)"),
|
||||
"duplicate: the same cantrip on the ring and the bracelet: " + will?.Summary);
|
||||
|
||||
OverlapRow? procs = r.Rows.FirstOrDefault(x => x.Category == 77);
|
||||
Check(procs != null && procs.Kind == OverlapKind.Stacks, "stacks: two projectiles of one family both work");
|
||||
|
||||
OverlapRow? bane = r.Rows.FirstOrDefault(x => x.Category == 395);
|
||||
Check(bane != null && bane.Kind == OverlapKind.Overlap && bane.Scope == "Chest" && bane.Winner.Spell.Id == 5,
|
||||
"per item: the chest's inscribed Legendary bane beats the Major bane cast on it");
|
||||
Check(r.Rows.Count(x => x.Category == 329) == 1 && r.Rows.First(x => x.Category == 329).Scope == "Fire Sword",
|
||||
"per item: a weapon spell's row is the weapon's");
|
||||
Check(r.Rows.First(x => x.Kind == OverlapKind.Overlap).Kind <= r.Rows.Last().Kind, "rows: overlap first, OK last");
|
||||
|
||||
ProtSummary p = r.Protection;
|
||||
ProtRow fire = p.Life.First(x => x.Element == "Fire");
|
||||
Check(fire.Tier == ProtTier.Legendary && fire.Winner == "Legendary Flame Ward" && fire.Beaten.Contains("Epic Flame Ward"),
|
||||
$"wards: Legendary Flame Ward wins over Epic ({fire.Tier}, beats {fire.Beaten})");
|
||||
ProtRow slash = p.Crit.First(x => x.Element == "Slashing");
|
||||
Check(slash.Tier == ProtTier.Legendary && slash.Source == "Chest", $"banes: the chest's Legendary Slashing Bane ({slash.Tier} from {slash.Source})");
|
||||
Check(p.LifeLegendary == 1 && p.CritLegendary == 1 && p.Life.Count(x => x.Missing) == 6 && p.LifeMissing.StartsWith("Slashing"),
|
||||
$"wards and banes: 1 + 1 Legendary, six life elements missing ({p.LifeMissing})");
|
||||
|
||||
Check(r.Sets.Count == 1 && r.Sets[0].Pieces == 2 && r.Sets[0].Spells.Count == 1 && r.Sets[0].Spells[0].Spell.Id == 11,
|
||||
"set: two pieces of set 13 give the tier-2 bonus");
|
||||
Check(r.Buffs.Count == 3 && r.Buffs.All(b => b.ItemName == "Tester"), "buffs: the character's enchantments, by name");
|
||||
Check(r.PieceSpells[0x8000_0001].Count == 3 && r.PieceSpells[0x8000_0001].Any(s => s.Layer == SpellLayer.OnItem),
|
||||
"pieces: inscribed and active-on-item spells listed per piece");
|
||||
|
||||
// A leveled set: its level is the sum of the pieces' item levels.
|
||||
var leveled = new List<GearPiece>
|
||||
{
|
||||
new() { Id = 1, Name = "A", SetId = 13, XpStyle = 1, BaseXp = 10, MaxLevel = 5, TotalXp = 30, Equipped = true },
|
||||
new() { Id = 2, Name = "B", SetId = 13, XpStyle = 1, BaseXp = 10, MaxLevel = 5, TotalXp = 20, Equipped = true },
|
||||
};
|
||||
var sets = GearAnalysis.SetBonuses(leveled, id => scanner.Book.TryGetSet((uint)id, out SpellSetDef d) ? d : null, scanner.Lookup);
|
||||
Check(sets.Count == 1 && sets[0].Level == 5 && sets[0].Tier == 4 && sets[0].Spells[0].Spell.Id == 12,
|
||||
$"leveled set: levels 3 + 2 reach tier 4 ({sets.FirstOrDefault()?.Level})");
|
||||
}
|
||||
|
||||
private static void GearRatings()
|
||||
{
|
||||
var pieces = TestPieces();
|
||||
pieces.Add(new GearPiece { Id = 0x8000_0010, Name = "Spare Paragon Bow", ItemType = GearAnalysis.ItemMissile, SetId = 138,
|
||||
MaxLevel = 50, BaseXp = 2_000_000_000, XpStyle = 1, TotalXp = 6_000_000_000, DamageType = 0x8 });
|
||||
pieces.Add(new GearPiece { Id = 0x8000_0011, Name = "Plain Cloak", ItemType = GearAnalysis.ItemClothing });
|
||||
|
||||
RatingsReport worn = GearAnalysis.Ratings(pieces, includePack: false, DateTime.Now);
|
||||
var wornRated = worn.RatedRows.ToList();
|
||||
Check(worn.Rows.All(x => x.Piece.Equipped) && wornRated.Count == 4 && wornRated.All(x => x.Piece.Name != "Unread Gloves"),
|
||||
$"ratings: worn items with a set or ratings rated, the plain gloves not ({wornRated.Count})");
|
||||
Check(worn.Rows.Any(x => x.Piece.Name == "Unread Gloves" && !x.Rated), "ratings: every worn wearable still gets a Mag-style line");
|
||||
Check(worn.WornTotals.Contains((370, 9)) && worn.WornTotals.Contains((371, 3)) && worn.WornTotals.Contains((374, 2)),
|
||||
"ratings: worn totals add up: " + string.Join(" ", worn.WornTotals));
|
||||
RatingRow sword = worn.Rows.First(x => x.Piece.Name == "Fire Sword");
|
||||
Check(sword.TypeLabel == "Weapon Fire" && sword.Stats.Contains("Damage 5"), $"ratings: a weapon's element and ratings ({sword.TypeLabel}: {sword.Stats})");
|
||||
|
||||
RatingsReport all = GearAnalysis.Ratings(pieces, includePack: true, DateTime.Now);
|
||||
RatingRow bow = all.Rows.First(x => x.Piece.Name == "Spare Paragon Bow");
|
||||
Check(bow.Paragon && bow.SetName == "Paragon Missile" && bow.Piece.Level == 3 && !bow.Piece.Equipped,
|
||||
$"ratings: a pack paragon bow, level {bow.Piece.Level}/50");
|
||||
Check(all.RatedRows.All(x => x.Piece.Name != "Plain Cloak"), "ratings: gear with no set, level or ratings isn't rated");
|
||||
Check(all.Rows.First().Piece.Equipped && !all.Rows.Last().Piece.Equipped, "ratings: worn first, then the packs");
|
||||
Check(!all.WornTotals.Any(t => t.Prop == 0), "ratings: pack items don't count in the worn totals");
|
||||
|
||||
GearT11();
|
||||
GearMagLines();
|
||||
}
|
||||
|
||||
/// <summary>The appraisal texts of T11 pieces, as ACECustom's AppraiseInfo builds them.</summary>
|
||||
private const string T11ArmorUse = "Modifiers:\n- Zone Locked (Power Reduced)\n- Damage Rating +52 [14-69]\n- All Attributes +40\n"
|
||||
+ "- Damage Resist +60\n- Fortify Vitals +18% vitals\n- Battle Mending\n- Armor Level +200\n\nUse this item to ...";
|
||||
private const string T11WeaponDesc = "Property Details:\n- Rend\n\nModifiers:\n- Crit Damage Rating +30\n- Pct HP Damage 50 (5 pct of max HP per hit)\n- Brand New Line +7\n\nA fine sword.";
|
||||
|
||||
private static void GearT11()
|
||||
{
|
||||
var (armor, locked) = T11Modifiers.Parse(T11ArmorUse, "");
|
||||
Check(locked && armor.Length == 6, $"T11: six modifier lines and the zone lock read from the Use text ({armor.Length})");
|
||||
Check(armor[0] == new GearModifier("Damage Rating", 52, true, "Damage Rating +52", 370), "T11: name, value, shown text (range dropped) and its rating");
|
||||
Check(armor.Any(m => m.Name == "Battle Mending" && !m.HasValue) && armor.Any(m => m.Name == "Fortify Vitals" && m.Value == 18),
|
||||
"T11: a line with no number, and a percent line");
|
||||
var (weapon, wlocked) = T11Modifiers.Parse("", T11WeaponDesc);
|
||||
Check(!wlocked && weapon.Length == 3 && weapon.All(m => m.Name != "Rend"), "T11: a weapon's lines from its long description, not its Property Details");
|
||||
Check(weapon[2].Name == "Brand New Line" && weapon[2].Value == 7 && weapon[2].RatingProp == 0, "T11: a line the catalog doesn't know keeps its name and number");
|
||||
Check(T11Modifiers.ParseLine("Max Health Pct +2%").Name == "Max Health Pct" && T11Modifiers.ParseLine("Max Health +40").RatingProp == 379,
|
||||
"T11: Max Health Pct isn't read as Max Health");
|
||||
Check(T11Modifiers.Parse("Spells: Legendary Strength", "").Lines.Length == 0, "T11: no Modifiers section, no lines (every other server)");
|
||||
|
||||
// The appraisal drops a line's rating from the item's ratings: the Ratings view adds it back once.
|
||||
var chest = new GearPiece { Id = 1, Name = "T11 Chest", ItemType = GearAnalysis.ItemArmor, Equipped = true,
|
||||
Ratings = new[] { (373, 4) }, Modifiers = armor, ZoneLocked = locked };
|
||||
var sword = new GearPiece { Id = 2, Name = "T11 Sword", ItemType = GearAnalysis.ItemMelee, Equipped = true, DamageType = 0x1,
|
||||
Ratings = new[] { (374, 30) }, Modifiers = weapon };
|
||||
var eff = GearAnalysis.EffectiveRatings(chest);
|
||||
Check(eff.Contains((370, 52)) && eff.Contains((371, 60)) && eff.Contains((373, 4)), "T11: the chest's line ratings added to its ratings");
|
||||
Check(GearAnalysis.EffectiveRatings(sword).Count(x => x.Prop == 374) == 1 && GearAnalysis.EffectiveRatings(sword).Contains((374, 30)),
|
||||
"T11: a rating the appraisal already sent isn't counted twice");
|
||||
|
||||
RatingsReport r = GearAnalysis.Ratings(new[] { chest, sword }, false, DateTime.Now);
|
||||
Check(r.WornTotals.Contains((370, 52)) && r.WornTotals.Contains((374, 30)) && r.T11Rows == 2, "T11: worn totals include the modifier ratings");
|
||||
var t11 = r.T11Totals.ToDictionary(t => t.Name, t => t.Value);
|
||||
Check(t11.TryGetValue("All Attributes", out string? aa) && aa == "+40" && t11["Battle Mending"] == "yes"
|
||||
&& t11["Fortify Vitals"] == "+18% (best)" && t11["Pct HP Damage"] == "5% of max HP per hit (best)",
|
||||
"T11 worn: summed lines, specials as the best one, flags as yes: " + string.Join("; ", r.T11Totals));
|
||||
Check(!t11.ContainsKey("Armor Level") && !t11.ContainsKey("Damage Rating"), "T11 worn: per-piece lines and ratings aren't in the modifier totals");
|
||||
Check(r.Rows.First(x => x.Piece.Name == "T11 Chest").T11.StartsWith("Damage Rating +52, All Attributes +40"), "T11: the row lists the lines as shown");
|
||||
}
|
||||
|
||||
private static void GearMagLines()
|
||||
{
|
||||
var scanner = new GearScanner { Book = TestBook() };
|
||||
// A loot crossbow: gold, Crossbow mastery, a set, imbue, tinks, damage, mods, cantrips and a low spell.
|
||||
var bow = new GearPiece
|
||||
{
|
||||
Id = 1, Name = "Heavy Crossbow", ItemType = GearAnalysis.ItemMissile, Equipped = true, Appraised = true,
|
||||
SetId = 13, Inscribed = new uint[] { 2, 1, 7 }, Ratings = new[] { (370, 3), (374, 2) },
|
||||
};
|
||||
bow.Ints[MagFormat.PropMaterial] = 60; bow.Ints[MagFormat.PropMastery] = 9; bow.Ints[MagFormat.PropImbued] = 1 | 512;
|
||||
bow.Ints[MagFormat.PropTinks] = 3; bow.Ints[MagFormat.PropDamage] = 47; bow.Ints[MagFormat.PropElementalBonus] = 12;
|
||||
bow.Ints[MagFormat.PropWieldRequirement] = 7; bow.Ints[MagFormat.PropWieldSkill] = 1; bow.Ints[MagFormat.PropWieldDifficulty] = 180;
|
||||
bow.Ints[MagFormat.PropDifficulty] = 300; bow.Ints[MagFormat.PropWorkmanship] = 9; bow.Ints[MagFormat.PropValue] = 12345; bow.Ints[MagFormat.PropBurden] = 50;
|
||||
bow.Floats[MagFormat.FloatVariance] = 0.25; bow.Floats[MagFormat.FloatDamageMod] = 1.2; bow.Floats[MagFormat.FloatOffense] = 1.05;
|
||||
bow.Floats[MagFormat.FloatMeleeDefense] = 1.1;
|
||||
string line = MagFormat.Describe(bow, scanner.Lookup, GearAnalysis.EffectiveRatings(bow));
|
||||
Check(line.StartsWith("Gold Heavy Crossbow (Crossbow), Set 13") || line.StartsWith("Gold Heavy Crossbow (Crossbow), "),
|
||||
"Mag: material, name and mastery first: " + line);
|
||||
Check(line.Contains(", CS FireRend, Tinks 3, 35.25-47, +12, +20%, +5%a, 10%md"), "Mag: imbues, tinks, damage range and mods in Mag's order: " + line);
|
||||
Check(line.Contains("Legendary Strength") && line.Contains("Major Strength") && line.Contains("Legendary Defender"), "Mag: the cantrips shown");
|
||||
Check(line.Contains(", Wield Lvl 180, Diff 300, Craft 9, Value 12,345, BU 50, [D 3, CD 2]"), "Mag: requirements, value, burden and the rating cluster: " + line);
|
||||
|
||||
// Mag's filter: a level 7 spell (power 300) and a level 1-6 spell are hidden on loot.
|
||||
var buffs = new GearPiece { Id = 2, Name = "Ring", ItemType = GearAnalysis.ItemJewelry, Inscribed = new uint[] { 5, 2 } };
|
||||
buffs.Ints[MagFormat.PropMaterial] = 60;
|
||||
var shown = MagFormat.ShownSpells(buffs, id => id == 5 ? new SpellMeta(5, "Strength Self VI", 1, 250, true, false, true) : scanner.Lookup(id));
|
||||
Check(shown.SequenceEqual(new[] { "Legendary Strength" }), "Mag filter: a VI spell hidden on loot: " + string.Join(", ", shown));
|
||||
buffs.Ints.Remove(MagFormat.PropMaterial);
|
||||
shown = MagFormat.ShownSpells(buffs, id => id == 5 ? new SpellMeta(5, "Strength Self VI", 1, 250, true, false, true) : scanner.Lookup(id));
|
||||
Check(shown.Count == 2, "Mag filter: an item that isn't loot (no material) shows every spell");
|
||||
|
||||
// Unenchantable armour: banes shown and the protection list.
|
||||
var armor = new GearPiece { Id = 3, Name = "Chest", ItemType = GearAnalysis.ItemArmor, Inscribed = new uint[] { 5 },
|
||||
Modifiers = T11Modifiers.Parse(T11ArmorUse, "").Lines, ZoneLocked = true };
|
||||
armor.Ints[MagFormat.PropMaterial] = 60; armor.Ints[MagFormat.PropResistMagic] = 9999; armor.Ints[MagFormat.PropArmorLevel] = 600;
|
||||
armor.Floats[MagFormat.FloatSlashProt] = 1.4; armor.Floats[MagFormat.FloatPierceProt] = 1.4; armor.Floats[MagFormat.FloatBludgeonProt] = 1.2;
|
||||
armor.Floats[MagFormat.FloatColdProt] = 1; armor.Floats[MagFormat.FloatFireProt] = 1; armor.Floats[MagFormat.FloatAcidProt] = 1; armor.Floats[MagFormat.FloatLightningProt] = 1;
|
||||
string aline = MagFormat.Describe(armor, scanner.Lookup, GearAnalysis.EffectiveRatings(armor));
|
||||
Check(aline.Contains(", AL 600") && aline.Contains("Legendary Slashing Bane") && aline.Contains("[1.4/1.4/1.2/1.0/1.0/1.0/1.0]"),
|
||||
"Mag: unenchantable armour shows its bane and protections: " + aline);
|
||||
Check(aline.Contains("[D 52, DR 60]") && aline.Contains(", T11 [Damage Rating +52, All Attributes +40") && aline.EndsWith("(zone locked)"),
|
||||
"Mag: T11 ratings in the cluster, the modifier lines and the lock at the end: " + aline);
|
||||
}
|
||||
|
||||
private static void GearPages()
|
||||
{
|
||||
OracleContext c = Context();
|
||||
var view = new OracleView(c);
|
||||
var host = new UiHost();
|
||||
UiWindow main = host.Add(new UiWindow("RynthOracle/Oracle", "Oracle") { Visible = true, DefaultWidth = 700, DefaultHeight = 860 });
|
||||
c.Server.Force("", "");
|
||||
Check(view.VisibleTabs().Contains(OracleView.TabGear), "the Gear tab is on every server (here: retail)");
|
||||
c.Settings.TabName = OracleView.TabGear;
|
||||
|
||||
// Before any Check.
|
||||
c.Settings.GearView = OracleView.GearOverlap;
|
||||
main.Begin(); view.Draw(main); main.End();
|
||||
ParseAll(host, "gear overlap, empty", out int emptyOps);
|
||||
Check(Encoding.UTF8.GetString(main.Body).Contains("Press Check"), "gear: says to press Check before the first one");
|
||||
main.MarkSubmitted(true);
|
||||
|
||||
var scanner = new GearScanner { Book = TestBook() };
|
||||
c.Gear.Book = scanner.Book;
|
||||
c.Gear.UseReports(TestReport(scanner), GearAnalysis.Ratings(TestPieces(), true, DateTime.Now));
|
||||
|
||||
main.Begin(); view.Draw(main); main.End();
|
||||
ParseAll(host, "gear overlap", out int ops);
|
||||
string body = Encoding.UTF8.GetString(main.Body);
|
||||
Check(ops > 20 && ops < 1400, $"gear overlap: {ops} ops");
|
||||
Check(body.Contains("Legendary Flame Ward") && body.Contains("MISSING") && body.Contains("Duplicate - the same spell"),
|
||||
"gear overlap: wards, a missing element and the duplicate section");
|
||||
Check(body.Contains("Set bonuses") && body.Contains("not appraised"), "gear overlap: set bonuses and the unread piece");
|
||||
Console.WriteLine($" gear overlap: {ops} ops, {main.Body.Length} bytes");
|
||||
main.MarkSubmitted(true);
|
||||
|
||||
c.Settings.GearHideOverlap = true;
|
||||
main.Begin(); view.Draw(main); main.End();
|
||||
ParseAll(host, "gear overlap hidden", out _);
|
||||
Check(!Encoding.UTF8.GetString(main.Body).Contains("Overlap - highest power wins"), "gear: Hide overlap hides the overlap rows");
|
||||
main.MarkSubmitted(true);
|
||||
|
||||
c.Settings.GearView = OracleView.GearRatings;
|
||||
c.Settings.GearRatingsMag = false;
|
||||
main.Begin(); view.Draw(main); main.End();
|
||||
ParseAll(host, "gear ratings", out int rops);
|
||||
string rbody = Encoding.UTF8.GetString(main.Body);
|
||||
Check(rops > 10 && rops < 1400, $"gear ratings (columns): {rops} ops");
|
||||
Check(rbody.Contains("Worn totals") && rbody.Contains("Fire Sword") && rbody.Contains("Include pack items"),
|
||||
"gear ratings: totals, rows and the pack option");
|
||||
main.MarkSubmitted(true);
|
||||
|
||||
// Mag-style (the default): a Mag-Tools line per item, T11 rows included.
|
||||
c.Settings.GearRatingsMag = true;
|
||||
var t11 = new GearPiece { Id = 9, Name = "T11 Chest", ItemType = GearAnalysis.ItemArmor, Equipped = true, Appraised = true,
|
||||
Modifiers = T11Modifiers.Parse(T11ArmorUse, "").Lines, ZoneLocked = true };
|
||||
var items = TestPieces();
|
||||
items.Add(t11);
|
||||
c.Gear.UseReports(TestReport(scanner), GearAnalysis.Ratings(items, true, DateTime.Now, scanner.Lookup));
|
||||
main.Begin(); view.Draw(main); main.End();
|
||||
ParseAll(host, "gear ratings mag", out int mops);
|
||||
string mbody = Encoding.UTF8.GetString(main.Body);
|
||||
Check(mops > 10 && mops < 1400, $"gear ratings (Mag-style): {mops} ops");
|
||||
Check(mbody.Contains("Fire Sword") && mbody.Contains("[D 5, CD 2]") && mbody.Contains("T11 [Damage Rating +52") && mbody.Contains("T11 worn:"),
|
||||
"gear ratings Mag-style: lines with ratings, T11 modifiers and the T11 totals");
|
||||
Console.WriteLine($" gear ratings Mag-style: {mops} ops");
|
||||
main.MarkSubmitted(true);
|
||||
c.Settings.GearView = OracleView.GearOverlap;
|
||||
c.Settings.GearHideOverlap = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
220
Tools/RynthOracle.Tests/KillTaskTests.cs
Normal file
220
Tools/RynthOracle.Tests/KillTaskTests.cs
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using RynthCore.Plugin.RynthOracle;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
using RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// The Quests tab's Kill Tasks list (2026-11-21, Silentkelpie: "add a tab to track kill tasks ... track progress
|
||||
// by looking at quests in the client"), and the wiki stamps cut to their flag ("X on first completion").
|
||||
// The quests are the wiki guide's own (wiki-quests.json, 2026-11-21), as saved before the stamps were cut.
|
||||
internal static partial class Program
|
||||
{
|
||||
private const string KillGuideJson = """
|
||||
{"schema":1,"source":"api","updated":"2026-11-21T13:52:54Z","quests":[
|
||||
{"title":"Drudge Lurker Kill Task","url":"u","rev":492370,"type":"Solo","killTask":"Yes","startsWith":"Jarvis Hammerstone",
|
||||
"startsAt":"25.6N, 49.4E in Cragstone","repeat":"20 Hours","repeatSec":72000,"qb":0,"steps":[
|
||||
{"text":"Talk with Jarvis Hammerstone.","stamps":["DrudgeKillTasks_Start","KillTaskDrudgeLurkers_0507"]},
|
||||
{"text":"Kill 100 Drudge Lurkers.","notes":["First Kill:"],"stamps":["KillTaskDrudgeLurkers_0507 on first completion"]},
|
||||
{"text":"Return to Jarvis Hammerstone for your rewards.","stamps":["KillTaskDrudgeLurkersWait_0507"]}]},
|
||||
{"title":"Kill: Rynthid Minions","url":"u","rev":494756,"level":"180","type":"Solo","killTask":"Yes","startsWith":"Marcus",
|
||||
"repeat":"20 Hours","repeatSec":72000,"qb":0,"steps":[
|
||||
{"text":"Talk to Marcus.","stamps":["KillTaskRynthidMinions0813"]},
|
||||
{"text":"Head to the Rynthid Infested Plains and kill 25 Rynthid Minions.","stamps":["KillTaskRynthidMinions0813 on first completion"]},
|
||||
{"text":"Return to Marcus for your rewards.","stamps":["KillTaskRynthidMinionsCompleted0813"]}]},
|
||||
{"title":"Void Lord Kill Task","url":"u","rev":1,"type":"Solo","killTask":"Yes","repeat":"20 Hours","repeatSec":72000,"qb":0,"steps":[
|
||||
{"text":"Kill 50 Void Lords."},{"text":"Return for your reward."}]},
|
||||
{"title":"Crown the Mad","url":"u","rev":2,"type":"Solo","killTask":"False","repeatSec":0,"qb":0,"steps":[
|
||||
{"text":"Find the token.","stamps":["You've stamped TokenOfTheMadFound!"]}]},
|
||||
{"title":"Mistreated Virindi","url":"u","rev":3,"type":"Solo","repeatSec":72000,"qb":0,"steps":[{"text":"Talk.","stamps":["Sneaky_Virindi"]}]}
|
||||
]}
|
||||
""";
|
||||
|
||||
// The Stamps tab from the wiki's Dynamic Stamps page (2026-11-21, Silentkelpie: "the dynamic stamp tab should be
|
||||
// using this tab https://www.leaftidewiki.com/Dynamic_Stamps"). The page as it was that day, cut to a sample.
|
||||
private static void WikiDynamicStamps()
|
||||
{
|
||||
List<GuideDynStamp> rows = WikiQuestParser.ParseDynamicStamps(TestText("TestWiki.dynamic-stamps.txt"));
|
||||
Check(rows.Count == 11, $"dyn page: every stamped row once, not the intro's, NO STAMP rows or the unsorted list ({rows.Count})");
|
||||
GuideDynStamp hiyp = rows[0];
|
||||
Check(hiyp.Area == "Arwic" && hiyp.Place == "Arwic" && hiyp.Npc == "Hiyp the Toad" && hiyp.Coords == "33.6N, 56.8E"
|
||||
&& hiyp.Stamp == "Dynamic_1_8M6jL^Bwr3S$p" && hiyp.Reward == "Hearty Rabbit Noodle", "dyn page: a row with one cell per line");
|
||||
Check(rows[1].Coords == "33.3N, 56.5E" && rows[2].Stamp == "Dynamic_1_w", "dyn page: a tab in a cell, a space in the stamp");
|
||||
Check(rows.Any(r => r.Npc == "Gustuv Lansdown" && r.Note == "Mill with Aug NPCs" && r.Coords == "24.9N, 48.5E"), "dyn page: notes and coordinates kept");
|
||||
GuideDynStamp saelar = rows.Single(r => r.Npc == "Saelar's Apprentice");
|
||||
Check(saelar.Area == "Samsur" && saelar.Coords == "2.5S, 16.4E" && saelar.Reward == "Renegade Ukira of the Mountains" && saelar.Note == "Mnemosyne Collection Site",
|
||||
"dyn page: a row on one line split by ||");
|
||||
Check(rows.Single(r => r.Npc == "Drogur").Area == "Kor-Gursha / Bur" && !rows.Any(r => r.Npc == "Rheegur"), "dyn page: two links in a heading; NO STAMP left out");
|
||||
Check(rows.Single(r => r.Npc == "Gear Knight Recruiter").Area == "Gear Knight Camp, Inner Sea", "dyn page: a heading's shown text");
|
||||
Check(rows.Count(r => r.Stamp == "Dynamic_1_lm9d1e7kD") == 1 && rows.Single(r => r.Stamp == "Dynamic_1_lm9d1e7kD").Npc == "Robert Crow", "dyn page: a stamp twice, first row wins");
|
||||
GuideDynStamp abbess = rows.Single(r => r.Npc == "Abbess Zik'Lir");
|
||||
Check(abbess.Area == "Miscellaneous" && abbess.Place == "Ithaenc" && abbess.Reward == "Hearty Fish Noodle" && abbess.Note == "", "dyn page: miscellaneous, its notes are the place");
|
||||
Check(rows.Single(r => r.Npc == "Arikas, Warden of Knorr").Place == "Seat of Knorr", "dyn page: a linked place");
|
||||
Check(!rows.Any(r => r.Stamp.StartsWith("Dynamic_1_0eHSd9aS", StringComparison.Ordinal)), "dyn page: the unsorted list is left out");
|
||||
Check(WikiQuestParser.ParseDynamicStamps("").Count == 0 && WikiQuestParser.ParseDynamicStamps("no tables").Count == 0, "dyn page: nothing in, nothing out");
|
||||
|
||||
// In the guide file and in the Stamps tab.
|
||||
var g = new QuestGuide { DynStamps = rows, DynStampsRev = 77 };
|
||||
QuestGuide back = QuestGuide.Parse(g.ToJson());
|
||||
Check(back.DynStamps.Count == 11 && back.DynStampsRev == 77 && back.DynStamps[0].Coords == "33.6N, 56.8E", "guide json: the Dynamic stamps round-trip");
|
||||
int sheet = DynamicStampList.All.Count;
|
||||
Check(DynamicStampList.Source == "sheet" && sheet > 200, "stamps: the sheet until the wiki's page is read");
|
||||
DynamicStampList.UseWiki(back.DynStamps);
|
||||
Check(DynamicStampList.Source == "wiki" && DynamicStampList.All.Count == 11, "stamps: the wiki's page replaces the sheet");
|
||||
Check(DynamicStampList.Areas.SequenceEqual(new[] { "Arwic", "Cragstone", "Samsur", "Kor-Gursha / Bur", "Gear Knight Camp, Inner Sea", "Miscellaneous" }),
|
||||
"stamps: the wiki's places, in page order");
|
||||
DynamicStamp h = DynamicStampList.All[0];
|
||||
Check(h.Stamp == "dynamic_1_8m6jl^bwr3s$p" && h.NavCandidates()[0] == "33.6N, 56.8E", "stamps: lower-case flag, RynthNav goes to the coordinates first");
|
||||
OracleContext c = On("ilt");
|
||||
c.Flags.OnChatLine("Dynamic_1_8M6jL^Bwr3S$p - 1 solves (1719432000)\"x\" -1 0", c.NowMs);
|
||||
c.Flags.Tick(c.NowMs + 5_000);
|
||||
Check(h.Have(c.Flags), "stamps: a wiki stamp matches /myquests");
|
||||
DynamicStampList.UseWiki(null);
|
||||
Check(DynamicStampList.Source == "sheet" && DynamicStampList.All.Count == sheet, "stamps: back to the sheet when the guide goes");
|
||||
|
||||
// The client takes the guide's stamps when it reads the file.
|
||||
string file = Path.Combine(Path.GetTempPath(), "RynthOracleTests-" + Guid.NewGuid().ToString("N") + "-dyn.json");
|
||||
File.WriteAllText(file, g.ToJson());
|
||||
c.Guide.Take("{\"path\":" + System.Text.Json.JsonSerializer.Serialize(file) + ",\"revision\":1,\"count\":0,\"login\":true,\"running\":false,\"status\":\"ok\"}");
|
||||
Check(DynamicStampList.Source == "wiki" && DynamicStampList.All.Count == 11, "stamps: the guide client hands them over");
|
||||
var view = new OracleView(c);
|
||||
var host = new UiHost();
|
||||
UiWindow main = host.Add(new UiWindow("RynthOracle/Oracle", "Oracle") { Visible = true });
|
||||
c.Settings.QuestGuideView = true;
|
||||
c.Settings.TabName = OracleView.TabQuests;
|
||||
view.ShowGuide(GuideTab.Stamps, "a:Arwic");
|
||||
string body = Frame(host, main, view, "stamps from the wiki");
|
||||
Check(body.Contains("Stamps: the wiki's Dynamic Stamps page (11 stamps in 6 places)") && body.Contains("###g.r.a:Arwic") && body.Contains("1 / 3"),
|
||||
"stamps tab: the wiki's places, with what you hold");
|
||||
Check(body.Contains("Hiyp the Toad - Arwic"), "stamps tab: the opened place lists its NPCs");
|
||||
c.Guide.Clear();
|
||||
Check(DynamicStampList.Source == "sheet", "stamps: a cleared guide goes back to the sheet");
|
||||
try { File.Delete(file); } catch { }
|
||||
}
|
||||
|
||||
private static void KillTasks()
|
||||
{
|
||||
// ── Stamps cut to the flag ───────────────────────────────────────
|
||||
Check(GuideStamp.Clean("KillTaskDrudgeLurkers_0507 on first completion") == "KillTaskDrudgeLurkers_0507", "stamp clean: 'on first completion' cut");
|
||||
Check(GuideStamp.Clean("You've stamped GleeqeoStart!") == "GleeqeoStart" && GuideStamp.Clean("stamped BackToTheFuture!") == "BackToTheFuture",
|
||||
"stamp clean: the server's line copied into the wiki");
|
||||
Check(GuideStamp.Clean("Shiny Red Stone Found") == "Shiny Red Stone Found" && GuideStamp.Clean("Sneaky_Virindi") == "Sneaky_Virindi",
|
||||
"stamp clean: plain stamps left alone");
|
||||
Check(GuideStamp.Clean("Bonus_Flag (after the boss)") == "Bonus_Flag", "stamp clean: a note in brackets cut");
|
||||
Check(WikiQuestParser.Version >= 2, "parser: version raised for the cut stamps");
|
||||
|
||||
QuestGuide g = QuestGuide.Parse(KillGuideJson);
|
||||
Check(g.Parser == 1, "guide json: a guide saved before the version reads as reader 1 (read again whole)");
|
||||
GuideQuest drudge = g.Find("Drudge Lurker Kill Task")!;
|
||||
Check(drudge.Steps[1].Stamps.SequenceEqual(new[] { "KillTaskDrudgeLurkers_0507" }), "guide json: an old guide's stamps are cut on reading");
|
||||
Check(drudge.AllStamps().Count() == 3, "guide json: the counter stamp counted once");
|
||||
Check(g.Find("Crown the Mad")!.Steps[0].Stamps[0] == "TokenOfTheMadFound", "guide json: 'You've stamped X!' read as X");
|
||||
var round = QuestGuide.Parse(new QuestGuide { Parser = WikiQuestParser.Version, Quests = g.Quests }.ToJson());
|
||||
Check(round.Parser == WikiQuestParser.Version, "guide json: the reader's version round-trips");
|
||||
GuideQuest wiki = WikiQuestParser.Parse("X Kill Task", "{{Quest Summary|Kill Task=Yes}}\n== Walkthrough ==\n# Kill 10 X.\n#* {{stamped|KillTaskX_01 on first completion}}\n");
|
||||
Check(wiki.AllStamps().SequenceEqual(new[] { "KillTaskX_01" }), "parser: {{stamped|X on first completion}} is X");
|
||||
|
||||
// ── Which quests are kill tasks, the goal, the creature ──────────
|
||||
Check(drudge.IsKillTask && g.Find("Void Lord Kill Task")!.IsKillTask && !g.Find("Crown the Mad")!.IsKillTask && !g.Find("Mistreated Virindi")!.IsKillTask,
|
||||
"kill task: the box's Yes; False is not one");
|
||||
Check(new GuideQuest { Title = "Kill: Rynthid Slayers" }.IsKillTask && new GuideQuest { Title = "Dave and Buster's Killtask" }.IsKillTask,
|
||||
"kill task: by the title when the box doesn't say");
|
||||
Check(drudge.KillTarget == 100 && g.Find("Kill: Rynthid Minions")!.KillTarget == 25, "kill task: the goal from the walkthrough");
|
||||
Check(drudge.KillCreatureKey == "drudgelurker" && g.Find("Kill: Rynthid Minions")!.KillCreatureKey == "rynthidminion", "kill task: the creature key");
|
||||
|
||||
// ── Kill lines in chat ───────────────────────────────────────────
|
||||
var kc = new KillChat();
|
||||
DateTime t = DateTime.UtcNow;
|
||||
Check(kc.OnChatLine("You have killed 27 Empyrean Handlers! You must kill 250 to complete your task.", t), "kill chat: Kelpie's line read");
|
||||
Check(kc.For("empyreanhandler") is KillCount e && e.Kills == 27 && e.Goal == 250, "kill chat: count and goal kept by creature");
|
||||
Check(kc.OnChatLine("You have killed some Coral Golem Viceroys", t) && kc.For("coralgolemviceroy") is KillCount cv && cv.Kills == 0,
|
||||
"kill chat: 'some X' marks the creature");
|
||||
Check(!kc.OnChatLine("You have killed the Olthoi Queen with a mighty blow.", t) || kc.ByCreature.Count == 3, "kill chat: other lines change little");
|
||||
Check(!kc.OnChatLine("Jarvis tells you, \"Kill 100 drudges\"", t), "kill chat: not a kill line");
|
||||
|
||||
// ── The tab ──────────────────────────────────────────────────────
|
||||
string file = Path.Combine(Path.GetTempPath(), "RynthOracleTests-" + Guid.NewGuid().ToString("N") + "-kills.json");
|
||||
File.WriteAllText(file, KillGuideJson);
|
||||
OracleContext c = On("ilt");
|
||||
c.UtcNow = t;
|
||||
var view = new OracleView(c);
|
||||
var host = new UiHost();
|
||||
UiWindow main = host.Add(new UiWindow("RynthOracle/Oracle", "Oracle") { Visible = true });
|
||||
Check(view.GuideTabs().Contains(GuideTab.KillTasks) && view.GuideTabs().Count == 10, "kill tab: on Infinite Leaftide");
|
||||
Check(new OracleView(On("")).GuideTabs().Contains(GuideTab.KillTasks), "kill tab: on every server (2026-11-21)");
|
||||
c.Settings.QuestGuideView = true;
|
||||
c.Settings.TabName = OracleView.TabQuests;
|
||||
c.Guide.Take("{\"path\":" + System.Text.Json.JsonSerializer.Serialize(file) + ",\"revision\":1,\"count\":5,\"login\":true,\"running\":false,\"status\":\"ok\"}");
|
||||
view.ShowGuide(GuideTab.KillTasks, "w:Drudge Lurker Kill Task");
|
||||
Check(view.KillTasksShowing, "kill tab: says it is showing");
|
||||
|
||||
string body = Frame(host, main, view, "kill tasks, nothing read");
|
||||
Check(body.Contains("###g.r.w:Drudge Lurker Kill Task") && body.Contains("###g.r.w:Void Lord Kill Task") && body.Contains("###g.r.w:Kill: Rynthid Minions"),
|
||||
"kill tab: the wiki's kill tasks");
|
||||
Check(!body.Contains("###g.r.w:Mistreated Virindi") && !body.Contains("###g.r.w:Crown the Mad"), "kill tab: only kill tasks");
|
||||
Check(body.Contains("0 / 100") && body.Contains("0 / 25"), "kill tab: not started shows the goal");
|
||||
Check(body.Contains("Kills: not started (the task is 100 kills)"), "kill tab: the opened task's line");
|
||||
// 2026-11-22: each kill task says first time or done before.
|
||||
Check(body.Contains("(first time)") && body.Contains("First time: no stamp or flag of this kill task held yet.") && !body.Contains("Done before:"),
|
||||
"kill tab: nothing held: every task is the first time");
|
||||
|
||||
// /myquests: the counter flag at 37 of 100.
|
||||
long at = new DateTimeOffset(t.AddMinutes(-30)).ToUnixTimeSeconds();
|
||||
string[] flags =
|
||||
{
|
||||
$"drudgekilltasks_start - 1 solves ({at})\"x\" -1 0",
|
||||
$"killtaskdrudgelurkers_0507 - 37 solves ({at})\"Drudge Lurkers\" 100 0",
|
||||
$"killtaskrynthidminions0813 - 25 solves ({at})\"x\" 25 0",
|
||||
$"killtaskoldtumeroks_0101 - 12 solves ({at})\"Tumeroks\" 40 0",
|
||||
$"voidlordkilltask - 3 solves ({at})\"x\" 50 0",
|
||||
};
|
||||
void Read(params string[] lines)
|
||||
{
|
||||
foreach (string l in lines) c.Flags.OnChatLine(l, c.NowMs);
|
||||
c.Flags.Tick(c.NowMs + 5_000);
|
||||
}
|
||||
Read(flags);
|
||||
body = Frame(host, main, view, "kill tasks, flags read");
|
||||
Check(body.Contains("37 / 100") && body.Contains("Kills: 37 / 100 (63 left)"), "kill tab: the counter flag's kills");
|
||||
Check(body.Contains("from /myquests: killtaskdrudgelurkers_0507 (37 of 100)"), "kill tab: says where the count came from");
|
||||
Check(body.Contains("Turn in"), "kill tab: all 25 minions killed: turn in");
|
||||
Check(body.Contains("3 / 50"), "kill tab: a task the wiki lists no stamps for finds its counter by the creature");
|
||||
Check(body.Contains("###g.r.k:killtaskoldtumeroks_0101") && body.Contains("12 / 40"), "kill tab: a counter no wiki task names is listed too");
|
||||
Check(body.Contains("Kill tasks: 2 counting, 1 to turn in"), "kill tab: the summary line");
|
||||
Check(body.Contains("(first time)") && !body.Contains("(done before)"), "kill tab: counting and the start flag don't make it done before");
|
||||
int iTurn = body.IndexOf("###g.r.w:Kill: Rynthid Minions", StringComparison.Ordinal), iCount = body.IndexOf("###g.r.w:Drudge Lurker Kill Task", StringComparison.Ordinal);
|
||||
Check(iTurn >= 0 && iCount > iTurn, "kill tab: to turn in first, then counting");
|
||||
|
||||
// A kill line after the read moves the count at once.
|
||||
Check(c.Kills.OnChatLine("You have killed 38 Drudge Lurkers! You must kill 100 to complete your task.", t.AddMinutes(1)), "kill chat: a Drudge Lurker");
|
||||
body = Frame(host, main, view, "kill tasks, a kill");
|
||||
Check(body.Contains("38 / 100") && body.Contains("from the last kill line in chat"), "kill tab: the chat count wins over an older read");
|
||||
|
||||
// Turned in: the wait flag on its timer.
|
||||
long now = new DateTimeOffset(t).ToUnixTimeSeconds();
|
||||
Read(flags.Append($"killtaskrynthidminionscompleted0813 - 1 solves ({now})\"x\" -1 72000").ToArray());
|
||||
body = Frame(host, main, view, "kill tasks, turned in");
|
||||
Check(body.Contains("Done 20h") || body.Contains("Done 19h 59m"), "kill tab: a turned-in task waits on its timer");
|
||||
Check(body.Contains("Done before: a stamp or flag of this kill task is held"), "kill tab: a turned-in task is done before");
|
||||
|
||||
// Hide collected leaves the waiting one out.
|
||||
c.Settings.GuideHideCollected = true;
|
||||
body = Frame(host, main, view, "kill tasks, hide collected");
|
||||
Check(!body.Contains("###g.r.w:Kill: Rynthid Minions") && body.Contains("###g.r.w:Drudge Lurker Kill Task"), "kill tab: hide collected");
|
||||
c.Settings.GuideHideCollected = false;
|
||||
|
||||
// The wiki's Kill Tasks category marks a page whose box says nothing.
|
||||
var g2 = new QuestGuide { KillTasks = { "Weeding of the Deru Tree" } };
|
||||
Check(g2.IsKillTask(new GuideQuest { Title = "Weeding of the Deru Tree" }) && !g2.IsKillTask(new GuideQuest { Title = "Mistreated Virindi" }),
|
||||
"kill task: the wiki's Kill Tasks category");
|
||||
Check(QuestGuide.Parse(g2.ToJson()).KillTasks.SequenceEqual(new[] { "Weeding of the Deru Tree" }), "guide json: the kill task list round-trips");
|
||||
|
||||
Check(OracleView.FlagLabel("KillTaskDrudgeLurkers_0507") == "Kill Task Drudge Lurkers 0507", "kill tab: a flag's label");
|
||||
try { File.Delete(file); } catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -265,9 +265,21 @@ namespace RynthOracle.Tests
|
|||
Check(Shown(body) == leg + mrk, $"sort {sort} keeps every row ({Shown(body)})");
|
||||
}
|
||||
|
||||
// Infinite Leaftide's stamps and guardians are RynthILT's own page (2026-10-21): the list keeps the
|
||||
// same three kinds on every server, and nothing of theirs is drawn.
|
||||
Check(view.AvailableKinds().Count == 3 && Enum.GetValues<QuestKind>().Length == 3, "three kinds of row, on every server");
|
||||
// Infinite Leaftide's stamps and guardians: rows only while RynthCore's active server is "ilt".
|
||||
Check(view.AvailableKinds().Count == 3, "three kinds of row off Infinite Leaftide");
|
||||
c.Server.Force("ilt", "InfiniteLeaftide", "RynthILT");
|
||||
Check(view.AvailableKinds().SequenceEqual(new[] { QuestKind.Quest, QuestKind.Legendary, QuestKind.Marker, QuestKind.Dynamic, QuestKind.Guardian }),
|
||||
"ilt: quests, Legendary, markers, Dynamic Stamps and guardians");
|
||||
Tick(host, main, "q.trackers", true);
|
||||
body = Frame(host, main, view, "Quests, ilt trackers");
|
||||
int dyn = DynamicStampList.All.Count;
|
||||
Check(dyn > 200 && Shown(body) == leg + mrk + dyn, $"ilt: Trackers only lists the {dyn} stamps too ({Shown(body)} shown)");
|
||||
Check(body.Contains("listed Dynamic stamps") && body.Contains("Temple guardians") && body.Contains("DYN"),
|
||||
"ilt: the stamps' progress, the guardians' status and DYN rows");
|
||||
Tick(host, main, "q.trackers", false);
|
||||
c.Server.Force("", "Coldeve");
|
||||
body = Frame(host, main, view, "Quests, back off ilt");
|
||||
Check(!body.Contains("Dynamic stamps") && !body.Contains("DYN") && Shown(body) == quests + leg + mrk, "off ilt again: no stamp rows or status");
|
||||
|
||||
// A saved tab name of an old tab opens Quests; the Markers / Legendary / Dynamic Stamps / Pet Breeding tabs are gone.
|
||||
foreach (string old in new[] { "Markers", "Dynamic Stamps", "Pet Breeding" })
|
||||
|
|
@ -280,6 +292,42 @@ namespace RynthOracle.Tests
|
|||
"no separate tracker tabs, no Pet Breeding: " + string.Join(",", tabs));
|
||||
}
|
||||
|
||||
/// <summary>The Quests list's columns follow the window's width (the engine's Geometry events).</summary>
|
||||
private static void QuestColumnsFollowWidth()
|
||||
{
|
||||
// Upstream's column scaling (5c51ce6, 2026-10): a 500-wide window lays out too, and the name gets at
|
||||
// most half the room, so the Ready column stays near it. These checks follow that rule now.
|
||||
Check(QuestColumns.For(0f) == QuestColumns.Fixed && QuestColumns.For(float.NaN) == QuestColumns.Fixed && QuestColumns.For(300f) == QuestColumns.Fixed,
|
||||
"columns: no width (or a narrow window) is the old fixed layout");
|
||||
QuestColumns wide = QuestColumns.For(1200f);
|
||||
float roomAfterLeft = 1200f - 34f - QuestColumns.Fixed.Label - 8f;
|
||||
Check(wide.LabelWidth > QuestColumns.Fixed.LabelWidth * 1.3f && wide.LabelWidth <= roomAfterLeft * 0.5f + 0.5f && wide.LabelChars > QuestColumns.Fixed.LabelChars,
|
||||
$"columns: a wide window gives the name more room, at most half ({wide.LabelWidth}, {wide.LabelChars} chars)");
|
||||
Check(wide.Label + wide.LabelWidth <= wide.Ready && wide.Ready < wide.Solves && wide.Solves < wide.Extra && wide.Extra < 1200f,
|
||||
"columns: in order, inside the window");
|
||||
float last = 0f;
|
||||
bool grows = true;
|
||||
for (float w = 400f; w <= 2400f; w += 50f)
|
||||
{
|
||||
QuestColumns c = QuestColumns.For(w);
|
||||
if (c.LabelWidth < last) grows = false;
|
||||
last = c.LabelWidth;
|
||||
}
|
||||
Check(grows, "columns: the name column never shrinks as the window widens");
|
||||
|
||||
// A Geometry event (type 7: pos, size, content avail, cursor, flags) sets the window's width and asks for a pass.
|
||||
var host = new UiHost();
|
||||
UiWindow main = host.Add(new UiWindow("RynthOracle/Oracle", "Oracle") { Visible = true });
|
||||
main.NeedsPass = false;
|
||||
var geo = new byte[36];
|
||||
BinaryPrimitives.WriteSingleLittleEndian(geo.AsSpan(16), 980f);
|
||||
Apply(host, Event(7, ++_seq, main.Hash, 0, geo));
|
||||
Check(main.ContentWidth == 980f && main.NeedsPass, "columns: the Geometry event's content width reaches the window");
|
||||
main.NeedsPass = false;
|
||||
Apply(host, Event(7, ++_seq, main.Hash, 0, geo));
|
||||
Check(!main.NeedsPass, "columns: the same width again asks for no pass");
|
||||
}
|
||||
|
||||
/// <summary>Everything the old Markers tab showed is reachable from the Quests list.</summary>
|
||||
private static void MarkersReachable()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ namespace RynthOracle.Tests
|
|||
private static int Main()
|
||||
{
|
||||
// Tab clicks save the settings: into a scratch file, never the player's %APPDATA% copy.
|
||||
// The flag-list tests below were written for the Quests tab before the guide view (2026-11-01): the
|
||||
// flag list is their default; WikiGuide opens the guide itself.
|
||||
OracleSettings.DefaultQuestGuideView = false;
|
||||
OracleSettings.PathOverride = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "RynthOracleTests-" + Guid.NewGuid().ToString("N") + "-settings.json");
|
||||
Lists();
|
||||
QuestLines();
|
||||
|
|
@ -57,6 +60,7 @@ namespace RynthOracle.Tests
|
|||
GoToParsing();
|
||||
Loaders();
|
||||
MergedList();
|
||||
QuestColumnsFollowWidth();
|
||||
MarkersReachable();
|
||||
GoToButtons();
|
||||
Throttle();
|
||||
|
|
@ -65,12 +69,43 @@ namespace RynthOracle.Tests
|
|||
Refreshes();
|
||||
SkillsTabs();
|
||||
ServerMove();
|
||||
Gear();
|
||||
AutoRefresh();
|
||||
Replies();
|
||||
WikiGuide();
|
||||
KillTasks();
|
||||
WikiDynamicStamps();
|
||||
Fandom();
|
||||
QuestNamesTests();
|
||||
QuestDungeonTests();
|
||||
QuestInsideTests();
|
||||
T11TrackingTests();
|
||||
QuestPickupTests();
|
||||
QuestOfferTests();
|
||||
SocietyQuestResolveTests();
|
||||
ReadyEarly();
|
||||
Console.WriteLine($"{_pass} passed, {_fail} failed");
|
||||
return _fail == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
// Silentkelpie 2026-10-23, two days in: the quest pages showed flags frozen at whenever
|
||||
// something last sent /myquests (RynthOracle only read it at login). Now it reads again once
|
||||
// the flags are QuestRefreshMinutes old, whoever asked last.
|
||||
private static void AutoRefresh()
|
||||
{
|
||||
var t0 = new DateTime(2026, 10, 23, 7, 49, 0, DateTimeKind.Utc);
|
||||
Check(new OracleSettings().QuestRefreshMinutes == 10, "auto refresh: on by default, every 10 minutes");
|
||||
Check(Array.IndexOf(OracleSettings.QuestRefreshChoices, 10) >= 0 && OracleSettings.QuestRefreshChoices[0] == 0,
|
||||
"auto refresh: the About tab's choices hold the default, and Off first");
|
||||
Check(!QuestFlagStore.AutoRefreshDue(10, t0, t0.AddMinutes(9), false, false, 0), "auto refresh: 9 minutes old, not yet");
|
||||
Check(QuestFlagStore.AutoRefreshDue(10, t0, t0.AddMinutes(10), false, false, 0), "auto refresh: 10 minutes old, due");
|
||||
Check(QuestFlagStore.AutoRefreshDue(10, t0, t0.AddMinutes(16), false, false, 0), "auto refresh: Kelpie's 16 minutes, due");
|
||||
Check(!QuestFlagStore.AutoRefreshDue(0, t0, t0.AddHours(48), false, false, 0), "auto refresh: Off never sends");
|
||||
Check(!QuestFlagStore.AutoRefreshDue(10, t0, t0.AddMinutes(30), true, false, 0), "auto refresh: not while a reply is coming");
|
||||
Check(!QuestFlagStore.AutoRefreshDue(10, t0, t0.AddMinutes(30), false, true, 0), "auto refresh: not where the server has /myquests off");
|
||||
Check(!QuestFlagStore.AutoRefreshDue(10, t0, t0.AddMinutes(30), false, false, 20), "auto refresh: not inside the server's minute");
|
||||
}
|
||||
|
||||
private static void Check(bool ok, string what)
|
||||
{
|
||||
if (ok) _pass++;
|
||||
|
|
@ -428,6 +463,8 @@ namespace RynthOracle.Tests
|
|||
private static OracleContext Context()
|
||||
{
|
||||
var c = new OracleContext { InWorld = true, NowMs = 10_000_000, UtcNow = DateTime.UtcNow };
|
||||
// Never the player's own saved AC Community Wiki read (%APPDATA%): a file of the test's own that doesn't exist.
|
||||
c.Fandom = new FandomFeed(System.IO.Path.Combine(System.IO.Path.GetTempPath(), "RynthOracleTests-" + Guid.NewGuid().ToString("N") + "-no-fandom.json"));
|
||||
c.Server.Force("aelrynth", "Aeshnidae", "RynthAelrynth");
|
||||
c.Catalog.Load(TestPacks.Aelrynth, null);
|
||||
c.Flags.OnChatLine("30minattributes - 4 solves (1719432000)\"x\" -1 1800", 0);
|
||||
|
|
|
|||
121
Tools/RynthOracle.Tests/QuestDungeonTests.cs
Normal file
121
Tools/RynthOracle.Tests/QuestDungeonTests.cs
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
using System.Collections.Generic;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// A quest run going into a dungeon (2026-11-07, Silentkelpie: "when creating a route for a quest and enters a
|
||||
// portal to a dungeon, look if a map is loaded if so use that map to then create a route to continue the
|
||||
// quest inside the dungeon, to fight, pickup items, unlock doors, open doors").
|
||||
internal static partial class Program
|
||||
{
|
||||
private static void QuestDungeonTests()
|
||||
{
|
||||
var q = new GuideQuest { Title = "Keep Run", StartsWith = "Bob" };
|
||||
q.Steps.Add(new GuideStep { Text = "Enter the Hidden Keep at 28.5S, 90.9W.", Coords = new List<string> { "28.5S, 90.9W" } });
|
||||
q.Steps.Add(new GuideStep { Text = "Inside, kill the Captain and loot the Cave Door Key.", Items = new List<string> { "Cave Door Key" } });
|
||||
q.Steps.Add(new GuideStep { Text = "Use the Cave Door Key on the door at 12.3S, 45.6E.", Coords = new List<string> { "12.3S, 45.6E" }, Stamps = new List<string> { "KeepDoorOpened" } });
|
||||
q.Steps.Add(new GuideStep { Text = "Return to Bob for your reward." });
|
||||
q.Loot.Add("Cave Door Key");
|
||||
|
||||
var nav = new List<string>(); var ai = new List<string>(); var said = new List<string>();
|
||||
var run = new QuestRunner(l => { nav.Add(l); return true; }, l => { ai.Add(l); return true; }, said.Add);
|
||||
run.OnWhere(false);
|
||||
run.Start(q, _ => false, loot: false);
|
||||
Check(nav.Count == 1 && nav[0] == "go 28.5S, 90.9W", "dungeon: the way in goes to the entrance: " + string.Join(" | ", nav));
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
Check(ai.Count > 0 && ai[^1].StartsWith("dungeon enter"), "dungeon: at an 'Enter ...' step's place, RynthAi takes the portal there: " + string.Join(" | ", ai));
|
||||
|
||||
run.OnWhere(true);
|
||||
Check(run.Step == 1 && run.DungeonWalk && ai.FindLast(l => !l.StartsWith("have ")) == "dungeon patrol | Cave Door Key" && ai[^1] == "have Cave Door Key",
|
||||
"dungeon: in: the way-in step is done, a step without coordinates patrols the dungeon's map (fight, loot, doors; the quest's key), and RynthAi is asked whether the key is carried: " + string.Join(" | ", ai));
|
||||
Check(said.Exists(l => l.StartsWith("Step 1 done: you're in")) && run.Note.Contains("patrolling the dungeon"), "dungeon: chat and the view say so (" + run.Note + ")");
|
||||
int navBefore = nav.Count;
|
||||
run.Next();
|
||||
Check(run.Step == 2 && nav.Count == navBefore && ai[^1] == "dungeon goto -12.3 45.6 | Cave Door Key",
|
||||
"dungeon: a step with coordinates walks the map there with RynthAi, not RynthNav: " + ai[^1]);
|
||||
run.OnWhere(false);
|
||||
Check(ai[^1] == "dungeon stop" && !run.DungeonWalk, "dungeon: out again: the dungeon walk ends");
|
||||
run.OnWhere(true);
|
||||
Check(ai[^1].StartsWith("dungeon goto") && run.DungeonWalk, "dungeon: back in: the step is walked again");
|
||||
run.Stop();
|
||||
Check(ai.Contains("dungeon stop") && ai[^1] == "dungeon stop" && !run.DungeonWalk, "dungeon: Stop ends the dungeon walk: " + ai[^1]);
|
||||
// 2026-11-07: RynthNav's route through a dungeon (the Town Network) isn't the quest's dungeon.
|
||||
ai.Clear(); nav.Clear();
|
||||
run.OnWhere(false);
|
||||
run.Start(q, _ => false, loot: false);
|
||||
run.OnWhere(true); // mid-route, in a hub
|
||||
Check(run.Step == 0 && run.Travelling && !run.DungeonWalk && ai.Count == 0, "route: a dungeon on RynthNav's way is passed through, not walked: " + string.Join(" | ", ai));
|
||||
run.OnWhere(false);
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
Check(ai.Count == 1 && ai[0].StartsWith("dungeon enter") && ai[0].Contains("Hidden"), "route: at the place, the portal the step names is asked for: " + ai[0]);
|
||||
Check(QuestRunner.TownNetworkLandblock == 0x0007, "route: the Town Network's landblock is never a quest dungeon");
|
||||
run.Stop();
|
||||
|
||||
// A portal step that also wants a stamp still goes in; names RynthNav doesn't know fall back to coordinates.
|
||||
var q2 = new GuideQuest { Title = "Stamp Run", StartsAt = "A Renegade Stronghold at 71.4N, 28.6W" };
|
||||
q2.Steps.Add(new GuideStep { Text = "Talk to Ollar.", Stamps = new List<string> { "TalkedOllar" } });
|
||||
q2.Steps.Add(new GuideStep { Text = "Take the portal to the Fenmalain Vestibule and kill the guard.", Stamps = new List<string> { "GuardDead" } });
|
||||
ai.Clear(); nav.Clear();
|
||||
run.Start(q2, s => s == "TalkedOllar", loot: false);
|
||||
Check(run.Step == 0 && nav.Count == 1 && nav[0] == "go 71.4N, 28.6W",
|
||||
"start: step 1 even with its stamp held, to the coordinates its start place gives: " + string.Join(" | ", nav));
|
||||
run.Next();
|
||||
run.OnChat("[RynthNav] none of these is a place on the map: Fenmalain Vestibule");
|
||||
Check(run.Travelling && nav[^1] == "go 71.4N, 28.6W", "names unknown: the last coordinates the quest gave: " + string.Join(" | ", nav));
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
Check(ai.Exists(l => l.StartsWith("dungeon enter") && l.Contains("Fenmalain")), "a stamp step through a portal goes in too: " + string.Join(" | ", ai));
|
||||
run.Stop();
|
||||
|
||||
// In by the step's own place: its coordinates are the way in, so the dungeon is patrolled; a portal on into
|
||||
// another dungeon walks the step again there (11-07 17:29, Abayar's Laboratory).
|
||||
var q3 = new GuideQuest { Title = "Lab Run" };
|
||||
q3.Steps.Add(new GuideStep { Text = "Go to Abayar's Laboratory at 92.1N, 46.3W and find the notes.", Coords = new List<string> { "92.1N, 46.3W" }, Items = new List<string> { "Abayar's Research Notes" } });
|
||||
ai.Clear(); nav.Clear();
|
||||
run.OnWhere(false, 0);
|
||||
run.Start(q3, _ => false, loot: false);
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
run.OnWhere(true, 0x018E);
|
||||
ai.RemoveAll(l => l.StartsWith("have ") || l.StartsWith("talk "));
|
||||
Check(ai.Count > 0 && ai[^1] == "dungeon patrol", "entrance: the step's outdoor place inside is a patrol, not a walk to it: " + string.Join(" | ", ai));
|
||||
int before = ai.Count;
|
||||
run.OnWhere(true, 0x01A0);
|
||||
Check(ai.Count == before + 2 && ai[before] == "dungeon stop" && ai[before + 1] == "dungeon patrol", "another dungeon: the walk starts again there: " + string.Join(" | ", ai));
|
||||
Check(QuestRunner.SameCoords("92.1N, 46.3W", "92.2N, 46.3W") && !QuestRunner.SameCoords("92.1N, 46.3W", "12.3S, 45.6E"), "same place: within half a unit");
|
||||
run.Stop();
|
||||
|
||||
// The Female Tusker Tusk Quest as the wiki has it (21:29 on 11-07): no loot listed, "Head to the Tusker
|
||||
// Burrow", "dropped by Female Tuskers at the end of the dungeon", the tusk only in the rewards.
|
||||
var tusk = new GuideQuest { Title = "Female Tusker Tusk Quest", StartsWith = "Brighteyes, the Tailor", StartsAt = "Oolutanga's Refuge at 2.2N, 95.6E" };
|
||||
tusk.Steps.Add(new GuideStep { Text = "Head to the Tusker Burrow at 2.0N, 97.9E.", Coords = new List<string> { "2.0N, 97.9E" } });
|
||||
tusk.Steps.Add(new GuideStep { Text = "The tusk is dropped by Female Tuskers at the end of the dungeon (see map).", Stamps = new List<string> { "TuskFemalePickup" } });
|
||||
tusk.Steps.Add(new GuideStep { Text = "When you have the tusk, bring it back to Brighteyes to receive your rewards." });
|
||||
tusk.Rewards.Add("For Hand in Female Tusker Tusk:");
|
||||
tusk.Rewards.Add("Aphus Lassel Portal Gem");
|
||||
Check(QuestNames.RewardItems(tusk).Count == 1 && QuestNames.RewardItems(tusk)[0] == "Female Tusker Tusk", "tusk: the rewards name the item handed in");
|
||||
Check(!QuestNames.IsTalk(tusk, tusk.Steps[1]), "tusk: \"dropped by Female Tuskers\" is nobody to talk to");
|
||||
Check(QuestRunner.GoesIn(tusk, 0), "tusk: \"Head to the Tusker Burrow\" goes in (a burrow; the next step is in the dungeon)");
|
||||
ai.Clear(); nav.Clear();
|
||||
run.OnWhere(false, 0);
|
||||
run.Start(tusk, _ => false, loot: true);
|
||||
Check(ai.Contains("add Female Tusker Tusk") && ai.Exists(l => l.StartsWith("profile Female Tusker Tusk Quest|Female Tusker Tusk")),
|
||||
"tusk: its loot and its profile: " + string.Join(" | ", ai));
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
Check(ai[^1].StartsWith("dungeon enter"), "tusk: at the burrow, in by its portal: " + ai[^1]);
|
||||
run.Stop();
|
||||
var none = new GuideQuest { Title = "Plain Kill" };
|
||||
none.Steps.Add(new GuideStep { Text = "Kill ten rats.", Coords = new List<string> { "1.0N, 1.0E" } });
|
||||
ai.Clear();
|
||||
run.Start(none, _ => false, loot: true);
|
||||
Check(ai.Exists(l => l == "profile Plain Kill"), "no items: the quest's profile all the same (base-quest-dynamic): " + string.Join(" | ", ai));
|
||||
run.Stop();
|
||||
|
||||
Check(QuestRunner.TrySignedCoords("28.5S, 90.9W", out double ns, out double ew) && ns == -28.5 && ew == -90.9
|
||||
&& QuestRunner.TrySignedCoords("85.8s,78.8e", out ns, out ew) && ns == -85.8 && ew == 78.8
|
||||
&& !QuestRunner.TrySignedCoords("the Keep", out _, out _), "dungeon: coordinates as signed numbers (north and east positive)");
|
||||
Check(QuestRunner.EntersOnly(q.Steps[0]) && !QuestRunner.EntersOnly(q.Steps[1]) && !QuestRunner.EntersOnly(q.Steps[2]),
|
||||
"dungeon: only a step whose job is going in is done by going in");
|
||||
var keys = QuestRunner.QuestKeys(new GuideQuest { Loot = new List<string> { "Cave Door Key", "Monkey Paw", "Keystone", "Bonecrunch's Chest Key" } });
|
||||
Check(string.Join(",", keys) == "Cave Door Key,Bonecrunch's Chest Key", "dungeon: the quest's keys (not a Monkey Paw or a Keystone): " + string.Join(",", keys));
|
||||
}
|
||||
}
|
||||
}
|
||||
59
Tools/RynthOracle.Tests/QuestInsideTests.cs
Normal file
59
Tools/RynthOracle.Tests/QuestInsideTests.cs
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
using System.Collections.Generic;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// A quest's person inside a dungeon or the Bur (2026-11-11, Silentkelpie: "some npc can be inside dungeons or bur
|
||||
// and should route to them correctly"): RynthNav's arrival names the cell, RynthAi walks the dungeon's map there.
|
||||
internal static partial class Program
|
||||
{
|
||||
private static void QuestInsideTests()
|
||||
{
|
||||
Check(QuestRunner.InsideCell("[RynthNav] goto: arrived at Drogur (Drogur is in cell 009C0270)") == 0x009C0270u, "inside: the arrival's cell is read");
|
||||
Check(QuestRunner.InsideCell("[RynthNav] goto: arrived at Drogur") == 0, "inside: no cell, none");
|
||||
|
||||
var q = new GuideQuest { Title = "Bur Run" };
|
||||
q.Steps.Add(new GuideStep { Text = "Talk to Drogur.", Stamps = new List<string> { "TalkedDrogur" } });
|
||||
q.Steps.Add(new GuideStep { Text = "Talk to Kuurak.", Stamps = new List<string> { "TalkedKuurak" } });
|
||||
var nav = new List<string>(); var ai = new List<string>(); var said = new List<string>();
|
||||
var run = new QuestRunner(l => { nav.Add(l); return true; }, l => { ai.Add(l); return true; }, said.Add);
|
||||
run.OnWhere(false, 0);
|
||||
run.Start(q, _ => false, loot: false);
|
||||
Check(nav.Count == 1 && nav[0].StartsWith("go Drogur"), "inside: RynthNav is asked for the person: " + string.Join(" | ", nav));
|
||||
run.OnWhere(true, 0x009C); // Bur Recall, mid-goto
|
||||
run.OnChat("[RynthNav] goto: arrived at Drogur (Drogur is in cell 009C0270)");
|
||||
int to = ai.FindIndex(l => l == "dungeon to 009C0270");
|
||||
int talk = ai.FindIndex(l => l.StartsWith("talk Drogur"));
|
||||
Check(to >= 0 && talk > to && run.DungeonWalk, "inside: RynthAi walks the map to the cell, then the talk waits on the way: " + string.Join(" | ", ai));
|
||||
|
||||
// Already inside: the next step's person is asked for in this dungeon first.
|
||||
nav.Clear(); ai.Clear();
|
||||
run.Next();
|
||||
Check(nav.Count == 1 && nav[0].StartsWith("inside Kuurak") && run.Travelling, "inside: in the dungeon, RynthNav says which cell: " + string.Join(" | ", nav));
|
||||
run.OnChat("[RynthNav] goto: arrived in the Bur: Kuurak is inside (Kuurak is in cell 009C012D)");
|
||||
Check(ai.Exists(l => l == "dungeon to 009C012D") && ai.Exists(l => l.StartsWith("talk Kuurak")), "inside: walked there: " + string.Join(" | ", ai));
|
||||
|
||||
// Not in this dungeon by the Atlas: patrolled as before.
|
||||
run.Back(); nav.Clear(); ai.Clear();
|
||||
run.Next();
|
||||
run.OnChat("[RynthNav] inside: none of these is someone inside a dungeon: Kuurak");
|
||||
Check(!run.Travelling && ai.Exists(l => l.StartsWith("dungeon patrol")) && ai.Exists(l => l.StartsWith("talk Kuurak")), "inside: not here: the dungeon is patrolled: " + string.Join(" | ", ai));
|
||||
run.Stop();
|
||||
|
||||
// 2026-11-11: one hand-in for every Quests view.
|
||||
var hq = new GuideQuest { Title = "Collar", StartsWith = "Xsao Lann" };
|
||||
hq.Steps.Add(new GuideStep { Text = "Kill the wolf and loot Darling's Collar.", Items = new List<string> { "Darling's Collar" } });
|
||||
hq.Steps.Add(new GuideStep { Text = "Return the collar to Xsao Lann.", Stamps = new List<string> { "CollarReturned" } });
|
||||
var h = RynthCore.Plugin.RynthOracle.Views.OracleView.HandInOf(hq);
|
||||
Check(h is { } a1 && a1.Step == 1 && ReferenceEquals(a1.Quest, hq), "hand-in: the quest's own hand-in step");
|
||||
var kq = new GuideQuest { Title = "Tusks", StartsWith = "Ulgrim" };
|
||||
kq.Steps.Add(new GuideStep { Text = "Kill Female Tuskers for their tusks." });
|
||||
kq.Rewards.Add("For Hand in Female Tusker Tusk:");
|
||||
var k = RynthCore.Plugin.RynthOracle.Views.OracleView.HandInOf(kq);
|
||||
Check(k is { } a2 && a2.Quest.Steps.Count == 1 && QuestNames.IsHandIn(a2.Quest.Steps[0]) && QuestNames.HandInItems(a2.Quest, 0).Contains("Female Tusker Tusk")
|
||||
&& QuestNames.TargetsAt(a2.Quest, 0).Contains("Ulgrim"),
|
||||
"hand-in: rewards for handing in, to the person it starts with: " + (k?.Quest.Steps[0].Text ?? "none"));
|
||||
Check(RynthCore.Plugin.RynthOracle.Views.OracleView.HandInOf(new GuideQuest { Title = "Walk" }) == null, "hand-in: nothing to hand in, none");
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Tools/RynthOracle.Tests/QuestNamesTests.cs
Normal file
55
Tools/RynthOracle.Tests/QuestNamesTests.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using System.Collections.Generic;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// Who and where a wiki step names (2026-11-07, Silentkelpie: "it should read the quest for names to
|
||||
// build a route to if coords are not present, and talk to npc in question. it should also hand quest
|
||||
// items back to the npc"). Two quests as the guide has them.
|
||||
internal static partial class Program
|
||||
{
|
||||
private static GuideStep Step(string text, params string[] items) => new() { Text = text, Items = new List<string>(items) };
|
||||
|
||||
private static void QuestNamesTests()
|
||||
{
|
||||
var lost = new GuideQuest { Title = "Lost Pet", StartsWith = "Xsao Lann", StartsAt = "1.5N, 71.6W in Fort Tethana" };
|
||||
lost.Steps.Add(Step("Talk to Xsao Lann in Fort Tethana."));
|
||||
lost.Steps.Add(new GuideStep { Text = "Run to Creepy Canyons at 4.6N, 89.5W.", Coords = new List<string> { "4.6N, 89.5W" } });
|
||||
lost.Steps.Add(Step("Kill Darling and loot Darling's Collar (Quest Item).", "Darling's Collar (Quest Item)"));
|
||||
lost.Steps.Add(Step("Return the collar to Xsao for your rewards."));
|
||||
lost.Loot.Add("Darling's Collar (Quest Item)");
|
||||
|
||||
string J(List<string> l) => string.Join(" || ", l);
|
||||
Check(J(QuestNames.Candidates(lost, lost.Steps[0], firstStep: true)) == "Xsao Lann || Fort Tethana || 1.5N, 71.6W in Fort Tethana",
|
||||
"names: 'Talk to Xsao Lann in Fort Tethana': the person, the place, then where the quest starts (not split at its comma): " + J(QuestNames.Candidates(lost, lost.Steps[0], true)));
|
||||
Check(QuestNames.IsTalk(lost, lost.Steps[0]) && !QuestNames.IsHandIn(lost.Steps[0]), "names: 'Talk to': talk, no hand-in");
|
||||
Check(J(QuestNames.Candidates(lost, lost.Steps[2])) == "Darling", "names: 'Kill Darling and loot Darling's Collar': the item's name isn't a name");
|
||||
Check(!QuestNames.IsTalk(lost, lost.Steps[2]) && !QuestNames.IsHandIn(lost.Steps[2]), "names: a kill step talks to nobody");
|
||||
Check(J(QuestNames.Candidates(lost, lost.Steps[3])) == "Xsao Lann", "names: 'Return the collar to Xsao': the quest's person in full");
|
||||
Check(QuestNames.IsHandIn(lost.Steps[3]) && J(QuestNames.HandInItems(lost, 3)) == "Darling's Collar (Quest Item)",
|
||||
"names: 'Return the collar': a hand-in of the collar got before it");
|
||||
Check(QuestNames.HandInItems(lost, 1).Count == 0, "names: before the collar is looted there is nothing to hand in");
|
||||
|
||||
var note = new GuideQuest { Title = "Note of Congratulation", StartsWith = "Nasun ibn Tifar / Ahyara", StartsAt = "North Yaraq Outpost / East Yaraq Outpost" };
|
||||
note.Steps.Add(Step("From Yaraq follow the paths either north to the North Yaraq Outpost or east to the East Yaraq Outpost."));
|
||||
note.Steps.Add(Step("In the north outpost you will find Nasun ibn Tifar who will give you a Congratulations (Nasun ibn Tifar) note to be signed by Ahyara in the east outpost.", "Congratulations (Nasun ibn Tifar)"));
|
||||
note.Steps.Add(Step("Take the note to Ahyara and she will sign it and hand you Congratulations (Nasun ibn Tifar & Ahyara).", "Congratulations (Nasun ibn Tifar & Ahyara)"));
|
||||
note.Steps.Add(new GuideStep { Text = "Head back to Yaraq and find Mara al-Luq, she is in the Cerulian Cove tavern at 21.7S, 1.6W.", Coords = new List<string> { "21.7S, 1.6W" } });
|
||||
note.Steps.Add(Step("Hand her each note of congratulation to receive Thank You Note (Ahyara) and Thank You Note (Nasun ibn Tifar)", "Thank You Note (Ahyara)", "Thank You Note (Nasun ibn Tifar)"));
|
||||
note.Loot.Add("Congratulations (Nasun ibn Tifar)");
|
||||
|
||||
Check(J(QuestNames.Candidates(note, note.Steps[0], true)) == "North Yaraq Outpost || East Yaraq Outpost",
|
||||
"names: 'From Yaraq follow the paths ... to the North Yaraq Outpost': where it goes, not where it starts from: " + J(QuestNames.Candidates(note, note.Steps[0], true)));
|
||||
Check(J(QuestNames.Candidates(note, note.Steps[1])) == "Nasun ibn Tifar || Ahyara" && QuestNames.IsTalk(note, note.Steps[1]),
|
||||
"names: 'you will find Nasun ibn Tifar': 'ibn' joins the name; talk");
|
||||
Check(J(QuestNames.Candidates(note, note.Steps[2])) == "Ahyara",
|
||||
"names: a person named only inside an item's name ('Congratulations (Nasun ibn Tifar & Ahyara)') isn't the step's: " + J(QuestNames.Candidates(note, note.Steps[2])));
|
||||
Check(QuestNames.IsHandIn(note.Steps[2]) && J(QuestNames.HandInItems(note, 2)) == "Congratulations (Nasun ibn Tifar)",
|
||||
"names: 'Take the note to Ahyara ... hand you X': hands over Nasun's note, not the one it gets back");
|
||||
Check(J(QuestNames.Candidates(note, note.Steps[3])).Contains("Mara al-Luq"), "names: 'al-' joins the name (Mara al-Luq)");
|
||||
Check(QuestNames.Candidates(note, note.Steps[4]).Count == 0 && J(QuestNames.TargetsAt(note, 4)).Contains("Mara al-Luq"),
|
||||
"names: 'Hand her each note': nobody named, so the person of the step before");
|
||||
Check(QuestNames.IsHandIn(note.Steps[4]) && !QuestNames.IsHandIn(Step("She will hand you a note.")), "names: 'hand you' is getting, not a hand-in");
|
||||
}
|
||||
}
|
||||
}
|
||||
74
Tools/RynthOracle.Tests/QuestOfferTests.cs
Normal file
74
Tools/RynthOracle.Tests/QuestOfferTests.cs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using RynthCore.Plugin.RynthOracle;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// 2026-11-08, Silentkelpie: "on multi step quests, add in a options to click on the step you want to do vs using
|
||||
// just next or back. also when one clicks on a npc and they talk back check to see if their text is the start of
|
||||
// a quest and ask if you want to do that quest."
|
||||
internal static partial class Program
|
||||
{
|
||||
private static void QuestOfferTests()
|
||||
{
|
||||
// Any step, picked.
|
||||
var q = new GuideQuest { Title = "Three Steps" };
|
||||
q.Steps.Add(new GuideStep { Text = "Go to 1.0N, 1.0E.", Coords = new List<string> { "1.0N, 1.0E" } });
|
||||
q.Steps.Add(new GuideStep { Text = "Go to 2.0N, 2.0E.", Coords = new List<string> { "2.0N, 2.0E" } });
|
||||
q.Steps.Add(new GuideStep { Text = "Go to 3.0N, 3.0E.", Coords = new List<string> { "3.0N, 3.0E" } });
|
||||
var nav = new List<string>(); var ai = new List<string>(); var said = new List<string>();
|
||||
var run = new QuestRunner(l => { nav.Add(l); return true; }, l => { ai.Add(l); return true; }, said.Add);
|
||||
run.Start(q, _ => false, loot: false);
|
||||
run.GoTo(2);
|
||||
Check(run.Step == 2 && nav.Count == 3 && nav[1] == "stop" && nav[2] == "go 3.0N, 3.0E", "steps: a picked step: the trip stops, its place is next: " + string.Join(" | ", nav));
|
||||
run.GoTo(0);
|
||||
Check(run.Step == 0 && nav[^1] == "go 1.0N, 1.0E", "steps: back to the first, done or not");
|
||||
run.GoTo(7);
|
||||
Check(run.Step == 0, "steps: no such step: nothing changes");
|
||||
run.Stop();
|
||||
|
||||
// An NPC talking.
|
||||
Check(QuestOffers.TryNpcLine("Xsao Lann tells you, \"Have you seen my dog?\"", out string who, out string text) && who == "Xsao Lann" && text == "Have you seen my dog?",
|
||||
"offer: an NPC's tell: who and what");
|
||||
Check(QuestOffers.TryNpcLine("Warden says, \"Show me what you found.\"", out who, out _) && who == "Warden", "offer: an NPC's say");
|
||||
Check(!QuestOffers.TryNpcLine("You say, \"hello\"", out _, out _) && !QuestOffers.TryNpcLine("You've stamped AcidAxe!", out _, out _),
|
||||
"offer: your own words and other lines are not an NPC");
|
||||
|
||||
var collar = new GuideQuest { Title = "Darling's Collar", StartsWith = "Xsao Lann", Overview = "Find the lost dog collar." };
|
||||
var other = new GuideQuest { Title = "Fort Supplies", StartsWith = "Xsao Lann / Guard Bob" };
|
||||
var axe = new GuideQuest { Title = "Acid Axe Quest", StartsWith = "Warden (Suntik)" };
|
||||
var list = QuestOffers.StartedBy(new[] { other, collar, axe }, "Xsao Lann", "Have you seen my dog? He lost his collar.");
|
||||
Check(list.Count == 2 && list[0] == collar && list[1] == other, "offer: the NPC's quests, the one its words match first: " + string.Join(", ", list.ConvertAll(x => x.Title)));
|
||||
Check(QuestOffers.StartedBy(new[] { axe }, "Warden", "").Count == 1, "offer: a note in brackets after the name doesn't count");
|
||||
Check(QuestOffers.StartedBy(new[] { axe, collar }, "Xsao", "").Count == 0, "offer: only the whole name");
|
||||
|
||||
// The offer window: quests the character can run now.
|
||||
var g = new QuestGuide { Source = "api", UpdatedUtc = DateTime.UtcNow };
|
||||
g.Quests.Add(collar);
|
||||
g.Quests.Add(other);
|
||||
string file = Path.Combine(Path.GetTempPath(), "RynthOracleTests-" + Guid.NewGuid().ToString("N") + "-wiki-quests.json");
|
||||
File.WriteAllText(file, g.ToJson());
|
||||
OracleContext c = On("ilt");
|
||||
c.Runner = new QuestRunner(l => { nav.Add(l); return true; }, l => { ai.Add(l); return true; }, said.Add);
|
||||
c.Guide.Take("{\"path\":" + System.Text.Json.JsonSerializer.Serialize(file) + ",\"revision\":9,\"count\":2,\"login\":true,\"running\":false,\"status\":\"2 quests.\"}");
|
||||
var view = new OracleView(c);
|
||||
bool shown = true;
|
||||
view.SetOfferWindow = v => shown = v;
|
||||
Check(view.OfferFor("Xsao Lann", "my dog's collar", 1000) && view.Offered.Count == 2 && view.Offered[0].Title == "Darling's Collar",
|
||||
"offer window: the NPC's quests are offered: " + string.Join(", ", ListTitles(view.Offered)));
|
||||
Check(!view.OfferFor("Xsao Lann", "again", 2000), "offer window: the same NPC isn't asked about again right away");
|
||||
Check(!view.OfferFor("Guard Jim", "hello", 3000), "offer window: an NPC who starts nothing: no offer");
|
||||
File.Delete(file);
|
||||
}
|
||||
|
||||
private static List<string> ListTitles(IReadOnlyList<GuideQuest> qs)
|
||||
{
|
||||
var l = new List<string>();
|
||||
foreach (GuideQuest x in qs) l.Add(x.Title);
|
||||
return l;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -127,17 +127,34 @@ namespace RynthOracle.Tests
|
|||
if (dir == null) return;
|
||||
string root = Path.Combine(dir, "Plugins", "RynthCore.Plugin.RynthOracle");
|
||||
var names = new Regex(@"Ilt[A-Z]|RynthIlt|Leaftide|Conquest|Aelrynth|Levistras|DreamWeave", RegexOptions.CultureInvariant);
|
||||
// The one exception (2026-10-25): Infinite Leaftide's Dynamic Stamps and Temple guardian rows, read
|
||||
// from RynthILT and gated on ServerIdentity.IsIlt, may name that server in these files only.
|
||||
var iltNames = new Regex(@"^(Ilt[A-Z]|RynthIlt|Leaftide)", RegexOptions.CultureInvariant);
|
||||
var iltFiles = new System.Collections.Generic.HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"OracleContext.cs", "RynthOraclePlugin.cs", Path.Combine("Data", "ServerIdentity.cs"), Path.Combine("Data", "IltServerProfile.cs"),
|
||||
Path.Combine("Data", "DynamicStamps.cs"), Path.Combine("Views", "DynamicStampsTab.cs"), Path.Combine("Views", "QuestsTab.cs"),
|
||||
// 2026-11-01: the Leaftide wiki quest guide RynthILT keeps, read only while the server is Infinite Leaftide.
|
||||
Path.Combine("Data", "QuestGuideClient.cs"),
|
||||
// 2026-11-11: the T11 Tracking tab (Infinite Leaftide only) toggles a charm through RynthILT's data interface.
|
||||
Path.Combine("Views", "T11Tab.cs"),
|
||||
// 2026-11-21: the ILT Tracker (the T11 Tracking tab renamed): ACECustom's quest bonus and QB Deeds read from
|
||||
// RynthILT, and the Leaftide wiki login how-to, all on that Infinite Leaftide-only tab.
|
||||
Path.Combine("Views", "IltTrackerTab.cs"), Path.Combine("Data", "QuestBonus.cs"), Path.Combine("Data", "IltWikiGuide.cs"),
|
||||
};
|
||||
int files = 0;
|
||||
var found = new System.Collections.Generic.List<string>();
|
||||
foreach (string file in Directory.GetFiles(root, "*.cs", SearchOption.AllDirectories))
|
||||
{
|
||||
if (file.Contains(Path.DirectorySeparatorChar + "obj" + Path.DirectorySeparatorChar) || file.Contains(Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar)) continue;
|
||||
files++;
|
||||
string rel = Path.GetRelativePath(root, file);
|
||||
bool iltFile = iltFiles.Contains(rel);
|
||||
string[] lines = File.ReadAllLines(file);
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
Match m = names.Match(CodeOf(lines[i]));
|
||||
if (m.Success) found.Add($"{Path.GetRelativePath(root, file)}:{i + 1} ({m.Value})");
|
||||
foreach (Match m in names.Matches(CodeOf(lines[i])))
|
||||
if (!(iltFile && iltNames.IsMatch(m.Value))) { found.Add($"{rel}:{i + 1} ({m.Value})"); break; }
|
||||
}
|
||||
}
|
||||
Check(files > 30, $"RynthOracle's sources were read ({files})");
|
||||
|
|
|
|||
118
Tools/RynthOracle.Tests/QuestPickupTests.cs
Normal file
118
Tools/RynthOracle.Tests/QuestPickupTests.cs
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
using System.Collections.Generic;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// The Acid Axe Quest (2026-11-08, Silentstorm at 09:01: "while it built the quest it and ran to the right spot it
|
||||
// still missed talking to the 1st guy and it didn't loot the item off the ground"): the run went to Suntik Village
|
||||
// and stayed on step 1 (a travel step has no stamp), so the axe and the Warden never came.
|
||||
internal static partial class Program
|
||||
{
|
||||
private static void QuestPickupTests()
|
||||
{
|
||||
var q = new GuideQuest { Title = "Acid Axe Quest", StartsWith = "Messenger's Corpse", StartsAt = "26.9N, 7.7E" };
|
||||
q.Steps.Add(new GuideStep
|
||||
{
|
||||
Text = "Travel to Suntik Village at 16.2N 4.3E.",
|
||||
Notes = new List<string> { "Route 1: Take the Suntik portal in the west wing of the Facility Hub.", "Route 2: Go to Zaikhal and head northeast out of town to 16.9N 3.5E, a section of the hill that can be climbed." },
|
||||
Coords = new List<string> { "16.2N, 4.3E", "16.9N, 3.5E" },
|
||||
});
|
||||
q.Steps.Add(new GuideStep
|
||||
{
|
||||
Text = "Enter the blacksmith building and grab the Acid Axe on the ground next to the body of the dead blacksmith. If you want multiple axes simply wait for it to reappear. (Respawn| 5 minutes)",
|
||||
Items = new List<string> { "Acid Axe" },
|
||||
});
|
||||
q.Steps.Add(new GuideStep { Text = "Show it to Warden (Suntik) for a one time xp bonus.", Stamps = new List<string> { "fachubsuntik" } });
|
||||
q.Steps.Add(new GuideStep { Text = "Bring Acid Axe to an Ivory Crafter for 37,500 experience.", Stamps = new List<string> { "AcidAxeTurnedIn" } });
|
||||
q.Loot.Add("Acid Axe");
|
||||
|
||||
Check(string.Join(" | ", QuestRunner.Places(q.Steps[0])) == "16.2N, 4.3E", "acid axe: the step's own place, not the climb its Route 2 note names: " + string.Join(" | ", QuestRunner.Places(q.Steps[0])));
|
||||
Check(QuestRunner.TravelOnly(q, 0), "acid axe: \"Travel to Suntik Village\" is done by getting there");
|
||||
Check(!QuestRunner.GoesIn(q.Steps[1]) && !QuestRunner.GoesIn(q, 1) && QuestRunner.IntoBuilding(q.Steps[1].Text), "acid axe: entering the blacksmith building is no portal");
|
||||
Check(QuestRunner.IsPickup(q.Steps[1]), "acid axe: \"grab the Acid Axe on the ground\" picks it up");
|
||||
Check(QuestNames.IsHandIn(q.Steps[2]), "acid axe: \"Show it to Warden\" hands it over");
|
||||
|
||||
var nav = new List<string>(); var ai = new List<string>(); var said = new List<string>();
|
||||
var run = new QuestRunner(l => { nav.Add(l); return true; }, l => { ai.Add(l); return true; }, said.Add);
|
||||
run.OnWhere(false, 0);
|
||||
run.Start(q, _ => false, loot: true);
|
||||
Check(nav.Count == 1 && nav[0] == "go 16.2N, 4.3E", "acid axe: to Suntik Village: " + string.Join(" | ", nav));
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
Check(run.Step == 1, "acid axe: there, step 1 is done (it stayed on it): step " + (run.Step + 1));
|
||||
Check(nav.Count == 1, "acid axe: the axe is picked up where the run is, no trip to the climb or elsewhere: " + string.Join(" | ", nav));
|
||||
Check(ai.Count > 0 && ai[^1] == "have Acid Axe", "acid axe: RynthAi is asked whether the axe is carried (else it picks it up): " + string.Join(" | ", ai));
|
||||
Check(!ai.Exists(l => l.StartsWith("dungeon enter")), "acid axe: no portal taken for the building: " + string.Join(" | ", ai));
|
||||
run.OnChat("[RynthAi] Quest: got Acid Axe.");
|
||||
Check(run.Step == 2, "acid axe: got it: on to the Warden: step " + (run.Step + 1));
|
||||
Check(nav.Count == 2 && nav[1].StartsWith("go Warden"), "acid axe: to the Warden: " + string.Join(" | ", nav));
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
Check(ai[^1].StartsWith("handin Warden") && ai[^1].EndsWith("| Acid Axe"), "acid axe: shown to the Warden (given; he hands it back): " + ai[^1]);
|
||||
run.Stop();
|
||||
|
||||
// Picked up by hand before the step: RynthAi says it is carried, and the run goes on.
|
||||
ai.Clear(); nav.Clear();
|
||||
run.Start(q, _ => false, loot: false);
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
run.OnChat("[RynthAi] Quest: got Acid Axe (already in your pack).");
|
||||
Check(run.Step == 2, "acid axe: already carried: the step is done: step " + (run.Step + 1));
|
||||
run.Stop();
|
||||
|
||||
// A got line for another item, or a stamped step with items: the stamp still decides.
|
||||
var k = new GuideQuest { Title = "Key Run" };
|
||||
k.Steps.Add(new GuideStep { Text = "Pick up the Old Key on the table at 1.0N, 1.0E.", Coords = new List<string> { "1.0N, 1.0E" }, Items = new List<string> { "Old Key", "Old Note" } });
|
||||
k.Steps.Add(new GuideStep { Text = "Kill the rat and loot the Rat Tail.", Items = new List<string> { "Rat Tail" }, Stamps = new List<string> { "RatTail" } });
|
||||
ai.Clear(); nav.Clear();
|
||||
run.Start(k, _ => false, loot: false);
|
||||
Check(ai.Count == 1 && ai[0] == "have Old Key | Old Note", "items: asked at the start too (picked up earlier): " + string.Join(" | ", ai));
|
||||
run.OnChat("[RynthAi] Quest: got Old Key.");
|
||||
Check(run.Step == 0, "items: one of two: not done yet");
|
||||
run.OnChat("[RynthAi] Quest: got Old Note (Quest Item).");
|
||||
Check(run.Step == 1 && nav.Contains("stop"), "items: both: done, RynthNav stopped on its way: " + string.Join(" | ", nav));
|
||||
run.OnChat("[RynthAi] Quest: got Rat Tail.");
|
||||
Check(run.Step == 2 || !run.Active, "items: the last item got ends a step with a stamp too (2026-11-10)");
|
||||
run.Stop();
|
||||
|
||||
// 2026-11-10: "when a quest pickups the last loot item it should move to the next step vs keep fighting
|
||||
// even if the dungeon". The loot step inside, then the hand-in outside: the walk stops, RynthNav goes.
|
||||
var jaw = new GuideQuest { Title = "Jaw Run" };
|
||||
jaw.Steps.Add(new GuideStep { Text = "Enter the Eater Pit at 10.0N, 10.0E.", Coords = new List<string> { "10.0N, 10.0E" } });
|
||||
jaw.Steps.Add(new GuideStep { Text = "Kill Abhorrent Eaters and loot an Abhorrent Eater Jaw.", Items = new List<string> { "Abhorrent Eater Jaw" }, Stamps = new List<string> { "EaterJaw" } });
|
||||
jaw.Steps.Add(new GuideStep { Text = "Return to Xsao Lann at 20.0N, 20.0E and hand her the jaw.", Coords = new List<string> { "20.0N, 20.0E" } });
|
||||
Check(QuestRunner.HappensOutside(jaw, 2) && !QuestRunner.HappensOutside(jaw, 1), "outside: the return, not the loot step");
|
||||
ai.Clear(); nav.Clear();
|
||||
run.OnWhere(false, 0);
|
||||
run.Start(jaw, _ => false, loot: false);
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
run.OnWhere(true, 0x1234);
|
||||
Check(run.Step == 1 && ai.Exists(l => l.StartsWith("dungeon patrol")), "in: patrolling for the jaw: " + string.Join(" | ", ai));
|
||||
nav.Clear();
|
||||
run.OnChat("[RynthAi] Quest: got Abhorrent Eater Jaw.");
|
||||
Check(run.Step == 2, "the jaw got: on to the return");
|
||||
Check(ai[^1] == "dungeon stop" || ai.Contains("dungeon stop"), "the dungeon walk stops: " + string.Join(" | ", ai));
|
||||
Check(nav.Count > 0 && nav[^1] == "go 20.0N, 20.0E", "RynthNav goes to Xsao: " + string.Join(" | ", nav));
|
||||
run.Stop();
|
||||
|
||||
// 2026-11-10: "the route isn't going in the portal like it should". A travel step to the portal's spot,
|
||||
// the next step inside: the portal right there is taken, and getting in ends the step.
|
||||
var pit = new GuideQuest { Title = "Pit Run" };
|
||||
pit.Steps.Add(new GuideStep { Text = "Travel to 30.0N, 30.0E.", Coords = new List<string> { "30.0N, 30.0E" } });
|
||||
pit.Steps.Add(new GuideStep { Text = "Kill the Pit Lord and loot the Pit Key.", Items = new List<string> { "Pit Key" } });
|
||||
ai.Clear(); nav.Clear();
|
||||
run.OnWhere(false, 0);
|
||||
run.Start(pit, _ => false, loot: false);
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
Check(run.Step == 0 && ai.Exists(l => l.StartsWith("dungeon enter near")), "at the spot: the portal right there: " + string.Join(" | ", ai));
|
||||
run.OnWhere(true, 0x2222);
|
||||
Check(run.Step == 1, "in: the travel step is done");
|
||||
run.Stop();
|
||||
// No portal there: being there is the step, as before.
|
||||
ai.Clear(); nav.Clear();
|
||||
run.OnWhere(false, 0);
|
||||
run.Start(pit, _ => false, loot: false);
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
run.OnChat("[RynthAi] Quest: no portal right here.");
|
||||
Check(run.Step == 1, "no portal: the travel step is done");
|
||||
run.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,14 @@ namespace RynthOracle.Tests
|
|||
("attribute", OracleVerb.Tab, OracleView.TabAttributes), ("vitals", OracleVerb.Tab, OracleView.TabAttributes),
|
||||
("progress", OracleVerb.Tab, OracleView.TabProgress), ("progression", OracleVerb.Tab, OracleView.TabProgress),
|
||||
("status", OracleVerb.Status, ""), ("about", OracleVerb.About, OracleView.TabAbout), ("help", OracleVerb.Help, ""), ("?", OracleVerb.Help, ""),
|
||||
("STATUS", OracleVerb.Status, ""), ("questz", OracleVerb.Unknown, ""), ("dynamic", OracleVerb.Unknown, ""),
|
||||
("STATUS", OracleVerb.Status, ""), ("questz", OracleVerb.Unknown, ""),
|
||||
// The test branch keeps these: the Gear tab and Infinite Leaftide's trackers (gated to ILT in the plugin).
|
||||
("gear", OracleVerb.Tab, OracleView.TabGear), ("overlap", OracleVerb.Tab, OracleView.TabGear),
|
||||
("dynamic", OracleVerb.Trackers, OracleView.TabQuests), ("stamps", OracleVerb.Trackers, OracleView.TabQuests),
|
||||
("guardian", OracleVerb.Trackers, OracleView.TabQuests), ("guardians", OracleVerb.Trackers, OracleView.TabQuests),
|
||||
// 2026-11-22: ILT Tracker bar window (left the Oracle tab strip).
|
||||
("tracker", OracleVerb.Tracker, ""), ("ilttracker", OracleVerb.Tracker, ""), ("t11", OracleVerb.Tracker, ""), ("ilt", OracleVerb.Tracker, ""),
|
||||
("lootprofiles", OracleVerb.LootProfiles, ""), ("lootprofile", OracleVerb.LootProfiles, ""),
|
||||
};
|
||||
var seen = new HashSet<OracleVerb>();
|
||||
foreach (var (typed, verb, tab) in words)
|
||||
|
|
@ -34,6 +41,9 @@ namespace RynthOracle.Tests
|
|||
seen.Add(c.Verb);
|
||||
}
|
||||
foreach (OracleVerb v in Enum.GetValues<OracleVerb>()) Check(seen.Contains(v), $"the table covers /ro's {v}");
|
||||
OracleCommand lp = OracleCommand.Parse("lootprofile Mistreated Virindi");
|
||||
Check(lp.Verb == OracleVerb.LootProfiles && lp.Word == "Mistreated Virindi", $"'/ro lootprofile <quest>': the quest as typed (got {lp.Verb} '{lp.Word}')");
|
||||
Check(OracleCommand.Parse("lootprofiles").Word == "" && OracleCommand.Parse("lootprofilesx").Verb == OracleVerb.Unknown, "'/ro lootprofiles': every quest; a longer word isn't it");
|
||||
Check(OracleCommand.Parse("legendary").Trackers == QuestKind.Legendary && OracleCommand.Parse("markers").Trackers == QuestKind.Marker
|
||||
&& OracleCommand.Parse("trackers").Trackers == null, "the trackers each word shows");
|
||||
Check(OracleCommand.Parse("void").ShowsWindow && !OracleCommand.Parse("status").ShowsWindow && !OracleCommand.Parse("quests").ShowsWindow,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
<ProjectReference Include="..\..\..\RynthCore\src\RynthCore.PluginSdk\RynthCore.PluginSdk.csproj" />
|
||||
<!-- The engine parser's whitelists use ImGui.NET's enums. -->
|
||||
<PackageReference Include="ImGui.NET" Version="1.91.6.1" />
|
||||
<!-- The Gear tab's dat reader (portal.dat spell table). -->
|
||||
<ProjectReference Include="..\..\Shared\RynthCore.TerrainData\RynthCore.TerrainData.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -34,9 +36,12 @@
|
|||
<!-- RynthCore's server list and the owner plugin's profile (as in the plugin's csproj). -->
|
||||
<Compile Include="..\..\Plugins\Shared\RynthServerProfileApi.cs" Link="RynthOracle\Shared\RynthServerProfileApi.cs" />
|
||||
<Compile Include="..\..\Plugins\Shared\EngineServerState.cs" Link="RynthOracle\Shared\EngineServerState.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\RynthServers\Plugins\Shared\RynthIltServerApi.cs" Link="RynthOracle\Shared\RynthIltServerApi.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\RynthServers\Plugins\Shared\RynthIltDataApi.cs" Link="RynthOracle\Shared\RynthIltDataApi.cs" />
|
||||
<Compile Include="..\..\Plugins\Shared\ServerStateClient.cs" Link="RynthOracle\Shared\ServerStateClient.cs" />
|
||||
<!-- "RynthServer.QuestPack": the active server plugin's quest pack (as in the plugin's csproj). -->
|
||||
<Compile Include="..\..\Plugins\Shared\RynthServerQuestPackApi.cs" Link="RynthOracle\Shared\RynthServerQuestPackApi.cs" />
|
||||
<Compile Include="..\..\Plugins\Shared\RynthServerQuestGuideApi.cs" Link="RynthOracle\Shared\RynthServerQuestGuideApi.cs" />
|
||||
<Compile Include="..\..\Plugins\Shared\ServerQuestPackClient.cs" Link="RynthOracle\Shared\ServerQuestPackClient.cs" />
|
||||
<Compile Include="..\..\Plugins\Shared\CommandReply.cs" Link="RynthOracle\Shared\CommandReply.cs" />
|
||||
<Compile Include="..\..\..\RynthCore\src\RynthCore.Engine\UI\ScriptWindows\DisplayListParser.cs" Link="Engine\DisplayListParser.cs" />
|
||||
|
|
@ -50,12 +55,23 @@
|
|||
<EmbeddedResource Include="TestData\quests.conquest.csv" LogicalName="TestPack.conquest.csv" />
|
||||
<EmbeddedResource Include="TestData\quests.levistras.csv" LogicalName="TestPack.levistras.csv" />
|
||||
<EmbeddedResource Include="TestData\quests.aelrynth.csv" LogicalName="TestPack.aelrynth.csv" />
|
||||
<!-- Leaftide wiki quest pages (WikiGuideTests): the Mistreated Virindi page as the player sent it, and a
|
||||
page shaped like his "Pistol" Pete sample. Never shipped. -->
|
||||
<EmbeddedResource Include="TestData\wiki.mistreated-virindi.txt" LogicalName="TestWiki.mistreated-virindi.txt" />
|
||||
<EmbeddedResource Include="TestData\wiki.pistol-pete.txt" LogicalName="TestWiki.pistol-pete.txt" />
|
||||
<EmbeddedResource Include="TestData\wiki.dynamic-stamps.txt" LogicalName="TestWiki.dynamic-stamps.txt" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\augmentations.csv" LogicalName="RynthOracle.augmentations.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\augquests.csv" LogicalName="RynthOracle.augquests.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\society.csv" LogicalName="RynthOracle.society.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\titles.csv" LogicalName="RynthOracle.titles.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\markers.csv" LogicalName="RynthOracle.markers.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\legendary.csv" LogicalName="RynthOracle.legendary.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\dynstamps.csv" LogicalName="RynthOracle.dynstamps.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\spellcategories.csv" LogicalName="RynthOracle.spellcategories.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\equipmentsets.csv" LogicalName="RynthOracle.equipmentsets.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\materials.csv" LogicalName="RynthOracle.materials.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\masteries.csv" LogicalName="RynthOracle.masteries.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthOracle\Resources\skills.csv" LogicalName="RynthOracle.skills.csv" />
|
||||
<EmbeddedResource Include="..\..\Plugins\RynthCore.Plugin.RynthAi\Combat\SpellData.txt" LogicalName="RynthOracle.SpellData.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,32 +21,34 @@ namespace RynthOracle.Tests
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Infinite Leaftide without RynthOracle (2026-10-21): its charms, pet breeding, Temple guardians,
|
||||
/// Dynamic Stamps, /qb list and feature list are RynthILT's own pages, so RynthOracle has none of
|
||||
/// their types, readers, tabs, tracker kinds or tag, on any world.
|
||||
/// Infinite Leaftide (2026-10-21, gated 2026-10-25): its charms, pet breeding, /qb list page and
|
||||
/// feature list are RynthILT's own pages; RynthOracle keeps only the Dynamic Stamps and Temple
|
||||
/// guardian rows of the Quests list (read from RynthILT), shown only while RynthCore's active
|
||||
/// server is "ilt". No server tags, no Pet Breeding tab, the same twelve tabs everywhere.
|
||||
/// </summary>
|
||||
private static void IltGone()
|
||||
{
|
||||
const System.Reflection.BindingFlags All = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Static
|
||||
| System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic;
|
||||
Type[] types = typeof(RynthOraclePlugin).Assembly.GetTypes();
|
||||
string[] iltTypes = Array.ConvertAll(Array.FindAll(types, t =>
|
||||
t.Name.StartsWith("Ilt", StringComparison.Ordinal) || t.Name.StartsWith("RynthIlt", StringComparison.Ordinal)
|
||||
|| t.Name.StartsWith("DynamicStamp", StringComparison.Ordinal)), t => t.FullName ?? t.Name);
|
||||
Check(iltTypes.Length == 0, "ilt: no RynthILT reader, view or Dynamic Stamp type in RynthOracle: " + string.Join(",", iltTypes));
|
||||
foreach (string field in new[] { "Ilt", "IltData", "Charms", "Breeding", "Guardian", "ToggleCharm", "BreedingCommand", "GuardianCommand", "UbGiveAvailable" })
|
||||
foreach (string field in new[] { "Charms", "Breeding", "ToggleCharm", "BreedingCommand", "UbGiveAvailable" })
|
||||
Check(typeof(OracleContext).GetField(field, All) == null, "ilt: OracleContext has no " + field);
|
||||
Check(typeof(OracleContext).Assembly.GetType("RynthCore.Plugin.RynthOracle.Data.ServerTags") == null, "ilt: no server tags at all");
|
||||
Check(typeof(OracleView).GetField("TabBreeding", All) == null, "ilt: no Pet Breeding tab");
|
||||
Check(Enum.GetNames<QuestKind>().Length == 3 && Enum.IsDefined(QuestKind.Marker), "ilt: the Quests list has quests, Legendary quests and markers only");
|
||||
Check(Enum.GetNames<QuestKind>().Length == 5 && Enum.IsDefined(QuestKind.Dynamic) && Enum.IsDefined(QuestKind.Guardian),
|
||||
"ilt: the Quests list's kinds include Dynamic Stamps and the Temple guardians");
|
||||
|
||||
var c = new OracleContext { InWorld = true };
|
||||
var view = new OracleView(c);
|
||||
foreach ((string tag, string world) in new[] { ("", "InfiniteLeaftide"), ("", "Coldeve") })
|
||||
foreach ((string id, string world, int kinds) in new[] { ("ilt", "InfiniteLeaftide", 5), ("", "InfiniteLeaftide", 3), ("", "Coldeve", 3), ("aelrynth", "Aeshnidae", 3) })
|
||||
{
|
||||
c.Server.Force(tag, world);
|
||||
c.Server.Force(id, world);
|
||||
string[] tabs = view.VisibleTabs();
|
||||
Check(Array.IndexOf(tabs, "Pet Breeding") < 0 && tabs.Length == 11, $"ilt: {world}: the same eleven tabs: " + string.Join(",", tabs));
|
||||
// ILT Tracker left the Oracle tab strip 2026-11-22 (own bar window); every server has the same twelve tabs.
|
||||
bool ilt = id == "ilt";
|
||||
Check(Array.IndexOf(tabs, "Pet Breeding") < 0 && tabs.Length == 12 && Array.IndexOf(tabs, OracleView.TabT11) < 0,
|
||||
$"ilt: {world} ({id}): the same twelve tabs (Gear included; ILT Tracker is its own bar window): " + string.Join(",", tabs));
|
||||
Check(c.Server.IsIlt == (id == "ilt"), $"ilt: {world} ({id}): IsIlt only for RynthCore's \"ilt\" server");
|
||||
Check(view.AvailableKinds().Count == kinds, $"ilt: {world} ({id}): {kinds} kinds of row (stamps and guardians only on ilt)");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
72
Tools/RynthOracle.Tests/SocietyQuestResolveTests.cs
Normal file
72
Tools/RynthOracle.Tests/SocietyQuestResolveTests.cs
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
using System.Collections.Generic;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// Society quest runs must use the player's CH / EW / RB alternatives (2026-11-22).
|
||||
internal static partial class Program
|
||||
{
|
||||
private static void SocietyQuestResolveTests()
|
||||
{
|
||||
var ew = new SocietyStanding(0, 150, 0);
|
||||
Check(SocietyQuestResolve.Code(ew) == "EW" && SocietyQuestResolve.StrongholdName(ew) == "Eldrytch Web Stronghold",
|
||||
"society resolve: EW code and stronghold name");
|
||||
|
||||
var palm = new GuideQuest
|
||||
{
|
||||
Title = "Palm Fort",
|
||||
SocietyRank = "Lord",
|
||||
StartsAt = "Moarsman City at: 92.1S, 50.3W (CH) 91.4S, 53.8W (EW) 93.6S, 51.8W (RB)",
|
||||
StartsWith = "Fort Commander",
|
||||
Steps =
|
||||
{
|
||||
new GuideStep
|
||||
{
|
||||
Text = "Speak to the Fort Commander of your respective faction to start.",
|
||||
Coords = { "91.4S, 53.8W", "93.6S, 51.8W", "92.1S, 50.3W" },
|
||||
},
|
||||
},
|
||||
};
|
||||
Check(SocietyQuestResolve.NeedsFilter(palm), "society resolve: Palm Fort needs a filter");
|
||||
GuideQuest ewPalm = SocietyQuestResolve.ForPlayer(palm, ew);
|
||||
Check(ewPalm.StartsAt.Contains("91.4S, 53.8W", System.StringComparison.OrdinalIgnoreCase)
|
||||
&& !ewPalm.StartsAt.Contains("92.1S", System.StringComparison.OrdinalIgnoreCase)
|
||||
&& !ewPalm.StartsAt.Contains("93.6S", System.StringComparison.OrdinalIgnoreCase),
|
||||
"society resolve: Palm Fort StartsAt keeps only EW coords");
|
||||
Check(ewPalm.Steps[0].Coords.Count == 1
|
||||
&& ewPalm.Steps[0].Coords[0].Contains("91.4S", System.StringComparison.OrdinalIgnoreCase),
|
||||
"society resolve: Palm Fort step coords keep only EW fort");
|
||||
|
||||
var dark = new GuideQuest
|
||||
{
|
||||
Title = "Dark Isle Delivery",
|
||||
SocietyRank = "Initiate",
|
||||
StartsAt = "Faction Stronghold (east wing)",
|
||||
StartsWith = "Erline the Fleet (CH) Aisley Swiftfoot (EW) Rheda the Watcher (RB)",
|
||||
Steps =
|
||||
{
|
||||
new GuideStep { Text = "Speak to the appropriate NPC in your Faction Stronghold to receive an ." },
|
||||
},
|
||||
};
|
||||
GuideQuest chDark = SocietyQuestResolve.ForPlayer(dark, new SocietyStanding(50, 0, 0));
|
||||
Check(chDark.StartsWith.Contains("Erline", System.StringComparison.OrdinalIgnoreCase)
|
||||
&& !chDark.StartsWith.Contains("Aisley", System.StringComparison.OrdinalIgnoreCase)
|
||||
&& !chDark.StartsWith.Contains("Rheda", System.StringComparison.OrdinalIgnoreCase),
|
||||
"society resolve: Dark Isle StartsWith keeps only CH NPC");
|
||||
Check(chDark.StartsAt.StartsWith("Celestial Hand Stronghold", System.StringComparison.Ordinal),
|
||||
"society resolve: Faction Stronghold → Celestial Hand Stronghold");
|
||||
Check(chDark.Steps[0].Text.Contains("Celestial Hand Stronghold", System.StringComparison.Ordinal),
|
||||
"society resolve: step text rewrites Faction Stronghold");
|
||||
|
||||
string hint = QuestRunner.PortalHint(chDark.Steps[0], new SocietyStanding(50, 0, 0));
|
||||
Check(hint.Contains("Celestial", System.StringComparison.OrdinalIgnoreCase)
|
||||
&& hint.Contains("Hand", System.StringComparison.OrdinalIgnoreCase)
|
||||
&& hint.Contains("Stronghold", System.StringComparison.OrdinalIgnoreCase),
|
||||
"society resolve: PortalHint prefers society stronghold words: " + hint);
|
||||
|
||||
// Not a member: leave the wiki page alone.
|
||||
GuideQuest raw = SocietyQuestResolve.ForPlayer(dark, default);
|
||||
Check(ReferenceEquals(raw, dark), "society resolve: non-member keeps the original quest");
|
||||
}
|
||||
}
|
||||
}
|
||||
98
Tools/RynthOracle.Tests/T11TrackingTests.cs
Normal file
98
Tools/RynthOracle.Tests/T11TrackingTests.cs
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// The T11 Tracking tab (2026-11-11; the ILT Tracker since 2026-11-21): ACECustom's ItemBountyDisplay and a levelled charm's appraisal.
|
||||
internal static partial class Program
|
||||
{
|
||||
private static void T11TrackingTests()
|
||||
{
|
||||
var slots = T11Tracking.ParseDisplay(
|
||||
"v2|R1,R2,B1,B2;R1|15|2|37.5|250|Banderlings|777708003|5|1|0|0|Bounty: Banderling Cull|Bounty Reward Token|Double click to bank it.|T15|Tier 15;"
|
||||
+ "R2|0|1|12|400||777708001|1|0|0|0|Valley Sweep|Bounty Reward Token||VoD|Valley of Death;B1|empty;B2|empty");
|
||||
Check(slots.Count == 4, "t11: four slots");
|
||||
Check(slots[0].Key == "R1" && slots[0].Tier == 15 && slots[0].Species && slots[0].Target == "Banderlings"
|
||||
&& slots[0].Kills == 250 && System.Math.Abs(slots[0].Progress - 37.5) < 0.001 && slots[0].RewardAmount == 5,
|
||||
"t11: a species bounty in a tier");
|
||||
Check(slots[0].Task == "Kill 250 Banderlings in Tier 15" && slots[0].Reward == "5 x Bounty Reward Token", "t11: its task and reward: " + slots[0].Task);
|
||||
Check(slots[1].PlaceShort == "VoD" && !slots[1].Species && slots[1].Task == "Kill 400 creatures in Valley of Death", "t11: a region sweep: " + slots[1].Task);
|
||||
Check(slots[2].Empty && slots[3].Key == "B2" && slots[3].Empty, "t11: empty slots");
|
||||
Check(T11Tracking.ParseDisplay("").Count == 0 && T11Tracking.ParseDisplay("junk").Count == 0, "t11: nothing from nothing");
|
||||
|
||||
var c = T11Tracking.ParseCharm("Charm [Level 41 (95% to 42)]\nPrestige Coins put in: 14,210 - next level in 46\n\nStatus: ON");
|
||||
Check(c.Known && c.Level == 41 && c.Pct == 95 && c.Coins == 14210 && c.ToNext == 46, "t11: a levelled charm's level and coins");
|
||||
var max = T11Tracking.ParseCharm("Charm [Level 100 (max)]\nPrestige Coins put in: 2,000,000");
|
||||
Check(max.Known && max.Level == 100 && max.ToNext == 0 && max.Coins == 2000000, "t11: at the top");
|
||||
Check(!T11Tracking.ParseCharm("Charm [Tier 2/3]").Known, "t11: a tiered charm isn't levelled");
|
||||
Check(T11Tracking.InfusionGems[777700097] == 5000 && T11Tracking.IsLumToken(777708004) && T11Tracking.IsLumToken(99980079), "t11: the gem and token tables");
|
||||
QuestBonusTests();
|
||||
GuideProgressTests();
|
||||
}
|
||||
|
||||
// The guide's four states and the kill task tag (2026-11-22).
|
||||
private static void GuideProgressTests()
|
||||
{
|
||||
var h5 = System.TimeSpan.FromHours(5);
|
||||
Check(GuideProgress.Of(0, 6, h5) == GuideProgressState.NotDone && GuideProgress.Of(0, 0, System.TimeSpan.Zero) == GuideProgressState.NotDone,
|
||||
"states: nothing held is not done");
|
||||
Check(GuideProgress.Of(6, 6, System.TimeSpan.Zero) == GuideProgressState.Done && GuideProgress.Of(6, 6, h5) == GuideProgressState.Done,
|
||||
"states: every stamp held is done, timer or not");
|
||||
Check(GuideProgress.Of(2, 6, h5) == GuideProgressState.PartialWaiting && GuideProgress.Of(2, 6, System.TimeSpan.Zero) == GuideProgressState.PartialReady,
|
||||
"states: partly done, waiting or ready");
|
||||
Check(GuideProgress.Text(GuideProgressState.PartialWaiting, 2, 6, h5, true).Status == "2/6 wait 5h"
|
||||
&& GuideProgress.Text(GuideProgressState.PartialReady, 2, 6, System.TimeSpan.Zero, true).Status == "2/6 ready"
|
||||
&& GuideProgress.Text(GuideProgressState.Done, 6, 6, System.TimeSpan.Zero, false).Status == "Done"
|
||||
&& GuideProgress.Text(GuideProgressState.Done, 6, 6, System.TimeSpan.Zero, true).Status == "Done, redo"
|
||||
&& GuideProgress.Text(GuideProgressState.Done, 6, 6, h5, true).Status == "Done 5h"
|
||||
&& GuideProgress.Text(GuideProgressState.NotDone, 0, 6, System.TimeSpan.Zero, false).Status == "Not done",
|
||||
"states: the list's words");
|
||||
Check(GuideProgress.Short(System.TimeSpan.FromMinutes(90)) == "1h 30m" && GuideProgress.Short(System.TimeSpan.FromDays(3)) == "3d",
|
||||
"states: short times");
|
||||
Check(GuideProgress.KillTag(true).Tag == "Again" && GuideProgress.KillTag(false).Tag == "1st", "kill tag: again or 1st");
|
||||
}
|
||||
|
||||
// The ILT Tracker's quest bonus (2026-11-21): ACECustom's /bonus and /qb lines, and the bonus levels.
|
||||
private static void QuestBonusTests()
|
||||
{
|
||||
Check(RynthCore.Plugin.RynthOracle.Views.OracleView.TabT11 == "ILT Tracker", "qb: the ILT Tracker bar window keeps that title");
|
||||
var t = new System.DateTime(2026, 11, 21, 20, 0, 0, System.DateTimeKind.Utc);
|
||||
var qb = new QuestBonus();
|
||||
Check(qb.OnChatLine("[BONUS] Your XP multiplier from Quests is: x2.35", t) && !qb.Bonus.Seen, "qb: a /bonus line is read, the reading waits for Total");
|
||||
qb.OnChatLine("[BONUS] Your XP multiplier from Equipment is: x1.10", t);
|
||||
qb.OnChatLine("[BONUS] Your XP multiplier from Enlightenment is: x3.00", t);
|
||||
Check(qb.OnChatLine("[BONUS] Your Total XP multiplier is: x7.76", t) && qb.Bonus.Seen
|
||||
&& qb.Bonus.Quests == 2.35 && qb.Bonus.Equipment == 1.10 && qb.Bonus.Enlightenment == 3.00 && qb.Bonus.Total == 7.76,
|
||||
"qb: the four /bonus multipliers");
|
||||
Check(QuestBonus.QbFromMultiplier(2.35) == 270 && QuestBonus.QbFromMultiplier(1) == 0, "qb: x2.35 from quests is 270 QB");
|
||||
Check(qb.OnChatLine("Your current quest bonus count: 1,234", t) && qb.ChatCount == 1234, "qb: the /qb count line");
|
||||
Check(!qb.OnChatLine("You say, \"[BONUS] Your Total XP multiplier is: x99\"", t) && qb.Bonus.Total == 7.76, "qb: chat that quotes it is not read");
|
||||
Check(System.Math.Abs(QuestBonus.Multiplier(270) - 2.35) < 1e-9, "qb: 0.5% XP a QB");
|
||||
// QB Deeds (ACECustom DeedsTiers): a tier every 1,000 QB, 15 in all.
|
||||
Check(QbDeeds.Tiers.Length == 15 && QbDeeds.Tiers[0].Qb == 1000 && QbDeeds.Tiers[14].Qb == 15000, "deeds: 15 tiers, 1,000 QB apart");
|
||||
Check(QbDeeds.TierFor(999) == 0 && QbDeeds.TierFor(1000) == 1 && QbDeeds.TierFor(12345) == 12 && QbDeeds.TierFor(99999) == 15,
|
||||
"deeds: 999 QB no tier, 1,000 tier 1, 12,345 tier 12, the top is 15");
|
||||
var (nt, nf, nl) = QbDeeds.Progress(12345);
|
||||
Check(nt == 13 && nl == 655 && System.Math.Abs(nf - 0.345f) < 1e-4, "deeds: 12,345 QB is 655 QB from tier 13");
|
||||
Check(QbDeeds.Progress(15000).Next == 0 && QbDeeds.Progress(0).Next == 1 && QbDeeds.Progress(0).ToNext == 1000, "deeds: the top, and nothing yet");
|
||||
Check(System.Math.Abs(QbDeeds.DamageBonus(2)) < 1e-9 && System.Math.Abs(QbDeeds.DamageBonus(9) - 0.06) < 1e-9
|
||||
&& System.Math.Abs(QbDeeds.DamageBonus(15) - 0.10) < 1e-9, "deeds: +2% damage at 3, 6, 9, 12, 15 (10% at the top)");
|
||||
Check(QbDeeds.Line(QbDeeds.Tiers[8]).EndsWith("+2% damage (6% in all)") && QbDeeds.Tiers[9].Summary.StartsWith("/rebuff"),
|
||||
"deeds: tier 9's damage step, tier 10's /rebuff");
|
||||
var prof = IltServerProfile.Parse("{\"ilt\":true,\"world\":\"Infinite Leaftide\",\"features\":[],\"deeds\":{\"loaded\":true,\"unsupported\":false,"
|
||||
+ "\"busy\":false,\"qb\":12345,\"on\":true,\"unlocked\":12,\"nextAt\":13000,\"status\":\"\",\"loadedUtc\":\"2026-11-21T21:30:00Z\","
|
||||
+ "\"tiers\":[{\"n\":1,\"qb\":1000,\"unlocked\":true,\"rewards\":[\"Legendary Strength\"]},{\"n\":13,\"qb\":13000,\"unlocked\":false,\"rewards\":[]}]}}");
|
||||
IltDeedsInfo? dd = prof.Deeds;
|
||||
Check(dd != null && dd.Loaded && dd.On == true && dd.Qb == 12345 && dd.Unlocked == 12 && dd.NextAt == 13000 && dd.Tiers.Count == 2
|
||||
&& dd.Tiers[0].Rewards[0] == "Legendary Strength" && !dd.Tiers[1].Unlocked && dd.LoadedUtc.Hour == 21, "deeds: RynthILT's /deeds read from the profile");
|
||||
Check(qb.BestCount(null, out _, dd) == 12345, "deeds: the /deeds QB first");
|
||||
Check(IltServerProfile.Parse("{\"ilt\":true,\"features\":[]}").Deeds == null, "deeds: an older RynthILT has none");
|
||||
Check(qb.BestCount(null, out string src) == 1234 && src == "/qb", "qb: without RynthILT the /qb count in chat");
|
||||
var ilt = new IltQuestBonusList(false, 1, 300, "", new[] { "a", "Dynamic_1_x" }, new[] { "b" });
|
||||
Check(qb.BestCount(ilt, out _) == 300 && QuestBonus.IsStamp("Dynamic_1_x") && !QuestBonus.IsStamp("a"), "qb: RynthILT's count first; stamps");
|
||||
int s0 = qb.Session;
|
||||
qb.Clear();
|
||||
Check(!qb.Bonus.Seen && qb.ChatCount == -1 && qb.Session == s0 + 1 && qb.BestCount(null, out _) == -1, "qb: logout forgets it");
|
||||
Check(IltWikiGuide.IsGuidePage(IltWikiGuide.BotPasswordsUrl) && !IltWikiGuide.IsGuidePage("https://example.com") && IltWikiGuide.Steps.Length == 6, "qb: the wiki guide opens only its own pages");
|
||||
}
|
||||
}
|
||||
}
|
||||
113
Tools/RynthOracle.Tests/TestData/wiki.dynamic-stamps.txt
Normal file
113
Tools/RynthOracle.Tests/TestData/wiki.dynamic-stamps.txt
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
<div style="float:right;">__TOC__</div>
|
||||
This is a list of dynamic stamps you can get by handing a sheet of parchment to the associated NPC, or at random by giving a QB Stipend to [[QB Dynamo]] (you will receive {{stamped|QBDynamo}} the first time you hand in the stipend).<br/>
|
||||
The first time you hand a parchment to an NPC you will get {{stamped|dynamicQuestFlag}}.<br/>
|
||||
Note, '''many''' of the coordinates are unlisted, click through to the specific NPC for the correct coordinates.
|
||||
|
||||
== '''Aluvian Town Network''' ==
|
||||
|
||||
=== [[Arwic]] ===
|
||||
|
||||
{| class="wikitable sortable mw-collapsible"
|
||||
! Name
|
||||
! Coordinates
|
||||
! Stamp
|
||||
! Item Reward
|
||||
! Notes
|
||||
|-
|
||||
| [[Hiyp the Toad]]
|
||||
| 33.6N, 56.8E
|
||||
|{{stamped|Dynamic_1_8M6jL^Bwr3S$p}}
|
||||
| Hearty Rabbit Noodle
|
||||
|
|
||||
|-
|
||||
| [[Anasha]]
|
||||
| 33.3N, 56.5E
|
||||
|{{stamped|Dynamic_1_AeNJevtTyE}}
|
||||
| Composite Bow
|
||||
|
|
||||
|-
|
||||
| [[John]]
|
||||
| 33.6N, 56.7E
|
||||
| {{stamped| Dynamic_1_w}}
|
||||
| Blackfire Stinging Atlan Axe
|
||||
|
|
||||
|}
|
||||
|
||||
=== [[Cragstone]] ===
|
||||
|
||||
{| class="wikitable sortable mw-collapsible"
|
||||
|-
|
||||
! Name
|
||||
! Coordinates
|
||||
! Stamp
|
||||
! Item Reward
|
||||
! Notes
|
||||
|-
|
||||
| [[Robert Crow]]
|
||||
| 25.5N 48.4E
|
||||
| {{stamped|Dynamic_1_lm9d1e7kD}}
|
||||
| Phantom Atlatl
|
||||
|
|
||||
|-
|
||||
| [[Gustuv Lansdown]]
|
||||
| 24.9N, 48.5E
|
||||
| {{stamped|Dynamic_1_LUpRb54QAfQluP}}
|
||||
| Acid Spear
|
||||
| Mill with Aug NPCs
|
||||
|}
|
||||
|
||||
== '''Gharu'ndim Town Network''' ==
|
||||
|
||||
=== [[Samsur]] ===
|
||||
{| class="wikitable sortable mw-collapsible"
|
||||
|-
|
||||
! Name !! Coordinates !! Stamp !! Item Reward !! Notes
|
||||
|-
|
||||
| [[Aun Akuarea]] || 2.6S, 19.9E || {{stamped|Dynamic_1_Bm^vMSa}} || Large Black Fish ||
|
||||
|-
|
||||
| [[Saelar's Apprentice]] || 2.5S, 16.4E || {{stamped|Dynamic_1_exnj4uW}} || Renegade Ukira of the Mountains || Mnemosyne Collection Site
|
||||
|}
|
||||
|
||||
== '''Unnetworked Locations''' ==
|
||||
|
||||
=== [[Kor-Gursha]] / [[Bur]] ===
|
||||
{| class="wikitable sortable mw-collapsible"
|
||||
|-
|
||||
! Name !! Coordinates !! Stamp !! Item Reward !! Notes
|
||||
|-
|
||||
| [[Drogur]] || || {{stamped|Dynamic_1_KS8e32dtk7t}} || Frost Yari ||
|
||||
|-
|
||||
| [[Rheegur]] || || NO STAMP || Perfect Coruscating Atlan Sword ||
|
||||
|}
|
||||
|
||||
=='''Hunting Camps'''==
|
||||
|
||||
=== [[Inner Sea Gear Knight Resistance Camp|Gear Knight Camp, Inner Sea]] ===
|
||||
{| class="wikitable sortable mw-collapsible"
|
||||
|-
|
||||
! Name !! Coordinates !! Stamp !! Item Reward !! Notes
|
||||
|-
|
||||
| [[Gear Knight Recruiter]] || 12.0N 45.0W || {{stamped|Dynamic_1_GkCampA}} || Gear Crossbow ||
|
||||
|-
|
||||
| [[Second Robert]] || || {{stamped|Dynamic_1_lm9d1e7kD}} || Duplicate || listed twice on the page
|
||||
|}
|
||||
|
||||
==Miscellaneous stamps==
|
||||
{| class="wikitable sortable"
|
||||
|-
|
||||
! Name !! Coordinates !! Stamp !! Item Reward !! Notes
|
||||
|-
|
||||
| [[Abbess Zik'Lir]] || 83.4S 97.2E || {{stamped|Dynamic_1_jmCfm1p5a}} || [[Hearty Fish Noodle]] || Ithaenc
|
||||
|-
|
||||
| [[Arikas, Warden of Knorr]] || || {{stamped|Dynamic_1_aWOWTc30f4}} || [[Hearty Healing Rabbit Noodle]] || [[Seat of Knorr]]
|
||||
|-
|
||||
| [[Golem Constructor]] || || NO STAMP || [[Chicken Sandwich]] || Tufa Hall of Metos
|
||||
|-
|
||||
| [[Liam of Gelid]] || || ? || [[?]] ||
|
||||
|}
|
||||
|
||||
==Original Unsorted List==
|
||||
|
||||
*{{stamped|Dynamic_1_0eHSd9aS}}
|
||||
*{{stamped|Dynamic_1_0eHSd9aS_d}}
|
||||
*{{stamped|Dynamic_1_0jBwR}}
|
||||
85
Tools/RynthOracle.Tests/TestData/wiki.mistreated-virindi.txt
Normal file
85
Tools/RynthOracle.Tests/TestData/wiki.mistreated-virindi.txt
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
{{Leaftide Content}}
|
||||
|
||||
{{Quest Summary
|
||||
| Level = 180+
|
||||
| Recommended Level = 275+
|
||||
| Quest Type = Solo/Fellowship
|
||||
| Kill Task =
|
||||
| Starts With = [[Mistreated Virindi]]
|
||||
| Starts At = [[Zaikhal]]
|
||||
| Route =
|
||||
| Repeat Timer = 20 Hours
|
||||
| Time to Complete = 30-60 Minutes
|
||||
| Contracts =
|
||||
| QB =
|
||||
}}
|
||||
== Overview ==
|
||||
Quest to upgrade Imbued Asteliary items from the old retail quest [[Simulacra Infiltrators]].
|
||||
|
||||
== Walkthrough & Notes ==
|
||||
# Talk to [[Mistreated Virindi]] in [[Zaikhal]] to start the quest.
|
||||
#* {{stamped|Sneaky_Virindi}}
|
||||
# Run to the [[Hidden Infiltrator Keep]] dungeon at 28.5S, 90.9W (layout is a clone of [[Northern Infiltrator Keep]]).
|
||||
#* Run from [[Mount Lethe]] or [[Ayan Baqur]]. Dungeon is tieable/recallable if you die.
|
||||
# Inside the dungeon, kill [[Tortured Ravener]]s and [[Damaged Doll]]s for a {{Itemlink|Shiny Red Stone}}.
|
||||
#* {{stamped|Shiny_Red_Stone_Found}}
|
||||
# Head to the end of the dungeon, where Guardian of the Asteliary is guarded by Alarming and Dark Simulacrum. He drops several {{Itemlink|Guardian of the Asteliary's Message Shard}} for QB.
|
||||
#* {{stamped|Guardian_of_the_Asteliary_Message_Shard}}
|
||||
# Head through the portal to the next dungeon, Asteliary Contentment.
|
||||
#* From this point forward, if you die you'll have to run through the first dungeon again.
|
||||
# Proceed through this linear dungeon to the end and take the portal to the final dungeon, Asteliary Pique.
|
||||
#* In this dungeon you'll find Asteliary Counselors and Dark Simulacrum. Be careful of the Dark Simulacrum missile attacks, as they hit hard.
|
||||
# Inside Asteliary Pique, kill [[The Architect]] and loot {{Itemlink|Vial of The Architect's Blood}}.
|
||||
#* {{stamped|Powerful_Blood_Obtained}}
|
||||
# Return the {{Itemlink|Vial of The Architect's Blood}} to the Mistreated Virindi in Zaikhal for 80 Enlightened Coins and a Hero Token.
|
||||
#* {{stamped|Blind_Revenge}}
|
||||
# Return the {{Itemlink|Shiny Red Stone}} to Ellie in Crater for 30 Enlightened Coins and 5 Mythical Keys.
|
||||
#* {{stamped|Shiny_Red_Stone_Turnin}}
|
||||
# Instead of turning in the {{Itemlink|Vial of The Architect's Blood}} to the Mistreated Virindi, you can upgrade an {{Itemlink|Imbued Helm of the Simulacra}}, {{Itemlink|Imbued Shield of the Simulacra}}, or {{Itemlink|Imbued Asteliary Orb}} to upgrade those items.
|
||||
|
||||
== Rewards ==
|
||||
{{Rewards Table
|
||||
| Quest Task = {{Itemlink|Vial of The Architect's Blood}}
|
||||
| Item Reward =
|
||||
* {{Icon Link|Enlightened Coin}} (x80)
|
||||
* {{Icon Link|Hero Token}} (x1)
|
||||
* {{Icon Link|Enlightenment Token}} (x2)
|
||||
OR the blood can instead be used to create one of the following:
|
||||
* {{Icon Link|Blood Soaked Helm of the Simulacra}}
|
||||
* {{Icon Link|Blood Soaked Shield of the Simulacra}}
|
||||
* {{Icon Link|Blood Soaked Asteliary Orb}}
|
||||
}}
|
||||
{{Rewards Table
|
||||
| Quest Task = {{Itemlink|Shiny Red Stone}}
|
||||
| Item Reward =
|
||||
* {{Icon Link|Enlightened Coin}} (x30)
|
||||
* {{Icon Link|Mythical Key}} (x5)
|
||||
}}
|
||||
|
||||
== Images ==
|
||||
Click image for full size version.
|
||||
|
||||
== Dialog ==
|
||||
{{Dialog|
|
||||
=== Opening Dialog ===
|
||||
|Mistreated Virindi tells you, "Hello Isparian...Hopefully you're not one of those evil ones?"
|
||||
|Mistreated Virindi tells you, "My apologies, I just have a hard time trusting your type. However, if you'll assist me, I believe I can actually help you too.."
|
||||
|Mistreated Virindi tells you, "I once despised your kind, Isparian. I served under a very powerful being who only reported to Aerbax himself. You may not know of him, but his creations.. I believe you call them Simulacrum."
|
||||
|Mistreated Virindi tells you, "With his power, we made these imposters and learned so much from your kind...Good, and evil. However, most of my kind believe to be the superior race, so once I began to question the morality of what we were doing..."
|
||||
|Mistreated Virindi tells you, "Well...I'm lucky to still be here.. But, I'll make you a deal! Go to the Direlands, by the west shore.. stop the evil creations and architect himself and i'll give you all that I have left, if you choose not to use the blood on something else... "
|
||||
|
||||
=== Rewards Dialog ===
|
||||
|Mistreated Virindi tells you, "It's funny that for so long our kind are fooled into thinking we are superior to all. You stand here as proof for your people..Thank you, warrior."
|
||||
|Ellie tells you, "Oh wow, it's so shiny! I could almost just just stare righ...uhh.. Wait, what was I saying? Oh right! Awesome find! Here!!"
|
||||
|
||||
=== Other Interactions ===
|
||||
|Guardian of the Asteliary tells you, "What!? A human enters my chambers? After all this time you finally found us... Now prepare to die!"
|
||||
}}
|
||||
|
||||
== Update History ==
|
||||
|
||||
04/26/2025:
|
||||
* Quest introduced.
|
||||
|
||||
|
||||
[[Category:Enlightened Coin Quests]]
|
||||
51
Tools/RynthOracle.Tests/TestData/wiki.pistol-pete.txt
Normal file
51
Tools/RynthOracle.Tests/TestData/wiki.pistol-pete.txt
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<!-- Test data for RynthOracle.Tests (WikiGuideTests): shaped like the "Pistol" Pete Trophy Hunts page the
|
||||
player pasted on 2026-11-01 (paragraph walkthrough, one paragraph per creature, stamps listed apart in
|
||||
QB Stamps). Abridged and re-typed for the tests; not the wiki's text. -->
|
||||
{{Leaftide Content}}
|
||||
|
||||
{{Quest Summary
|
||||
| Level = 275+
|
||||
| Recommended Aug Level =
|
||||
| Quest Type = Solo
|
||||
| Kill Task =
|
||||
| Starts With = [["Pistol" Pete]][[File:Pistol Pete.png|20px]]
|
||||
| Starts At = [[Candeth Keep]]
|
||||
| Route =
|
||||
| Repeat Timer = 7 Days
|
||||
| Time to Complete = 1-2 Hours
|
||||
| Contracts =
|
||||
| QB = 15
|
||||
}}
|
||||
== Discord Description ==
|
||||
Pete wants trophies from the rarest beasts of Dereth.
|
||||
|
||||
== Overview ==
|
||||
"Pistol" Pete in Candeth Keep collects trophies. Hunt each beast and bring him its trophy.
|
||||
|
||||
== Walkthrough & Notes ==
|
||||
Talk to [["Pistol" Pete]] in Candeth Keep to get the list of trophies.
|
||||
|
||||
The Nephrite Golem roams the hills at 85.4N 6.4W. Kill it and loot its {{Itemlink|Nephrite Tooth}}.
|
||||
|
||||
Winston the Mattekar wanders near 62.8S, 97.9E. Kill him for {{Itemlink|Winston's Leg}}.
|
||||
|
||||
The Frost Wyrm sleeps in a cave at 62.7s 66.6W; the cave's exit is at 85.8s,78.8w. Kill it and take its {{Itemlink|Frozen Wyrm Scale}}.
|
||||
|
||||
Return to Pete with all three trophies.
|
||||
|
||||
== QB Stamps ==
|
||||
* {{stamped|NephriteTooth}}
|
||||
* {{stamped|WinstonsLeg}}
|
||||
* {{stamped|FrostWyrmScale}}
|
||||
* {{stamped|PeteTrophiesDone}}
|
||||
|
||||
== Rewards ==
|
||||
{{Rewards Table
|
||||
| Quest Task = All three trophies
|
||||
| Item Reward =
|
||||
* {{Icon Link|Enlightened Coin}} (x50)
|
||||
| Luminance Reward = 2,000,000
|
||||
}}
|
||||
|
||||
[[Category:Enlightened Coin Quests]]
|
||||
[[Category:Weekly Quests]]
|
||||
277
Tools/RynthOracle.Tests/WikiGuideTests.cs
Normal file
277
Tools/RynthOracle.Tests/WikiGuideTests.cs
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using RynthCore.Plugin.RynthOracle;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
using RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
namespace RynthOracle.Tests
|
||||
{
|
||||
// The Infinite Leaftide wiki quest guide (2026-11-01): RynthILT reads leaftidewiki.com's quest pages
|
||||
// with WikiQuestParser and saves them as a QuestGuide; Oracle's Quests tab shows the steps. The two
|
||||
// page shapes the player sent: numbered steps with their stamps under them (Mistreated Virindi), and
|
||||
// paragraphs with the stamps listed apart ("Pistol" Pete).
|
||||
internal static partial class Program
|
||||
{
|
||||
private static string TestText(string name)
|
||||
{
|
||||
using Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream(name)
|
||||
?? throw new InvalidOperationException("missing test data " + name);
|
||||
using var r = new StreamReader(s);
|
||||
return r.ReadToEnd();
|
||||
}
|
||||
|
||||
private static void WikiGuide()
|
||||
{
|
||||
// ── Mistreated Virindi: numbered steps, "#*" stamps ───────────────
|
||||
GuideQuest v = WikiQuestParser.Parse("Mistreated Virindi", TestText("TestWiki.mistreated-virindi.txt"), 1234);
|
||||
Check(v.Title == "Mistreated Virindi" && v.Rev == 1234, "wiki: title and revision kept");
|
||||
Check(v.Url == "https://www.leaftidewiki.com/Mistreated_Virindi", "wiki: the page's address (" + v.Url + ")");
|
||||
Check(v.Level == "180+" && v.RecommendedLevel == "275+" && v.Type == "Solo/Fellowship", "wiki: the summary box's levels and type");
|
||||
Check(v.StartsWith == "Mistreated Virindi" && v.StartsAt == "Zaikhal", "wiki: starts with / at, links as their words");
|
||||
Check(v.Repeat == "20 Hours" && v.RepeatSec == 20 * 3600 && v.IsDaily && !v.IsWeekly && !v.IsOneTime, "wiki: 20 Hours is a daily");
|
||||
Check(v.Qb == 0, "wiki: an empty QB is 0");
|
||||
Check(v.Categories.SequenceEqual(new[] { "Enlightened Coin Quests" }), "wiki: categories");
|
||||
Check(v.Overview.StartsWith("Quest to upgrade Imbued Asteliary items") && v.Overview.Contains("Simulacra Infiltrators"), "wiki: overview cleaned");
|
||||
Check(v.Steps.Count == 10, $"wiki: ten numbered steps ({v.Steps.Count})");
|
||||
Check(v.Steps[0].Text == "Talk to Mistreated Virindi in Zaikhal to start the quest." && v.Steps[0].Stamps.SequenceEqual(new[] { "Sneaky_Virindi" }),
|
||||
"wiki: step 1 text, its #* stamp");
|
||||
Check(v.Steps[0].Notes.Count == 0, "wiki: a stamp-only sub-line is no note");
|
||||
Check(v.Steps[1].Coords.SequenceEqual(new[] { "28.5S, 90.9W" }) && v.Steps[1].Notes.Count == 1 && v.Steps[1].Notes[0].StartsWith("Run from Mount Lethe"),
|
||||
"wiki: step 2 coordinates and its tip");
|
||||
Check(v.Steps[2].Items.SequenceEqual(new[] { "Shiny Red Stone" }) && v.Steps[2].Text.Contains("Tortured Raveners") && v.Steps[2].Text.EndsWith("for a Shiny Red Stone."),
|
||||
"wiki: step 3 item, plural link kept whole");
|
||||
Check(v.Steps[9].Stamps.Count == 0 && v.Steps[9].Items.Count == 4, "wiki: the upgrade step names four items, no stamp");
|
||||
Check(v.AllStamps().SequenceEqual(new[] { "Sneaky_Virindi", "Shiny_Red_Stone_Found", "Guardian_of_the_Asteliary_Message_Shard",
|
||||
"Powerful_Blood_Obtained", "Blind_Revenge", "Shiny_Red_Stone_Turnin" }), "wiki: every stamp in order");
|
||||
Check(v.ExtraStamps.Count == 0, "wiki: no stamps left over");
|
||||
Check(v.Loot.SequenceEqual(new[] { "Shiny Red Stone", "Guardian of the Asteliary's Message Shard", "Vial of The Architect's Blood" }),
|
||||
"wiki: loot = the items killed or looted for, not the ones handed in or upgraded (" + string.Join(" | ", v.Loot) + ")");
|
||||
Check(v.Rewards.Contains("For Vial of The Architect's Blood:") && v.Rewards.Contains("Enlightened Coin (x80)") && v.Rewards.Contains("Mythical Key (x5)"),
|
||||
"wiki: both reward tables (" + string.Join(" | ", v.Rewards) + ")");
|
||||
Check(!v.Rewards.Any(r => r.Contains("{{") || r.Contains("[[")), "wiki: rewards have no markup left");
|
||||
|
||||
// ── "Pistol" Pete: paragraphs, stamps in QB Stamps ───────────────
|
||||
GuideQuest p = WikiQuestParser.Parse("\"Pistol\" Pete Trophy Hunts", TestText("TestWiki.pistol-pete.txt"));
|
||||
Check(p.StartsWith == "\"Pistol\" Pete", "pete: the NPC without its picture (" + p.StartsWith + ")");
|
||||
Check(p.RepeatSec == 7 * 86400 && p.IsWeekly && p.Qb == 15, "pete: weekly, QB 15");
|
||||
Check(p.Overview.StartsWith("\"Pistol\" Pete in Candeth Keep"), "pete: the Overview wins over the Discord Description");
|
||||
Check(p.Steps.Count == 5, $"pete: one step per paragraph ({p.Steps.Count})");
|
||||
Check(p.Steps[1].Coords.SequenceEqual(new[] { "85.4N, 6.4W" }) && p.Steps[2].Coords.SequenceEqual(new[] { "62.8S, 97.9E" }),
|
||||
"pete: '85.4N 6.4W' and '62.8S, 97.9E'");
|
||||
Check(p.Steps[3].Coords.SequenceEqual(new[] { "62.7S, 66.6W", "85.8S, 78.8W" }), "pete: '62.7s 66.6W' and '85.8s,78.8w' in one step");
|
||||
Check(p.Steps[1].Stamps.SequenceEqual(new[] { "NephriteTooth" }), "pete: NephriteTooth goes with the Nephrite Golem");
|
||||
Check(p.Steps[2].Stamps.SequenceEqual(new[] { "WinstonsLeg" }), "pete: WinstonsLeg goes with Winston");
|
||||
Check(p.Steps[3].Stamps.SequenceEqual(new[] { "FrostWyrmScale" }), "pete: FrostWyrmScale goes with the Frost Wyrm");
|
||||
Check(p.ExtraStamps.SequenceEqual(new[] { "PeteTrophiesDone" }), "pete: a stamp two steps could own is kept apart");
|
||||
Check(p.AllStamps().Count() == 4, "pete: four stamps in all");
|
||||
Check(p.Loot.SequenceEqual(new[] { "Nephrite Tooth", "Winston's Leg", "Frozen Wyrm Scale" }), "pete: the three trophies are the loot");
|
||||
Check(p.Rewards.Contains("Enlightened Coin (x50)") && p.Rewards.Contains("Luminance: 2,000,000"), "pete: rewards with luminance");
|
||||
|
||||
// ── Smaller pieces ───────────────────────────────────────────────
|
||||
Check(WikiQuestParser.RepeatSeconds("") == 0 && WikiQuestParser.RepeatSeconds("None") == 0 && WikiQuestParser.RepeatSeconds("Once") == 0, "repeat: none");
|
||||
Check(WikiQuestParser.RepeatSeconds("20h") == 72000 && WikiQuestParser.RepeatSeconds("3d 12h") == 3 * 86400 + 12 * 3600, "repeat: short forms");
|
||||
Check(WikiQuestParser.RepeatSeconds("1 Week") == 7 * 86400 && WikiQuestParser.RepeatSeconds("Daily") == 86400, "repeat: week, daily");
|
||||
Check(WikiQuestParser.RepeatSeconds("when the moon is full") == -1, "repeat: not understood is -1");
|
||||
Check(WikiQuestParser.Clean("Kill [[Tortured Ravener]]s and '''[[Damaged Doll|dolls]]''' {{Itemlink|X}}<br/>{{SomeBox|a=b}}") == "Kill Tortured Raveners and dolls X",
|
||||
"clean: links, bold, item templates, tags and other templates");
|
||||
Check(GuideStamp.Key("Shiny_Red_Stone_Found") == GuideStamp.Key("shinyredstonefound") && GuideStamp.Key("Shiny Red Stone Found") == "shinyredstonefound",
|
||||
"stamp: one key for every spelling");
|
||||
Check(GuideStamp.FromChat("You've stamped Sneaky_Virindi!") == "Sneaky_Virindi" && GuideStamp.FromChat("You say, \"hi\"") == null, "stamp: the server's line");
|
||||
Check(!WikiQuestParser.IsQuestPage("Just a page") && WikiQuestParser.IsQuestPage("{{Quest Summary|Level=1}}"), "wiki: only pages with the summary box are quests");
|
||||
|
||||
// ── The saved guide round-trips ──────────────────────────────────
|
||||
var g = new QuestGuide { Source = "api", UpdatedUtc = new DateTime(2026, 11, 1, 12, 0, 0, DateTimeKind.Utc) };
|
||||
g.Quests.Add(v);
|
||||
g.Quests.Add(p);
|
||||
QuestGuide back = QuestGuide.Parse(g.ToJson());
|
||||
Check(back.Source == "api" && back.UpdatedUtc == g.UpdatedUtc && back.Quests.Count == 2, "guide json: header and count");
|
||||
GuideQuest bv = back.Find("mistreated virindi")!;
|
||||
Check(bv != null && bv.Steps.Count == 10 && bv.Steps[1].Coords[0] == "28.5S, 90.9W" && bv.Rev == 1234 && bv.RepeatSec == 72000,
|
||||
"guide json: steps, coordinates, revision and timer come back");
|
||||
Check(bv!.AllStamps().SequenceEqual(v.AllStamps()) && bv.Loot.SequenceEqual(v.Loot) && bv.Rewards.SequenceEqual(v.Rewards), "guide json: stamps, loot, rewards");
|
||||
Check(back.Find("\"Pistol\" Pete Trophy Hunts")!.ExtraStamps.SequenceEqual(new[] { "PeteTrophiesDone" }), "guide json: extra stamps");
|
||||
Check(QuestGuide.Parse("not json").Quests.Count == 0 && QuestGuide.Parse("").Quests.Count == 0, "guide json: junk reads as empty");
|
||||
|
||||
// ── Special:Export ───────────────────────────────────────────────
|
||||
string xml = "<mediawiki xmlns=\"http://www.mediawiki.org/xml/export-0.11/\"><siteinfo><sitename>Leaftide</sitename></siteinfo>"
|
||||
+ "<page><title>Mistreated Virindi</title><ns>0</ns><id>77</id><revision><id>901</id><contributor><username>A</username><id>5</id></contributor>"
|
||||
+ "<text bytes=\"10\">{{Quest Summary|Level=1}}</text></revision></page>"
|
||||
+ "<page><title>Category:Quest Index</title><ns>14</ns><id>78</id><revision><id>902</id><text>x</text></revision></page>"
|
||||
+ "<page><title>Another</title><ns>0</ns><id>79</id><revision><id>903</id><text>y</text></revision></page></mediawiki>";
|
||||
var pages = WikiQuestParser.ReadExport(new StringReader(xml));
|
||||
Check(pages.Count == 2 && pages[0].Title == "Mistreated Virindi" && pages[0].Rev == 901 && pages[0].Text == "{{Quest Summary|Level=1}}"
|
||||
&& pages[1].Title == "Another" && pages[1].Rev == 903,
|
||||
"export: main-namespace pages with their revision ids and text (" + string.Join(", ", pages.Select(x => x.Title + "@" + x.Rev)) + ")");
|
||||
|
||||
WikiGuideView();
|
||||
}
|
||||
|
||||
/// <summary>The Quests tab's guide view: tabs, the two panes, stamps ticked, Run this quest and the loot map.</summary>
|
||||
private static void WikiGuideView()
|
||||
{
|
||||
GuideQuest v = WikiQuestParser.Parse("Mistreated Virindi", TestText("TestWiki.mistreated-virindi.txt"), 1);
|
||||
GuideQuest p = WikiQuestParser.Parse("\"Pistol\" Pete Trophy Hunts", TestText("TestWiki.pistol-pete.txt"), 2);
|
||||
var g = new QuestGuide { Source = "api", UpdatedUtc = DateTime.UtcNow };
|
||||
g.Quests.Add(p);
|
||||
g.Quests.Add(v);
|
||||
string file = Path.Combine(Path.GetTempPath(), "RynthOracleTests-" + Guid.NewGuid().ToString("N") + "-wiki-quests.json");
|
||||
File.WriteAllText(file, g.ToJson());
|
||||
|
||||
OracleContext c = On("ilt");
|
||||
var nav = new List<string>();
|
||||
var ai = new List<string>();
|
||||
var said = new List<string>();
|
||||
c.Runner = new QuestRunner(l => { nav.Add(l); return true; }, l => { ai.Add(l); return true; }, said.Add);
|
||||
var view = new OracleView(c);
|
||||
var host = new UiHost();
|
||||
UiWindow main = host.Add(new UiWindow("RynthOracle/Oracle", "Oracle") { Visible = true });
|
||||
Check(view.GuideTabs().Count == 10, "guide: ten tabs on Infinite Leaftide (Kill Tasks, Society and Contracts since 2026-11-21)");
|
||||
c.Settings.QuestGuideView = true;
|
||||
c.Settings.TabName = OracleView.TabQuests;
|
||||
|
||||
string body = Frame(host, main, view, "guide, no RynthILT");
|
||||
Check(body.Contains("RynthILT isn't serving them"), "guide: says when RynthILT has no guide");
|
||||
c.Guide.Take("{\"path\":" + System.Text.Json.JsonSerializer.Serialize(file) + ",\"revision\":4,\"count\":2,\"login\":true,\"running\":false,\"status\":\"2 quests.\"}");
|
||||
Check(c.Guide.Available && c.Guide.Guide.Quests.Count == 2, "guide client: reads the file the info names");
|
||||
int gr = c.Guide.Revision;
|
||||
c.Guide.Take("{\"path\":" + System.Text.Json.JsonSerializer.Serialize(file) + ",\"revision\":4,\"count\":2,\"login\":true,\"running\":false,\"status\":\"2 quests.\"}");
|
||||
Check(c.Guide.Revision == gr, "guide client: the same info again changes nothing");
|
||||
|
||||
view.ShowGuide(GuideTab.Wiki, "w:Mistreated Virindi");
|
||||
body = Frame(host, main, view, "guide, ILT Wiki", out int ops);
|
||||
Check(body.Contains("###g.r.w:Mistreated Virindi") && body.Contains("###g.r.w:\"Pistol\" Pete Trophy Hunts"), "guide: both wiki quests listed");
|
||||
Check(body.Contains("Not done") && body.Contains("Not done: none of its 6 stamps held yet."), "guide: no stamp held: Not done");
|
||||
Check(body.Contains("Daily (every 20h 00m)") && body.Contains("Run this quest") && body.Contains("Loot map (3)"), "guide: timer, Run, Loot map");
|
||||
Check(body.Contains("Starts with Mistreated Virindi at Zaikhal") && body.Contains("###g.start.go"), "guide: where it starts, with Go");
|
||||
Check(body.Contains("2. Run to the Hidden Infiltrator Keep") && body.Contains("Go 28.5S, 90.9W"), "guide: numbered steps with their Go buttons");
|
||||
Check(body.Contains("[ ] Sneaky_Virindi - not stamped yet") && !body.Contains("You've stamped"), "guide: stamps not held yet, said so");
|
||||
Check(body.Contains("0 of 6 stamps done this run. Still to get:") && body.Contains("Sneaky_Virindi (step 1)") && body.Contains("Blind_Revenge (step 8)"),
|
||||
"guide: the stamps still to get, each with its step");
|
||||
Check(body.Contains("[>] 1. Talk to Mistreated Virindi"), "guide: the next step is marked");
|
||||
Check(ops < 1500, $"guide: within the engine's op limit ({ops})");
|
||||
|
||||
// A stamp from chat ticks it at once.
|
||||
c.SessionStamps.Add(GuideStamp.Key("Sneaky_Virindi"));
|
||||
c.SessionStampRevision++;
|
||||
body = Frame(host, main, view, "guide, a stamp");
|
||||
Check(body.Contains("[x] You've stamped Sneaky_Virindi!") && body.Contains("1/6 ready"), "guide: a held stamp is ticked and counted (partly done, timer up)");
|
||||
Check(body.Contains("[x] 1. Talk to") && body.Contains("[>] 2. Run to the Hidden Infiltrator Keep"), "guide: step 1 done, step 2 next");
|
||||
Check(body.Contains("1 of 6 stamps done this run") && !body.Contains("Sneaky_Virindi (step 1)"), "guide: the done stamp leaves the still-to-get list");
|
||||
|
||||
// A later step stamped: the stampless step before it counts as passed ([~]).
|
||||
c.SessionStamps.Add(GuideStamp.Key("Shiny_Red_Stone_Found"));
|
||||
c.SessionStampRevision++;
|
||||
body = Frame(host, main, view, "guide, step 3 stamped");
|
||||
Check(body.Contains("[~] 2. Run to the Hidden Infiltrator Keep") && body.Contains("[x] 3. Inside the dungeon") && body.Contains("[>] 4."),
|
||||
"guide: a step with no stamp before a done one is passed; the next is step 4");
|
||||
|
||||
// A daily's stamp from yesterday (timer up) is "ready again", not done; inside its timer it is done.
|
||||
long ago = DateTimeOffset.UtcNow.AddHours(-30).ToUnixTimeSeconds(), recent = DateTimeOffset.UtcNow.AddHours(-2).ToUnixTimeSeconds();
|
||||
c.Flags.OnChatLine($"Blind_Revenge - 3 solves ({ago})\"Blind revenge\" -1 72000", c.NowMs);
|
||||
c.Flags.OnChatLine($"Powerful_Blood_Obtained - 3 solves ({recent})\"Blood\" -1 72000", c.NowMs);
|
||||
c.Flags.Tick(c.NowMs + 10_000);
|
||||
body = Frame(host, main, view, "guide, timers");
|
||||
Check(body.Contains("Blind_Revenge - done on an earlier run; ready again") && body.Contains("Blind_Revenge (step 8, done before: ready again)"),
|
||||
"guide: a daily stamped 30 h ago is ready again, not done ({c.Flags.Flags.Count} flags)");
|
||||
Check(body.Contains("[x] You've stamped Powerful_Blood_Obtained!"), "guide: one stamped 2 h ago (20 h timer) is done");
|
||||
// The four states (2026-11-22): 4 of 6 held, one of them inside its 20 h timer: partly done, waiting.
|
||||
Check((body.Contains("4/6 wait 18h") || body.Contains("4/6 wait 17h 5")) && body.Contains("Partly done: 4 of 6 stamps held, 2 still to get. The redo timer isn't up"),
|
||||
"guide: partly done, the redo timer not up");
|
||||
c.SessionStamps.Remove(GuideStamp.Key("Shiny_Red_Stone_Found")); // the run below starts before step 3
|
||||
c.SessionStampRevision++;
|
||||
|
||||
// Tabs.
|
||||
view.ShowGuide(GuideTab.Dailies);
|
||||
body = Frame(host, main, view, "guide, dailies");
|
||||
Check(body.Contains("###g.r.w:Mistreated Virindi") && !body.Contains("###g.r.w:\"Pistol\""), "guide: Dailies has the 20-hour quest only");
|
||||
view.ShowGuide(GuideTab.Qb);
|
||||
body = Frame(host, main, view, "guide, qb");
|
||||
Check(!body.Contains("###g.r.w:Mistreated Virindi") && body.Contains("###g.r.w:\"Pistol\""), "guide: QB has the QB 15 quest only");
|
||||
view.ShowGuide(GuideTab.Stamps);
|
||||
body = Frame(host, main, view, "guide, stamps", out int sops);
|
||||
Check(body.Contains("###g.r.a:" + DynamicStampList.Areas[0]) && sops < 1500, $"guide: Stamps lists the areas ({sops} ops)");
|
||||
view.ShowGuide(GuideTab.All);
|
||||
body = Frame(host, main, view, "guide, all", out int aops);
|
||||
Check(body.Contains("###g.r.w:Mistreated Virindi") && body.Contains("###g.page.next") && aops < 1500, $"guide: All pages the wiki and the quest list together ({aops} ops)");
|
||||
|
||||
// Run this quest (2026-11-07): the loot and its profile first, then the quest's first step, even when
|
||||
// its stamp is held from an earlier run.
|
||||
view.ShowGuide(GuideTab.Wiki, "w:Mistreated Virindi");
|
||||
Frame(host, main, view, "guide, before run");
|
||||
Click(host, main, "g.run");
|
||||
QuestRunner run = c.Runner!;
|
||||
Check(run.Active && run.Step == 0 && nav.Count == 1 && nav[0] == "go Mistreated Virindi || Zaikhal",
|
||||
"run: it starts at step 1 (its stamp from an earlier run doesn't count): " + string.Join(" | ", nav));
|
||||
run.Next();
|
||||
Check(run.Step == 1 && nav.Count == 2 && nav[1] == "go 28.5S, 90.9W", "run: Next goes to step 2's place: " + string.Join(" | ", nav));
|
||||
Check(ai.Count == 4 && ai[0] == "add Shiny Red Stone" && ai[2] == "add Vial of The Architect's Blood", "run: the loot goes to RynthAi: " + string.Join(" | ", ai));
|
||||
Check(ai[3].StartsWith("profile Mistreated Virindi|Shiny Red Stone|") && ai[3].EndsWith("|Vial of The Architect's Blood"),
|
||||
"run: RynthAi uses the quest's own loot profile meanwhile: " + ai[3]);
|
||||
body = Frame(host, main, view, "guide, running");
|
||||
Check(body.Contains("###g.stop") && body.Contains("###g.next") && body.Contains("going to 28.5S, 90.9W"), "run: Stop / Next and what it is doing");
|
||||
run.OnChat("[RynthNav] goto: arrived at 28.5S, 90.9W");
|
||||
Check(!run.Travelling && said.Exists(l => l.StartsWith("Step 2/10: Run to the Hidden Infiltrator Keep")), "run: arrival prints the step");
|
||||
Check(ai[^1].StartsWith("dungeon enter"), "run: the step goes into the Keep: RynthAi takes the portal there (2026-11-07)");
|
||||
run.Next();
|
||||
// A step without coordinates goes to what it names (2026-11-07); RynthNav doesn't know these two.
|
||||
Check(run.Step == 2 && nav.Count == 3 && nav[2] == "go Tortured Raveners || Damaged Dolls",
|
||||
"run: Next, a step without coordinates goes to the names in it: " + string.Join(" | ", nav));
|
||||
run.OnChat("[RynthNav] none of these is a place on the map: Tortured Raveners , Damaged Dolls");
|
||||
Check(run.Travelling && nav[^1] == "go 28.5S, 90.9W" && run.Note.Contains("going to 28.5S, 90.9W"),
|
||||
"run: names RynthNav doesn't know: the coordinates the quest gave last (" + run.Note + ")");
|
||||
Check(run.LastNpc == "", "run: a kill step talks to nobody");
|
||||
run.OnChat("You've stamped Shiny_Red_Stone_Found!");
|
||||
Check(run.Step == 3, "run: its stamp moves it on");
|
||||
run.OnChat("You've stamped Someone_Elses_Stamp!");
|
||||
Check(run.Step == 3, "run: another stamp doesn't");
|
||||
run.Stop();
|
||||
Check(!run.Active && ai.Contains("remove Shiny Red Stone") && ai[^1] == "profile off",
|
||||
"run: Stop takes the loot off RynthAi's list and goes back to the loot profile before: " + string.Join(" | ", ai));
|
||||
Check(run.BuildProfile(v) && ai[^1].StartsWith("build Mistreated Virindi|Shiny Red Stone|"), "Loot profile: RynthAi writes the quest's profile");
|
||||
|
||||
// Pete: the paragraph quest goes to each of the Frost Wyrm step's two places.
|
||||
nav.Clear();
|
||||
run.Start(p, s => c.SessionStamps.Contains(GuideStamp.Key(s)), loot: false);
|
||||
// Stamped during the run: those steps are passed over.
|
||||
c.SessionStamps.Add(GuideStamp.Key("NephriteTooth"));
|
||||
c.SessionStamps.Add(GuideStamp.Key("WinstonsLeg"));
|
||||
Check(run.Step == 0 && nav.Count == 1 && nav[0] == "go \"Pistol\" Pete || Pistol Pete || Candeth Keep",
|
||||
"pete: a first step without coordinates goes to the quest's person, then where it starts: " + string.Join(" | ", nav));
|
||||
run.Next();
|
||||
Check(run.Step == 3 && nav[^1] == "go 62.7S, 66.6W", "pete: the stamped steps are skipped");
|
||||
run.Next();
|
||||
Check(run.Step == 3 && run.Place == 1 && nav[^1] == "go 85.8S, 78.8W", "pete: Next goes to the step's second place");
|
||||
run.OnChat("You've stamped FrostWyrmScale!");
|
||||
Check(run.Step == 4 && nav[^1] == "go \"Pistol\" Pete || Pistol Pete", "pete: the last step goes to Pete: " + string.Join(" | ", nav));
|
||||
int aiBefore = ai.Count;
|
||||
run.OnChat("[RynthNav] goto: arrived");
|
||||
Check(said.Exists(l => l.StartsWith("Step 5/5: Return to Pete")) && run.LastNpc == "handin" && ai.Count == aiBefore + 1
|
||||
&& ai[^1].StartsWith("handin \"Pistol\" Pete || Pistol Pete"),
|
||||
"pete: there, RynthAi hands Pete the trophies: " + (ai.Count > aiBefore ? ai[^1] : "nothing sent"));
|
||||
run.Next();
|
||||
Check(!run.Active && said.Exists(l => l.Contains("Quest run done") && l.Contains("PeteTrophiesDone")), "pete: done, naming the stamps no step had");
|
||||
|
||||
// Hide collected.
|
||||
c.SessionStamps.Add(GuideStamp.Key("FrostWyrmScale"));
|
||||
c.SessionStamps.Add(GuideStamp.Key("PeteTrophiesDone"));
|
||||
c.SessionStampRevision++;
|
||||
c.Settings.GuideHideCollected = true;
|
||||
view.ShowGuide(GuideTab.Wiki);
|
||||
body = Frame(host, main, view, "guide, hide collected");
|
||||
Check(!body.Contains("###g.r.w:\"Pistol\"") && body.Contains("###g.r.w:Mistreated Virindi"), "guide: Hide collected leaves out a quest with every stamp");
|
||||
c.Settings.GuideHideCollected = false;
|
||||
|
||||
// Off Infinite Leaftide: the wiki tabs too (the AC Community Wiki: none read here), the flag list a click away.
|
||||
c.Server.Force("", "Coldeve");
|
||||
Check(view.GuideTabs().Count == 8 && !view.GuideTabs().Contains(GuideTab.Qb) && !view.GuideTabs().Contains(GuideTab.Stamps), "guide: eight tabs elsewhere (the wiki tabs, not QB or Stamps)");
|
||||
body = Frame(host, main, view, "guide, retail");
|
||||
Check(!body.Contains("###g.r.w:") && body.Contains("###q.view.flags"), "guide: no ILT wiki quests off ILT (the AC Wiki has none here); the Flag list switch");
|
||||
c.Settings.QuestGuideView = false;
|
||||
File.Delete(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue