Snapshot for release 2026.10.20.1 (internal 7116fab)
This commit is contained in:
parent
2a20c7acd6
commit
bfcd48950d
215 changed files with 16200 additions and 2838 deletions
|
|
@ -1,265 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
/// <summary>A board in Aelrynth's /top overview.</summary>
|
||||
internal sealed class AelrynthBoardSummary
|
||||
{
|
||||
public string Key = "", Title = "", Leader = "", Value = "";
|
||||
}
|
||||
|
||||
/// <summary>Your standing on one board ("/top me").</summary>
|
||||
internal sealed class AelrynthStanding
|
||||
{
|
||||
public string Title = "";
|
||||
public int Rank;
|
||||
public int Of;
|
||||
public string Value = "";
|
||||
}
|
||||
|
||||
/// <summary>A line of the "/trial" overview: a dungeon's record, yours and this week's best.</summary>
|
||||
internal sealed class TrialDungeon
|
||||
{
|
||||
public string Name = "", Landblock = "", Record = "", You = "", Week = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aelrynth's leaderboards (tag Aelrynth), read from the replies of the server's own commands
|
||||
/// (ACEPublic Mods: Aeshnidae.Leaderboard /top, Aeshnidae.Trials /trial; one Broadcast line
|
||||
/// each, numbers with thousands separators). Formats (Commands.cs):
|
||||
/// /top "Leaderboards - N characters, refreshed X. /top <board> ..."
|
||||
/// then " key Title: Leader, value" (or ": nobody yet")
|
||||
/// /top <board> "Title - top K of N[, counted since ...][, per account]:"
|
||||
/// then " r. Name value[ extra][ <- you]", " ... you: #r with v", " nobody yet."
|
||||
/// /top me "Name on the boards:" then " Title #r of N, value" or " Title -"
|
||||
/// /trial a few intro lines, then " Dungeon (LLLL): records | you: ... | this week: ..."
|
||||
/// /trial <dungeon> "Dungeon (LLLL) - top 10, best per character, any tier:"
|
||||
/// then " r. m:ss Name (tier T, K kills, d MMM)" and " records per tier/you/this week" lines
|
||||
/// Entry lines only count right after their header (within a few seconds), so ordinary chat
|
||||
/// can't add rows. The two commands share /top with ConquestAC's very different reply, which is
|
||||
/// why each parser only runs on its own server.
|
||||
/// </summary>
|
||||
internal sealed class AelrynthBoards
|
||||
{
|
||||
private const long BlockMs = 4000;
|
||||
|
||||
private static readonly Regex OverviewHeader = new(@"^\s*Leaderboards - ([\d,]+) characters, refreshed (.+?)\.\s");
|
||||
private static readonly Regex OverviewEntry = new(@"^\s*(\S+)\s+(.+?): (?:(.+), ([\d,]+)|nobody yet)\s*$");
|
||||
private static readonly Regex BoardHeader = new(@"^\s*(.+?) - top (\d+) of (\d+)(.*):\s*$");
|
||||
private static readonly Regex BoardEntry = new(@"^\s*(\d+)\.\s+(.+?)\s+([\d,]+)(?:\s{2,}(?!<-)(.+?))?(\s{2,}<- you)?\s*$");
|
||||
private static readonly Regex BoardYouBelow = new(@"^\s*\.\.\.\s+you: #(\d+) with ([\d,]+)\s*$");
|
||||
private static readonly Regex MeHeader = new(@"^\s*(.+?) on the boards:\s*$");
|
||||
private static readonly Regex MeEntry = new(@"^\s*(.+?)\s+#(\d+) of (\d+), ([\d,]+)\s*$");
|
||||
private static readonly Regex MeNone = new(@"^\s*(.+?)\s+-\s*$");
|
||||
private static readonly Regex OneMe = new(@"^\s*(.+?): you are #(\d+) of (\d+) with ([\d,]+)");
|
||||
private static readonly Regex TopError = new(@"^\s*(?:No board called '|Leaderboards are unavailable|The boards are still being built)");
|
||||
private static readonly Regex TrialDungeonLine = new(@"^\s*(.+?) \(([0-9A-Fa-f]{4})\): (.+?) \| you: (.+?) \| this week: (.+?)\s*$");
|
||||
private static readonly Regex TrialBoardHeader = new(@"^\s*(.+?) \(([0-9A-Fa-f]{4})\) - top 10, best per character, any tier:\s*$");
|
||||
private static readonly Regex TrialEntry = new(@"^\s*(\d+)\.\s+(\d+:\d{2}(?::\d{2})?)\s+(.+?) \((.+)\)\s*$");
|
||||
private static readonly Regex TrialNote = new(@"^\s*(?:records per tier|you|this week \([^)]*\)):\s");
|
||||
private static readonly Regex TrialError = new(@"^\s*(?:No Trial matches '|The Trials are switched off|The Trials could not be read)");
|
||||
private static readonly Regex TrialIntro = new(@"^\s*Trials - a fresh personal copy of a listed dungeon");
|
||||
private static readonly Regex TrialExtra = new(@"^\s*(?:your next attempt here: in \d+ min|running now: .+|Trophy: the week's fastest clear .+)$");
|
||||
|
||||
private enum Block { None, Overview, Board, Me, TrialList, TrialBoard }
|
||||
|
||||
public readonly List<AelrynthBoardSummary> Overview = new();
|
||||
public string OverviewNote = "";
|
||||
public string BoardTitle = "", BoardNote = "";
|
||||
public readonly List<BoardRow> BoardRows = new();
|
||||
public string BoardYou = "";
|
||||
public readonly List<AelrynthStanding> Standings = new();
|
||||
public readonly List<TrialDungeon> Trials = new();
|
||||
public readonly List<string> TrialLines = new();
|
||||
public string TrialBoardTitle = "";
|
||||
public readonly List<BoardRow> TrialRows = new();
|
||||
public readonly List<string> TrialNotes = new();
|
||||
public string LastError = "";
|
||||
public int Revision { get; private set; }
|
||||
|
||||
private Block _block;
|
||||
private long _blockMs;
|
||||
private readonly ChatRequest _topReq = new(), _trialReq = new();
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Overview.Clear(); BoardRows.Clear(); Standings.Clear(); Trials.Clear(); TrialLines.Clear(); TrialRows.Clear(); TrialNotes.Clear();
|
||||
OverviewNote = BoardTitle = BoardNote = BoardYou = TrialBoardTitle = LastError = "";
|
||||
_block = Block.None;
|
||||
Revision++;
|
||||
}
|
||||
|
||||
public string RequestTop(string arg, long now)
|
||||
{
|
||||
_topReq.Sent(now);
|
||||
LastError = "";
|
||||
if (string.IsNullOrWhiteSpace(arg)) { BoardTitle = ""; BoardRows.Clear(); }
|
||||
return string.IsNullOrWhiteSpace(arg) ? "/top" : "/top " + arg.Trim();
|
||||
}
|
||||
|
||||
public string RequestTrial(string arg, long now)
|
||||
{
|
||||
_trialReq.Sent(now);
|
||||
LastError = "";
|
||||
return string.IsNullOrWhiteSpace(arg) ? "/trial" : "/trial " + arg.Trim();
|
||||
}
|
||||
|
||||
private bool InBlock(Block b, long now) => _block == b && now - _blockMs < BlockMs;
|
||||
|
||||
private void Start(Block b, long now) { _block = b; _blockMs = now; }
|
||||
|
||||
/// <summary>A chat line: true when it was a leaderboard reply; <paramref name="ours"/> = it answers RynthOracle's request.</summary>
|
||||
public bool OnChatLine(string text, long now, out bool ours)
|
||||
{
|
||||
ours = false;
|
||||
Match m;
|
||||
|
||||
if ((m = OverviewHeader.Match(text)).Success)
|
||||
{
|
||||
Overview.Clear();
|
||||
OverviewNote = $"{m.Groups[1].Value} characters, refreshed {m.Groups[2].Value}";
|
||||
Start(Block.Overview, now);
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if ((m = TrialBoardHeader.Match(text)).Success)
|
||||
{
|
||||
TrialBoardTitle = $"{m.Groups[1].Value} ({m.Groups[2].Value.ToUpperInvariant()})";
|
||||
TrialRows.Clear();
|
||||
TrialNotes.Clear();
|
||||
Start(Block.TrialBoard, now);
|
||||
return Mine(_trialReq, now, out ours);
|
||||
}
|
||||
if ((m = BoardHeader.Match(text)).Success && !text.Contains(" on the boards", StringComparison.Ordinal))
|
||||
{
|
||||
BoardTitle = m.Groups[1].Value.Trim();
|
||||
BoardNote = $"top {m.Groups[2].Value} of {m.Groups[3].Value}{m.Groups[4].Value}";
|
||||
BoardRows.Clear();
|
||||
BoardYou = "";
|
||||
Start(Block.Board, now);
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if ((m = MeHeader.Match(text)).Success)
|
||||
{
|
||||
Standings.Clear();
|
||||
Start(Block.Me, now);
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if ((m = OneMe.Match(text)).Success)
|
||||
{
|
||||
BoardYou = $"{m.Groups[1].Value}: #{m.Groups[2].Value} of {m.Groups[3].Value} with {m.Groups[4].Value}";
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if (TopError.IsMatch(text))
|
||||
{
|
||||
LastError = text.Trim();
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if (TrialError.IsMatch(text))
|
||||
{
|
||||
LastError = text.Trim();
|
||||
return Mine(_trialReq, now, out ours);
|
||||
}
|
||||
if ((m = TrialDungeonLine.Match(text)).Success)
|
||||
{
|
||||
if (!InBlock(Block.TrialList, now)) { Trials.Clear(); TrialLines.Clear(); }
|
||||
Trials.Add(new TrialDungeon
|
||||
{
|
||||
Name = m.Groups[1].Value.Trim(), Landblock = m.Groups[2].Value.ToUpperInvariant(),
|
||||
Record = m.Groups[3].Value.Trim(), You = m.Groups[4].Value.Trim(), Week = m.Groups[5].Value.Trim(),
|
||||
});
|
||||
Start(Block.TrialList, now);
|
||||
return Mine(_trialReq, now, out ours);
|
||||
}
|
||||
|
||||
if (InBlock(Block.Overview, now) && (m = OverviewEntry.Match(text)).Success)
|
||||
{
|
||||
Overview.Add(new AelrynthBoardSummary
|
||||
{
|
||||
Key = m.Groups[1].Value, Title = m.Groups[2].Value.Trim(),
|
||||
Leader = m.Groups[3].Success ? m.Groups[3].Value.Trim() : "nobody yet",
|
||||
Value = m.Groups[4].Success ? m.Groups[4].Value : "",
|
||||
});
|
||||
_blockMs = now;
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if (InBlock(Block.Board, now))
|
||||
{
|
||||
if ((m = BoardEntry.Match(text)).Success)
|
||||
{
|
||||
int.TryParse(m.Groups[1].Value, out int rank);
|
||||
BoardRows.Add(new BoardRow
|
||||
{
|
||||
Rank = rank, Name = m.Groups[2].Value.Trim(), Value = m.Groups[3].Value,
|
||||
Extra = m.Groups[4].Success ? m.Groups[4].Value.Trim() : "", IsYou = m.Groups[5].Success,
|
||||
});
|
||||
_blockMs = now;
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if ((m = BoardYouBelow.Match(text)).Success)
|
||||
{
|
||||
BoardYou = $"you: #{m.Groups[1].Value} with {m.Groups[2].Value}";
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if (text.Trim() == "nobody yet.") return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if (InBlock(Block.Me, now))
|
||||
{
|
||||
if ((m = MeEntry.Match(text)).Success)
|
||||
{
|
||||
int.TryParse(m.Groups[2].Value, out int r);
|
||||
int.TryParse(m.Groups[3].Value, out int of);
|
||||
Standings.Add(new AelrynthStanding { Title = m.Groups[1].Value.Trim(), Rank = r, Of = of, Value = m.Groups[4].Value });
|
||||
_blockMs = now;
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
if ((m = MeNone.Match(text)).Success)
|
||||
{
|
||||
Standings.Add(new AelrynthStanding { Title = m.Groups[1].Value.Trim() });
|
||||
_blockMs = now;
|
||||
return Mine(_topReq, now, out ours);
|
||||
}
|
||||
}
|
||||
if (InBlock(Block.TrialBoard, now))
|
||||
{
|
||||
if ((m = TrialEntry.Match(text)).Success)
|
||||
{
|
||||
int.TryParse(m.Groups[1].Value, out int rank);
|
||||
TrialRows.Add(new BoardRow { Rank = rank, Value = m.Groups[2].Value, Name = m.Groups[3].Value.Trim(), Extra = m.Groups[4].Value.Trim() });
|
||||
_blockMs = now;
|
||||
return Mine(_trialReq, now, out ours);
|
||||
}
|
||||
if (TrialNote.IsMatch(text) || text.Trim() == "no clear yet")
|
||||
{
|
||||
TrialNotes.Add(text.Trim());
|
||||
_blockMs = now;
|
||||
return Mine(_trialReq, now, out ours);
|
||||
}
|
||||
}
|
||||
// The rest of a /trial overview: the intro, "next attempt", "running now" and trophy lines.
|
||||
if (TrialIntro.IsMatch(text))
|
||||
{
|
||||
Trials.Clear();
|
||||
TrialLines.Clear();
|
||||
TrialLines.Add(text.Trim());
|
||||
Start(Block.TrialList, now);
|
||||
return Mine(_trialReq, now, out ours);
|
||||
}
|
||||
if (InBlock(Block.TrialList, now) && TrialExtra.IsMatch(text))
|
||||
{
|
||||
TrialLines.Add(text.Trim());
|
||||
_blockMs = now;
|
||||
return Mine(_trialReq, now, out ours);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool Mine(ChatRequest req, long now, out bool ours)
|
||||
{
|
||||
ours = req.Awaiting(now);
|
||||
req.Extend(now);
|
||||
Revision++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
// Ported from Oracle of Dereth by Advis Eveldan (advis61), MIT. See THIRD_PARTY_NOTICES.md.
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
/// <summary>
|
||||
/// RynthOracle sent a server command and expects its reply for a few seconds, so the chat
|
||||
/// handler can tell its own reply from the same command typed by hand (only ours may be hidden).
|
||||
/// A time window, as upstream: these replies carry nothing tying them to the request. Each line
|
||||
/// of the reply extends it, so a long reply stays ours to its end.
|
||||
/// </summary>
|
||||
internal sealed class ChatRequest
|
||||
{
|
||||
private const long WindowMs = 5000;
|
||||
private long _untilMs;
|
||||
|
||||
public void Sent(long nowMs) => _untilMs = nowMs + WindowMs;
|
||||
public void Clear() => _untilMs = 0;
|
||||
public bool Awaiting(long nowMs) => nowMs < _untilMs;
|
||||
|
||||
/// <summary>A reply line arrived: keep the window open a little longer.</summary>
|
||||
public void Extend(long nowMs)
|
||||
{
|
||||
if (Awaiting(nowMs)) _untilMs = nowMs + 2000 > _untilMs ? nowMs + 2000 : _untilMs;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,426 +0,0 @@
|
|||
// Ported from Oracle of Dereth by Advis Eveldan (advis61), MIT. See THIRD_PARTY_NOTICES.md.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
/// <summary>A labelled value from a server reply ("Pyreals" = "1,039,678,533 (4,158 MMDs)").</summary>
|
||||
internal sealed class NamedValue
|
||||
{
|
||||
public string Name = "";
|
||||
public string Value = "";
|
||||
}
|
||||
|
||||
/// <summary>One of ConquestAC's advanced augmentations (counts from "/augs").</summary>
|
||||
internal sealed class ConquestAug
|
||||
{
|
||||
public readonly string Name;
|
||||
public readonly int CoinCost;
|
||||
public readonly double LumBase, LumPercent;
|
||||
public int Count;
|
||||
|
||||
public ConquestAug(string name, int coinCost, double lumBase, double lumPercent)
|
||||
{
|
||||
Name = name; CoinCost = coinCost; LumBase = lumBase; LumPercent = lumPercent;
|
||||
}
|
||||
|
||||
/// <summary>The next purchase's luminance (Conquest-ACE's tiered cost, as upstream mirrors it).</summary>
|
||||
public long NextLuminanceCost()
|
||||
{
|
||||
long idx = Count;
|
||||
(double tierBase, long pos) = idx >= 65 ? (LumBase * 30.0, idx - 65)
|
||||
: idx >= 60 ? (LumBase * 12.0, idx - 60)
|
||||
: idx >= 30 ? (LumBase * 4.8, idx - 30)
|
||||
: idx >= 15 ? (LumBase * 2.4, idx - 15)
|
||||
: (LumBase, idx);
|
||||
// The server truncates to long; the epsilon keeps 6,229,499.9999 (binary floating point) at the
|
||||
// confirmed in-game 6,229,500 (Creature at 25).
|
||||
return (long)(tierBase * (1.0 + pos * LumPercent) + 1e-6);
|
||||
}
|
||||
|
||||
public string NextCostText() =>
|
||||
$"{CoinCost} coins, {(NextLuminanceCost() / 1_000_000.0).ToString("0.##", CultureInfo.InvariantCulture)}M lum";
|
||||
|
||||
private double ResistPercent()
|
||||
{
|
||||
const double MaxBonus = 0.32, LinearRate = 0.003, Tuning = 0.0034597;
|
||||
const int LinearCap = 10;
|
||||
if (Count <= 0) return 0.0;
|
||||
double bonus = Count <= LinearCap
|
||||
? Count * LinearRate
|
||||
: LinearCap * LinearRate + (MaxBonus - LinearCap * LinearRate) * (1.0 - Math.Pow(1.0 - Tuning, Count - LinearCap));
|
||||
return Math.Min(bonus, MaxBonus) * 100.0;
|
||||
}
|
||||
|
||||
/// <summary>The effect at the current count (upstream's reading of the Conquest-ACE source).</summary>
|
||||
public string Effect() => Name switch
|
||||
{
|
||||
"Creature" => $"+{Count} to creature buffs, -{Count} to debuffs",
|
||||
"Item" => $"+{Count}% attack/melee, +{Count * 0.5:0.#} blood/spirit, +{Count} AL",
|
||||
"Life" => $"+{ResistPercent():0.##}% prot, +{ResistPercent():0.##}% vuln, +{Count * 0.10:0.##} regen, +{Count / 10} surge rating",
|
||||
"War" => $"+{Count * 2}% war magic potency",
|
||||
"Void" => $"+{Count * 1.5:0.##}% void magic potency",
|
||||
"Melee" => $"+{Count} melee damage, +{Count * 1.5:0.#}% crit damage",
|
||||
"Missile" => $"+{Count} missile damage, +{Count * 1.5:0.#}% crit damage",
|
||||
"Duration" => $"+{Count * 5}% spell duration",
|
||||
"Specialization" => $"+{Count} skill spec cap (now {70 + Count})",
|
||||
_ => "",
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>A fellowship from "/fship list".</summary>
|
||||
internal sealed class ConquestFellowship
|
||||
{
|
||||
public string Name = "", Leader = "", Members = "", Location = "";
|
||||
|
||||
public int MemberCount
|
||||
{
|
||||
get
|
||||
{
|
||||
int slash = Members.IndexOf('/');
|
||||
return int.TryParse(slash >= 0 ? Members[..slash] : Members, out int n) ? n : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A row of a leaderboard.</summary>
|
||||
internal sealed class BoardRow
|
||||
{
|
||||
public int Rank;
|
||||
public string Name = "";
|
||||
public string Value = "";
|
||||
public string Extra = "";
|
||||
public bool IsYou;
|
||||
}
|
||||
|
||||
/// <summary>One of ConquestAC's /top boards.</summary>
|
||||
internal sealed class ConquestBoard
|
||||
{
|
||||
public readonly string Key, Label, Header;
|
||||
public readonly List<BoardRow> Rows = new();
|
||||
public BoardRow? You;
|
||||
public DateTime UpdatedUtc = DateTime.MinValue;
|
||||
|
||||
public ConquestBoard(string key, string label, string header) { Key = key; Label = label; Header = header; }
|
||||
|
||||
public string Command => "/top " + Key;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Everything ConquestAC-only (tag Conquest): bank balances and bank commands ("/b", "/bank"),
|
||||
/// advanced augmentations ("/augs"), enlightenment augmentations ("/enl augs"), the XP bonus
|
||||
/// breakdown ("/bonus"), fellowships looking for members ("/fship list"), the /top boards, and
|
||||
/// the void damage-over-time duration scaling. The plugin only feeds it chat and only shows it
|
||||
/// while the server is ConquestAC; every reply regex is anchored at the start of the line (after
|
||||
/// an optional chat timestamp), as upstream does, so a pasted copy in a chat channel can't
|
||||
/// overwrite your values.
|
||||
/// </summary>
|
||||
internal sealed class ConquestData
|
||||
{
|
||||
private const string Ts = @"^\s*(?:\[[^\]]*\][\s:]*)?";
|
||||
|
||||
// /b balances
|
||||
private static readonly Regex BankLine = new(Ts + @"\[BANK\]\s+(.+?):\s*(.*\S)\s*$");
|
||||
private static readonly Regex BankChrome = new(Ts + @"\[BANK\]\s+[^:]*:\s*$");
|
||||
private static readonly Regex EventToken = new(@"Event Tokens \[(.+?)\]");
|
||||
private static readonly Regex DepositReply = new(Ts + @"(?:No .+? (?:found|available) to deposit|Deposited\b.*)\s*$", RegexOptions.IgnoreCase);
|
||||
// /augs
|
||||
private static readonly Regex AugLine = new(Ts + @"(Creature|Item|Life|War|Void|Duration|Specialization|Melee|Missile):\s*([\d,]+)\b");
|
||||
private static readonly Regex AugChrome = new(Ts + @"(?:-{3,}|Advanced Augmentation Levels:|Use /aug info for per-level effect details\.)\s*$", RegexOptions.IgnoreCase);
|
||||
// /enl augs
|
||||
private static readonly Regex EnlLine = new(Ts + @"([A-Za-z][A-Za-z '\-]*?):\s*(([\d,]+)\s*\(\s*[\d,]+\s+max\s*\))\s*$");
|
||||
private static readonly Regex EnlChrome = new(Ts + @"Enlightenment Augmentations:\s*$");
|
||||
// /bonus
|
||||
private static readonly Regex BonusLine = new(Ts + @"(Quest|Enlightenment|PK Dungeon|Augmentation|Equipment|Total) Bonus(?:\s*\(([^)]+)\))?:\s*(.+\S)\s*$");
|
||||
private static readonly Regex BonusChrome = new(Ts + @"={2,}\s*XP Bonuses\s*={2,}\s*$");
|
||||
// /fship list
|
||||
private static readonly Regex FshipHeader = new(Ts + @"Fellowships looking for members");
|
||||
private static readonly Regex FshipLine = new(Ts + @"-\s+(.+?)\s+\(Leader:\s+(.+?)\)\s+\[(\d+/\d+)\](?:\s+@\s+(.+?))?\s*$");
|
||||
// /top
|
||||
private static readonly Regex TopHeader = new(Ts + @"Top\s+(\d+)\s+Players?\s+by\s+(.+?):\s*$");
|
||||
private static readonly Regex TopEntry = new(Ts + @"(\d+):\s+([\d,]+)\s+-\s+(.+?)\s*$");
|
||||
private static readonly Regex TopSeparator = new(Ts + @"\.\.\.\s*$");
|
||||
|
||||
private static readonly string[] EnlOrder =
|
||||
{
|
||||
"Damage", "Damage Reduction", "Crit Damage", "Crit Damage Reduction", "Imbue", "Salvage", "Skill Credits",
|
||||
"Stamina Benediction", "Mana Benediction", "Cleave", "Arrow Split", "Spell Chain", "Aetheria Surge", "Void Contagion",
|
||||
};
|
||||
private static readonly Dictionary<string, string> EnlCosts = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["Cleave"] = "1 Pristine Token", ["Arrow Split"] = "1 Pristine Token", ["Spell Chain"] = "1 Pristine Token",
|
||||
["Aetheria Surge"] = "1 Pristine Token", ["Void Contagion"] = "1 Pristine Token",
|
||||
["Damage"] = "2 Tokens", ["Damage Reduction"] = "2 Tokens", ["Crit Damage"] = "2 Tokens",
|
||||
["Crit Damage Reduction"] = "2 Tokens", ["Imbue"] = "2 Tokens", ["Salvage"] = "2 Tokens",
|
||||
["Skill Credits"] = "4 Tokens", ["Stamina Benediction"] = "4 Tokens", ["Mana Benediction"] = "4 Tokens",
|
||||
};
|
||||
|
||||
public const int PyrealsPerMmd = 250_000;
|
||||
|
||||
public readonly List<NamedValue> Bank = new();
|
||||
public readonly List<ConquestAug> Augs = new()
|
||||
{
|
||||
new("Creature", 25, 2_500_000, 0.003825), new("Item", 100, 3_000_000, 0.006825), new("Life", 75, 2_500_000, 0.0095),
|
||||
new("War", 50, 1_750_000, 0.00425), new("Void", 50, 1_800_000, 0.00425), new("Duration", 30, 1_400_000, 0.00625),
|
||||
new("Specialization", 125, 3_000_000, 0.02), new("Melee", 50, 1_750_000, 0.00425), new("Missile", 50, 1_750_000, 0.00425),
|
||||
};
|
||||
public List<NamedValue> EnlAugs { get; private set; } = new();
|
||||
public readonly List<NamedValue> Bonuses = new()
|
||||
{
|
||||
new() { Name = "Quest" }, new() { Name = "Enlightenment" }, new() { Name = "PK Dungeon" }, new() { Name = "Augmentation" },
|
||||
new() { Name = "Equipment" }, new() { Name = "Total (Kills)" }, new() { Name = "Total (Quest/Lum)" },
|
||||
};
|
||||
public readonly List<ConquestFellowship> Fellowships = new();
|
||||
public readonly List<ConquestBoard> Boards = new()
|
||||
{
|
||||
new("augs", "Augs", "Total Augmentations"), new("deaths", "Deaths", "Deaths"), new("enl", "Enlightens", "Enlightenment"),
|
||||
new("level", "Levels", "Level"), new("lum", "Luminance", "Banked Luminance"), new("bank", "Pyreals", "Banked Pyreals"),
|
||||
new("qb", "QB", "Quest Bonus"), new("titles", "Titles", "Titles"),
|
||||
};
|
||||
|
||||
public DateTime BankUtc = DateTime.MinValue, AugsUtc = DateTime.MinValue, EnlUtc = DateTime.MinValue,
|
||||
BonusUtc = DateTime.MinValue, FshipUtc = DateTime.MinValue;
|
||||
public int Revision { get; private set; }
|
||||
|
||||
private readonly ChatRequest _bankReq = new(), _augReq = new(), _enlReq = new(), _bonusReq = new(), _fshipReq = new(),
|
||||
_topReq = new(), _depositReq = new();
|
||||
private ConquestBoard? _collecting;
|
||||
private long _collectingMs;
|
||||
private int _collectingExpected = int.MaxValue;
|
||||
private bool _collectingCleared;
|
||||
|
||||
public static string EnlCost(string name) => EnlCosts.TryGetValue(name, out string? c) ? c : "";
|
||||
|
||||
public int AugTotal => Augs.Sum(a => a.Count);
|
||||
public int DurationAugs => Augs.First(a => a.Name == "Duration").Count;
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Bank.Clear();
|
||||
foreach (ConquestAug a in Augs) a.Count = 0;
|
||||
EnlAugs = new List<NamedValue>();
|
||||
foreach (NamedValue b in Bonuses) b.Value = "";
|
||||
Fellowships.Clear();
|
||||
foreach (ConquestBoard b in Boards) { b.Rows.Clear(); b.You = null; b.UpdatedUtc = DateTime.MinValue; }
|
||||
BankUtc = AugsUtc = EnlUtc = BonusUtc = FshipUtc = DateTime.MinValue;
|
||||
_collecting = null;
|
||||
Revision++;
|
||||
}
|
||||
|
||||
// ── Requests (the plugin sends the command; each returns the command text) ──
|
||||
|
||||
public string RequestBank(long now) { _bankReq.Sent(now); return "/b"; }
|
||||
public string RequestAugs(long now) { _augReq.Sent(now); return "/augs"; }
|
||||
public string RequestEnl(long now) { _enlReq.Sent(now); return "/enl augs"; }
|
||||
public string RequestBonus(long now) { _bonusReq.Sent(now); return "/bonus"; }
|
||||
public string RequestFships(long now) { _fshipReq.Sent(now); Fellowships.Clear(); Revision++; return "/fship list"; }
|
||||
|
||||
public string RequestBoard(ConquestBoard board, long now)
|
||||
{
|
||||
_topReq.Sent(now);
|
||||
Open(board, now);
|
||||
return "/top " + board.Key;
|
||||
}
|
||||
|
||||
/// <summary>An automatic deposit: its reply is ours to hide.</summary>
|
||||
public string AutoDeposit(long now) { _depositReq.Sent(now); return "/bank deposit"; }
|
||||
|
||||
/// <summary>
|
||||
/// A chat line: true when it was a reply this module reads; <paramref name="ours"/> = it
|
||||
/// answers a request RynthOracle sent (eligible to be hidden).
|
||||
/// </summary>
|
||||
public bool OnChatLine(string text, long now, out bool ours)
|
||||
{
|
||||
ours = false;
|
||||
Match m;
|
||||
|
||||
if (_depositReq.Awaiting(now) && DepositReply.IsMatch(text)) { ours = true; _depositReq.Extend(now); return true; }
|
||||
|
||||
if ((m = BankLine.Match(text)).Success)
|
||||
{
|
||||
string name = EventToken.Replace(m.Groups[1].Value.Trim(), "$1");
|
||||
string value = m.Groups[2].Value.Trim();
|
||||
if (name == "Pyreals" && long.TryParse(value.Replace(",", ""), out long py))
|
||||
value += $" ({(py / PyrealsPerMmd).ToString("N0", CultureInfo.InvariantCulture)} MMDs)";
|
||||
NamedValue? e = Bank.FirstOrDefault(b => b.Name == name);
|
||||
if (e != null) e.Value = value; else Bank.Add(new NamedValue { Name = name, Value = value });
|
||||
BankUtc = DateTime.UtcNow;
|
||||
return Done(_bankReq, now, out ours);
|
||||
}
|
||||
if (_bankReq.Awaiting(now) && BankChrome.IsMatch(text)) return Done(_bankReq, now, out ours);
|
||||
|
||||
if ((m = AugLine.Match(text)).Success)
|
||||
{
|
||||
ConquestAug? a = Augs.FirstOrDefault(x => x.Name == m.Groups[1].Value);
|
||||
if (a != null && int.TryParse(m.Groups[2].Value.Replace(",", ""), out int c)) a.Count = c;
|
||||
AugsUtc = DateTime.UtcNow;
|
||||
return Done(_augReq, now, out ours);
|
||||
}
|
||||
if (_augReq.Awaiting(now) && AugChrome.IsMatch(text)) return Done(_augReq, now, out ours);
|
||||
|
||||
if (EnlChrome.IsMatch(text))
|
||||
{
|
||||
EnlAugs = new List<NamedValue>();
|
||||
return Done(_enlReq, now, out ours);
|
||||
}
|
||||
if ((m = EnlLine.Match(text)).Success)
|
||||
{
|
||||
// "Label: N (M max)" is specific to the "/enl augs" reply (its header starts a fresh list).
|
||||
string name = m.Groups[1].Value.Trim();
|
||||
var list = new List<NamedValue>(EnlAugs.Where(x => x.Name != name)) { new() { Name = name, Value = m.Groups[2].Value.Trim() } };
|
||||
list.Sort((x, y) => Rank(x.Name).CompareTo(Rank(y.Name)));
|
||||
EnlAugs = list;
|
||||
EnlUtc = DateTime.UtcNow;
|
||||
return Done(_enlReq, now, out ours);
|
||||
}
|
||||
|
||||
if ((m = BonusLine.Match(text)).Success)
|
||||
{
|
||||
string q = m.Groups[2].Value.Trim();
|
||||
string name = q.Length > 0 ? $"{m.Groups[1].Value} ({q})" : m.Groups[1].Value;
|
||||
NamedValue? b = Bonuses.FirstOrDefault(x => x.Name == name);
|
||||
if (b != null) b.Value = m.Groups[3].Value.Trim();
|
||||
BonusUtc = DateTime.UtcNow;
|
||||
return Done(_bonusReq, now, out ours);
|
||||
}
|
||||
if (_bonusReq.Awaiting(now) && BonusChrome.IsMatch(text)) return Done(_bonusReq, now, out ours);
|
||||
|
||||
if (FshipHeader.IsMatch(text))
|
||||
{
|
||||
if (!_fshipReq.Awaiting(now)) Fellowships.Clear();
|
||||
FshipUtc = DateTime.UtcNow;
|
||||
return Done(_fshipReq, now, out ours);
|
||||
}
|
||||
if ((m = FshipLine.Match(text)).Success)
|
||||
{
|
||||
Fellowships.Add(new ConquestFellowship
|
||||
{
|
||||
Name = m.Groups[1].Value.Trim(), Leader = m.Groups[2].Value.Trim(), Members = m.Groups[3].Value.Trim(),
|
||||
Location = m.Groups[4].Success ? m.Groups[4].Value.Trim() : "",
|
||||
});
|
||||
FshipUtc = DateTime.UtcNow;
|
||||
return Done(_fshipReq, now, out ours);
|
||||
}
|
||||
|
||||
if ((m = TopHeader.Match(text)).Success)
|
||||
{
|
||||
ConquestBoard? board = Active(now) ?? Boards.FirstOrDefault(b => b.Header.Equals(m.Groups[2].Value.Trim(), StringComparison.OrdinalIgnoreCase));
|
||||
if (board == null) return false;
|
||||
Open(board, now);
|
||||
ClearOnce();
|
||||
_collectingExpected = int.TryParse(m.Groups[1].Value, out int n) ? n : int.MaxValue;
|
||||
return Done(_topReq, now, out ours);
|
||||
}
|
||||
if ((m = TopEntry.Match(text)).Success && Active(now) is ConquestBoard cb)
|
||||
{
|
||||
ClearOnce();
|
||||
int.TryParse(m.Groups[1].Value, out int rank);
|
||||
string name = m.Groups[3].Value.Trim();
|
||||
var row = new BoardRow { Rank = rank, Value = m.Groups[2].Value.Trim(), Name = name };
|
||||
if (name.EndsWith("(You)", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
row.IsYou = true;
|
||||
row.Name = name[..^5].Trim();
|
||||
cb.You = row;
|
||||
}
|
||||
if (rank <= _collectingExpected && cb.Rows.All(r => r.Rank != rank)) cb.Rows.Add(row);
|
||||
cb.Rows.Sort((x, y) => x.Rank.CompareTo(y.Rank));
|
||||
cb.UpdatedUtc = DateTime.UtcNow;
|
||||
_collectingMs = now;
|
||||
return Done(_topReq, now, out ours);
|
||||
}
|
||||
if (Active(now) != null && TopSeparator.IsMatch(text)) return Done(_topReq, now, out ours);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool Done(ChatRequest req, long now, out bool ours)
|
||||
{
|
||||
ours = req.Awaiting(now);
|
||||
req.Extend(now);
|
||||
Revision++;
|
||||
return true;
|
||||
}
|
||||
|
||||
private static int Rank(string name)
|
||||
{
|
||||
int i = Array.FindIndex(EnlOrder, n => n.Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||
return i < 0 ? EnlOrder.Length : i;
|
||||
}
|
||||
|
||||
private void Open(ConquestBoard board, long now)
|
||||
{
|
||||
if (_collecting == board && now - _collectingMs < 15_000) return;
|
||||
_collecting = board;
|
||||
_collectingMs = now;
|
||||
_collectingExpected = int.MaxValue;
|
||||
_collectingCleared = false;
|
||||
}
|
||||
|
||||
private ConquestBoard? Active(long now) => _collecting != null && now - _collectingMs < 15_000 ? _collecting : null;
|
||||
|
||||
private void ClearOnce()
|
||||
{
|
||||
if (_collectingCleared || _collecting == null) return;
|
||||
_collecting.Rows.Clear();
|
||||
_collecting.You = null;
|
||||
_collectingCleared = true;
|
||||
}
|
||||
|
||||
// ── Bank commands (Conquest-ACE's /bank; tokens are its one-letter currency codes) ──
|
||||
|
||||
public sealed record Currency(string Label, string Token, long Multiplier = 1, long Max = long.MaxValue);
|
||||
|
||||
public static readonly Currency[] Withdrawable =
|
||||
{
|
||||
new("Conquest Coins", "c"), new("Event Tokens", "e"), new("Legendary Keys", "k"), new("Pyreals", "p"),
|
||||
new("Soul Fragments", "s"), new("MMD Notes (250k)", "n"), new("MM Notes (200k)", "n MM"), new("M Notes (100k)", "n M"),
|
||||
new("D Notes (50k)", "n D"), new("C Notes (10k)", "n C"), new("L Notes (5k)", "n L"), new("X Notes (1k)", "n X"),
|
||||
new("V Notes (500)", "n V"), new("I Notes (100)", "n I"),
|
||||
};
|
||||
public const int DefaultWithdraw = 5; // MMD notes
|
||||
|
||||
public static readonly Currency[] Transferable =
|
||||
{
|
||||
new("Legendary Keys", "k"), new("Luminance", "l"), new("MMD Notes (250k)", "p", 250_000, 1_000), new("Pyreals", "p"),
|
||||
};
|
||||
public const int DefaultTransfer = 1; // Luminance
|
||||
|
||||
/// <summary>"/bank withdraw <token> <n>", or null when the amount isn't a whole number above 0.</summary>
|
||||
public static string? WithdrawCommand(Currency c, string amount) =>
|
||||
long.TryParse((amount ?? "").Replace(",", "").Trim(), out long n) && n > 0 ? $"/bank withdraw {c.Token} {n}" : null;
|
||||
|
||||
/// <summary>"/bank transfer <token> <n> "name"", or null when the amount or name isn't usable.</summary>
|
||||
public static string? TransferCommand(Currency c, string amount, string target)
|
||||
{
|
||||
target = (target ?? "").Trim().Replace("\"", "");
|
||||
if (target.Length == 0 || !long.TryParse((amount ?? "").Replace(",", "").Trim(), out long n) || n <= 0 || n > c.Max) return null;
|
||||
try { return $"/bank transfer {c.Token} {checked(n * c.Multiplier)} \"{target}\""; }
|
||||
catch (OverflowException) { return null; }
|
||||
}
|
||||
|
||||
// ── Levels and enlightenment (ConquestAC's levels 276-300, upstream's table) ──
|
||||
|
||||
private static readonly long[] Levels276To300 =
|
||||
{
|
||||
194665023377, 198152685223, 201689992550, 205277652043, 208916380445,
|
||||
212606904701, 216349962105, 220146300445, 223996678153, 227901864460,
|
||||
231862639544, 235879794689, 239954132442, 244086466776, 248277623248,
|
||||
252528439169, 256839763767, 261212458359, 265647396522, 270145464270,
|
||||
274707560226, 279334595807, 284027495403, 288787196561, 293614650176,
|
||||
};
|
||||
public const int MaxLevel = 300;
|
||||
|
||||
/// <summary>Total XP to reach a level 276-300 (0 otherwise).</summary>
|
||||
public static long XpForLevel(int level) => level >= 276 && level <= 300 ? Levels276To300[level - 276] : 0;
|
||||
|
||||
private static double EnlMultiplier(int target) => target >= 75 ? 7.5 : target >= 50 ? 5.0 : target >= 25 ? 2.5 : 1.0;
|
||||
public static long EnlCoinCost(int target) => (long)(target * 100 * EnlMultiplier(target));
|
||||
public static long EnlLuminanceCost(int target) => (long)(target * 1_000_000L * EnlMultiplier(target));
|
||||
|
||||
/// <summary>Void DoT duration on ConquestAC: × (1 + Archmage's Endurance × 0.2 + Duration augs × 0.05).</summary>
|
||||
public double VoidDurationMultiplier(int archmagesEndurance) => 1.0 + archmagesEndurance * 0.2 + DurationAugs * 0.05;
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
// Ported from Oracle of Dereth by Advis Eveldan (advis61), MIT. See THIRD_PARTY_NOTICES.md.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
/// <summary>
|
||||
/// A server's custom quest worklist (customquests.csv: Server, Name, QuestFlag, Url, Hint). Each
|
||||
/// row carries its server tag, so only the current server's rows show (today: ConquestAC's).
|
||||
/// A repeatable counts as done only while on cooldown (upstream's rule).
|
||||
/// </summary>
|
||||
internal sealed class CustomQuest
|
||||
{
|
||||
public string Server = "", Name = "", Flag = "", Url = "", Hint = "";
|
||||
|
||||
public bool IsComplete(QuestFlagStore flags, DateTime utcNow)
|
||||
{
|
||||
if (!flags.TryGet(Flag, out QuestFlag q)) return false;
|
||||
if (q.RepeatTime == TimeSpan.Zero) return q.Solves > 0;
|
||||
return !q.Ready(utcNow);
|
||||
}
|
||||
|
||||
public string Status(QuestFlagStore flags, DateTime utcNow)
|
||||
{
|
||||
if (!flags.TryGet(Flag, out QuestFlag q)) return "ready";
|
||||
if (q.RepeatTime == TimeSpan.Zero) return q.Solves > 0 ? "completed" : "ready";
|
||||
return q.NextAvailable(utcNow);
|
||||
}
|
||||
}
|
||||
|
||||
internal static class CustomQuestList
|
||||
{
|
||||
public static List<CustomQuest> All { get; } = Load();
|
||||
|
||||
public static IEnumerable<CustomQuest> For(ServerIdentity server)
|
||||
{
|
||||
foreach (CustomQuest q in All)
|
||||
if (server.Is(q.Server)) yield return q;
|
||||
}
|
||||
|
||||
private static List<CustomQuest> Load()
|
||||
{
|
||||
var list = new List<CustomQuest>();
|
||||
using StreamReader r = Csv.OpenEmbedded("customquests.csv");
|
||||
r.ReadLine(); // Server,Name,QuestFlag,Url,Hint
|
||||
while (r.ReadLine() is string line)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(line)) continue;
|
||||
string[] f = Csv.ParseLine(line);
|
||||
list.Add(new CustomQuest
|
||||
{
|
||||
Server = Csv.Field(f, 0), Name = Csv.Field(f, 1), Flag = Csv.Field(f, 2).ToLowerInvariant(),
|
||||
Url = Csv.Field(f, 3), Hint = Csv.Field(f, 4),
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
170
Plugins/RynthCore.Plugin.RynthOracle/Data/DynamicStamps.cs
Normal file
170
Plugins/RynthCore.Plugin.RynthOracle/Data/DynamicStamps.cs
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
/// <summary>
|
||||
/// One Infinite Leaftide Dynamic Stamp (dynstamps.csv): an NPC hand-in that puts a
|
||||
/// "Dynamic_N_..." quest flag on the character. List from the players' "ExtraDyn" sheet
|
||||
/// (10.13.2026, one sheet per area, the wiki's Dynamic Stamps page); NPCs that give no stamp
|
||||
/// are left out. A stamp is a one-time flag: having it in /myquests means it's done.
|
||||
/// </summary>
|
||||
internal sealed class DynamicStamp
|
||||
{
|
||||
public string Area = "";
|
||||
/// <summary>Where in the area (a town, a dungeon, coordinates), or "".</summary>
|
||||
public string Place = "";
|
||||
public string Npc = "";
|
||||
/// <summary>What the NPC gives back (the sheet's "X gives you Y"), or "".</summary>
|
||||
public string Reward = "";
|
||||
/// <summary>The quest flag, lower case (as QuestFlagStore keys it).</summary>
|
||||
public string Stamp = "";
|
||||
public string Note = "";
|
||||
|
||||
/// <summary>The NPC, else the place (a few sheet rows only name the spot).</summary>
|
||||
public string Label => Npc.Length > 0 ? Npc : Place;
|
||||
|
||||
/// <summary>
|
||||
/// The flag this character has for the stamp, or null. The sheet has a few stamps copied
|
||||
/// without their closing "!" or cut short: those also match with "!" added and, when at
|
||||
/// least <see cref="MinPrefixLength"/> long, the one Dynamic flag on the character starting
|
||||
/// with them.
|
||||
/// </summary>
|
||||
public string? MatchedFlag(QuestFlagStore flags)
|
||||
{
|
||||
if (flags.TryGet(Stamp, out _)) return Stamp;
|
||||
if (Stamp.EndsWith('!')) return null;
|
||||
if (flags.TryGet(Stamp + "!", out _)) return Stamp + "!";
|
||||
if (Stamp.Length < MinPrefixLength) return null;
|
||||
string? only = null;
|
||||
foreach (string key in flags.Flags.Keys)
|
||||
{
|
||||
if (!key.StartsWith(Stamp, StringComparison.OrdinalIgnoreCase)) continue;
|
||||
if (only != null) return null; // more than one: can't tell which
|
||||
only = key;
|
||||
}
|
||||
return only;
|
||||
}
|
||||
|
||||
public bool Have(QuestFlagStore flags) => MatchedFlag(flags) != null;
|
||||
|
||||
// Sheet areas that are groupings, not places on the map.
|
||||
private static readonly HashSet<string> NotPlaces = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"Looking Around", "Odd Stamps", "Odd Stamps 2",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Where RynthNav should go for this stamp, best first (RynthNav takes the first that is on its
|
||||
/// map): the coordinates in the note or the place, the place and its parts ("Mhoire Castle -
|
||||
/// Great Hall" also tries "Mhoire Castle"), the NPC, then the area. Empty when there is nothing.
|
||||
/// </summary>
|
||||
public List<string> NavCandidates()
|
||||
{
|
||||
var list = new List<string>();
|
||||
void Add(string s)
|
||||
{
|
||||
s = s.Trim().Trim('.', ',', ';', ':').Trim();
|
||||
if (s.Length >= 4 && !char.IsDigit(s[0]) && !list.Contains(s, StringComparer.OrdinalIgnoreCase)) list.Add(s);
|
||||
}
|
||||
|
||||
foreach (string text in new[] { Note, Place })
|
||||
if (NavTargets.FirstCoords(text) is string c && !list.Contains(c)) list.Add(c);
|
||||
|
||||
string place = NavTargets.WithoutCoords(Place);
|
||||
place = System.Text.RegularExpressions.Regex.Replace(place, @"\b(at|in the|nearby)\b", " ", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
|
||||
place = System.Text.RegularExpressions.Regex.Replace(place, @"\s+", " ").Trim();
|
||||
Add(place);
|
||||
foreach (string part in place.Split(new[] { " - ", " / ", "(", ")" }, StringSplitOptions.RemoveEmptyEntries))
|
||||
Add(part);
|
||||
Add(Npc);
|
||||
if (!NotPlaces.Contains(Area)) Add(Area);
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>A truncated stamp shorter than this is matched exactly only (too many flags share a short stem).</summary>
|
||||
public const int MinPrefixLength = 14;
|
||||
}
|
||||
|
||||
internal static class DynamicStampList
|
||||
{
|
||||
/// <summary>Dynamic stamp quest flags start with this (lower case).</summary>
|
||||
public const string FlagPrefix = "dynamic_";
|
||||
|
||||
public static List<DynamicStamp> All { get; } = Load();
|
||||
|
||||
/// <summary>The areas in list order (Facility Hub, Looking Around, ...).</summary>
|
||||
public static List<string> Areas { get; } = BuildAreas();
|
||||
|
||||
/// <summary>
|
||||
/// Dynamic stamps on this character that the list doesn't have (new or unlisted NPCs), so the
|
||||
/// tab can show them and the count isn't only what the sheet knows.
|
||||
/// </summary>
|
||||
public static List<string> Unlisted(QuestFlagStore flags)
|
||||
{
|
||||
var matched = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (DynamicStamp s in All)
|
||||
if (s.MatchedFlag(flags) is string f) matched.Add(f);
|
||||
var extra = new List<string>();
|
||||
foreach (string key in flags.Flags.Keys)
|
||||
if (key.StartsWith(FlagPrefix, StringComparison.OrdinalIgnoreCase) && !matched.Contains(key))
|
||||
extra.Add(key);
|
||||
extra.Sort(StringComparer.OrdinalIgnoreCase);
|
||||
return extra;
|
||||
}
|
||||
|
||||
private static List<DynamicStamp> Load()
|
||||
{
|
||||
try
|
||||
{
|
||||
using StreamReader r = Csv.OpenEmbedded("dynstamps.csv");
|
||||
return Parse(r);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// A missing or unreadable list must not take the Quests page down with it.
|
||||
return new List<DynamicStamp>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a dynstamps.csv (a header row, then one NPC hand-in a row). A row whose stamp isn't a
|
||||
/// "dynamic_" flag, or repeats one already read, is skipped; a missing column reads as empty.
|
||||
/// Internal for the tests.
|
||||
/// </summary>
|
||||
internal static List<DynamicStamp> Parse(TextReader r)
|
||||
{
|
||||
var list = new List<DynamicStamp>();
|
||||
Dictionary<string, int> col = Csv.MapColumns(r.ReadLine() ?? "");
|
||||
int cArea = Csv.Column(col, "Area"), cPlace = Csv.Column(col, "Place"), cNpc = Csv.Column(col, "Npc"),
|
||||
cReward = Csv.Column(col, "Reward"), cStamp = Csv.Column(col, "Stamp"), cNote = Csv.Column(col, "Note");
|
||||
var seen = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
while (r.ReadLine() is string line)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(line)) continue;
|
||||
string[] f = Csv.ParseLine(line);
|
||||
string stamp = Csv.Field(f, cStamp).Trim().ToLowerInvariant();
|
||||
if (!stamp.StartsWith(FlagPrefix, StringComparison.Ordinal) || !seen.Add(stamp)) continue;
|
||||
list.Add(new DynamicStamp
|
||||
{
|
||||
Area = Csv.Field(f, cArea),
|
||||
Place = Csv.Field(f, cPlace),
|
||||
Npc = Csv.Field(f, cNpc),
|
||||
Reward = Csv.Field(f, cReward),
|
||||
Stamp = stamp,
|
||||
Note = Csv.Field(f, cNote),
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private static List<string> BuildAreas()
|
||||
{
|
||||
var areas = new List<string>();
|
||||
foreach (DynamicStamp s in All)
|
||||
if (!areas.Contains(s.Area)) areas.Add(s.Area);
|
||||
return areas;
|
||||
}
|
||||
}
|
||||
232
Plugins/RynthCore.Plugin.RynthOracle/Data/IltServerProfile.cs
Normal file
232
Plugins/RynthCore.Plugin.RynthOracle/Data/IltServerProfile.cs
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using RynthCore.Plugin.Shared;
|
||||
using RynthCore.PluginSdk;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
/// <summary>One Leaftide feature from RynthILT's profile: its state on this server and where it lives.</summary>
|
||||
internal sealed record IltFeature(string Key, string Label, string Group, int State, string Where);
|
||||
|
||||
/// <summary>
|
||||
/// The ACECustom quest bonus list ("/qb list") as RynthILT last read it (the profile's "questBonus"
|
||||
/// object). <see cref="Generation"/> 0 = not loaded this session; <see cref="Count"/> -1 = unknown.
|
||||
/// </summary>
|
||||
internal sealed record IltQuestBonusList(bool Disabled, int Generation, long Count, string Status,
|
||||
IReadOnlyList<string> Completed, IReadOnlyList<string> Incomplete);
|
||||
|
||||
/// <summary>
|
||||
/// What RynthILT reports about the Infinite Leaftide server (the "RynthILT.Server" profile JSON,
|
||||
/// Plugins/Shared/RynthIltServerApi.cs): whether this is an ILT world, the Leaftide features with
|
||||
/// their server state, and the fellowship rules. <see cref="None"/> without RynthILT; every field is
|
||||
/// read leniently so an older or newer RynthILT still parses.
|
||||
/// </summary>
|
||||
internal sealed class IltServerProfile
|
||||
{
|
||||
/// <summary>No RynthILT (or nothing parsed): a retail fellowship and no features.</summary>
|
||||
public static readonly IltServerProfile None = new();
|
||||
|
||||
/// <summary>RynthILT answered with a profile.</summary>
|
||||
public bool Available { get; private init; }
|
||||
public bool Ilt { get; private init; }
|
||||
public string World { get; private init; } = "";
|
||||
public bool Forced { get; private init; }
|
||||
public string Source { get; private init; } = "";
|
||||
/// <summary>Last server-options check (UTC); MinValue = never.</summary>
|
||||
public DateTime CheckedUtc { get; private init; } = DateTime.MinValue;
|
||||
public IReadOnlyList<IltFeature> Features { get; private init; } = Array.Empty<IltFeature>();
|
||||
|
||||
/// <summary>The server's fellowship size limit (retail 9 without RynthILT or off ILT).</summary>
|
||||
public int FellowshipMax { get; private init; } = RynthIltServer.RetailFellowshipMax;
|
||||
/// <summary>Fellowship feature states (RynthIltServer.State*): Zone Share, Fellowship Blackjack, luminance share.</summary>
|
||||
public int ZoneShare { get; private init; } = RynthIltServer.StateUnknown;
|
||||
public int Blackjack { get; private init; } = RynthIltServer.StateUnknown;
|
||||
public int LuminanceShare { get; private init; } = RynthIltServer.StateUnknown;
|
||||
|
||||
/// <summary>The /qb list (ILT worlds with RynthILT 0.2.3 or later); null = none offered.</summary>
|
||||
public IltQuestBonusList? QuestBonus { get; private init; }
|
||||
|
||||
/// <summary>The features in one group, in RynthILT's order.</summary>
|
||||
public IEnumerable<IltFeature> InGroup(string group)
|
||||
{
|
||||
foreach (IltFeature f in Features)
|
||||
if (string.Equals(f.Group, group, StringComparison.OrdinalIgnoreCase)) yield return f;
|
||||
}
|
||||
|
||||
/// <summary>Parses the profile JSON; <see cref="None"/> when it is empty or not JSON.</summary>
|
||||
public static IltServerProfile Parse(string? json)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(json)) return None;
|
||||
try
|
||||
{
|
||||
using JsonDocument doc = JsonDocument.Parse(json);
|
||||
JsonElement root = doc.RootElement;
|
||||
if (root.ValueKind != JsonValueKind.Object) return None;
|
||||
|
||||
var features = new List<IltFeature>();
|
||||
if (root.TryGetProperty("features", out JsonElement fs) && fs.ValueKind == JsonValueKind.Array)
|
||||
{
|
||||
foreach (JsonElement f in fs.EnumerateArray())
|
||||
{
|
||||
if (f.ValueKind != JsonValueKind.Object) continue;
|
||||
string key = Str(f, "key");
|
||||
if (key.Length == 0) continue;
|
||||
string label = Str(f, "label");
|
||||
features.Add(new IltFeature(key, label.Length > 0 ? label : key, Str(f, "group"),
|
||||
Int(f, "state", RynthIltServer.StateUnknown), Str(f, "where")));
|
||||
}
|
||||
}
|
||||
|
||||
bool ilt = Bool(root, "ilt");
|
||||
int max = RynthIltServer.RetailFellowshipMax;
|
||||
int zone = RynthIltServer.StateUnknown, bj = RynthIltServer.StateUnknown, lum = RynthIltServer.StateUnknown;
|
||||
if (root.TryGetProperty("fellowship", out JsonElement fel) && fel.ValueKind == JsonValueKind.Object)
|
||||
{
|
||||
max = Int(fel, "maxMembers", max);
|
||||
zone = Int(fel, "zoneShare", zone);
|
||||
bj = Int(fel, "blackjack", bj);
|
||||
lum = Int(fel, "luminanceShare", lum);
|
||||
}
|
||||
// A bogus size would let the tab claim room nobody has; stay within what the reader handles.
|
||||
if (max < 1 || max > 64) max = RynthIltServer.RetailFellowshipMax;
|
||||
|
||||
DateTime checkedUtc = DateTime.MinValue;
|
||||
string when = Str(root, "checked");
|
||||
if (when.Length > 0
|
||||
&& DateTime.TryParse(when, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime t))
|
||||
checkedUtc = t;
|
||||
|
||||
return new IltServerProfile
|
||||
{
|
||||
Available = true,
|
||||
Ilt = ilt,
|
||||
World = Str(root, "world"),
|
||||
Forced = Bool(root, "forced"),
|
||||
Source = Str(root, "source"),
|
||||
CheckedUtc = checkedUtc,
|
||||
Features = features,
|
||||
FellowshipMax = max,
|
||||
ZoneShare = zone,
|
||||
Blackjack = bj,
|
||||
LuminanceShare = lum,
|
||||
QuestBonus = ParseQuestBonus(root),
|
||||
};
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The "questBonus" object, or null when the profile has none.</summary>
|
||||
private static IltQuestBonusList? ParseQuestBonus(JsonElement root)
|
||||
{
|
||||
if (!root.TryGetProperty("questBonus", out JsonElement q) || q.ValueKind != JsonValueKind.Object) return null;
|
||||
long count = q.TryGetProperty("count", out JsonElement c) && c.ValueKind == JsonValueKind.Number && c.TryGetInt64(out long n) ? n : -1;
|
||||
return new IltQuestBonusList(Bool(q, "disabled"), Int(q, "generation", 0), count, Str(q, "status"),
|
||||
Strings(q, "completed"), Strings(q, "incomplete"));
|
||||
}
|
||||
|
||||
private static string[] Strings(JsonElement o, string name)
|
||||
{
|
||||
if (!o.TryGetProperty(name, out JsonElement a) || a.ValueKind != JsonValueKind.Array) return Array.Empty<string>();
|
||||
var list = new List<string>(a.GetArrayLength());
|
||||
foreach (JsonElement e in a.EnumerateArray())
|
||||
if (e.ValueKind == JsonValueKind.String && e.GetString() is { Length: > 0 } s) list.Add(s);
|
||||
return list.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>"on", "off" or "checking" for a feature state.</summary>
|
||||
public static string StateText(int state) => state switch
|
||||
{
|
||||
RynthIltServer.StateOn => "on",
|
||||
RynthIltServer.StateOff => "off",
|
||||
_ => "checking",
|
||||
};
|
||||
|
||||
private static string Str(JsonElement o, string name) =>
|
||||
o.TryGetProperty(name, out JsonElement v) && v.ValueKind == JsonValueKind.String ? v.GetString() ?? "" : "";
|
||||
|
||||
private static bool Bool(JsonElement o, string name) =>
|
||||
o.TryGetProperty(name, out JsonElement v) && v.ValueKind == JsonValueKind.True;
|
||||
|
||||
private static int Int(JsonElement o, string name, int fallback) =>
|
||||
o.TryGetProperty(name, out JsonElement v) && v.ValueKind == JsonValueKind.Number && v.TryGetInt32(out int i) ? i : fallback;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads RynthILT's "RynthILT.Server" interface on the plugin pump. Looks the table up through the
|
||||
/// host (re-checked while RynthILT is missing or after it unloads, Version 0) and copies the JSON
|
||||
/// out every <see cref="PollMs"/>; <see cref="Revision"/> goes up when the profile changes.
|
||||
/// </summary>
|
||||
internal sealed unsafe class IltServerLink
|
||||
{
|
||||
private const long PollMs = 2000;
|
||||
private const long RequeryMs = 10_000;
|
||||
// Room for the /qb list (hundreds of flags) on top of the features.
|
||||
private const int MaxBuffer = 512 * 1024;
|
||||
|
||||
private RynthIltServerApiV1* _table;
|
||||
private long _nextPollAt, _nextQueryAt;
|
||||
private byte[] _buffer = new byte[8192];
|
||||
private string _lastJson = "";
|
||||
|
||||
public IltServerProfile Profile { get; private set; } = IltServerProfile.None;
|
||||
public int Revision { get; private set; }
|
||||
|
||||
/// <summary>Forget the profile (logout); the next poll reads it again.</summary>
|
||||
public void Clear()
|
||||
{
|
||||
_nextPollAt = 0;
|
||||
SetJson("");
|
||||
}
|
||||
|
||||
/// <summary>Pump thread. Cheap when not due.</summary>
|
||||
public void Poll(RynthCoreHost host, long now)
|
||||
{
|
||||
if (now < _nextPollAt) return;
|
||||
_nextPollAt = now + PollMs;
|
||||
RynthIltServerApiV1* t = Table(host, now);
|
||||
SetJson(t == null ? "" : Read(t));
|
||||
}
|
||||
|
||||
/// <summary>The table, re-queried when it is missing or RynthILT has shut down (Version 0).</summary>
|
||||
private RynthIltServerApiV1* Table(RynthCoreHost host, long now)
|
||||
{
|
||||
if (_table != null && _table->Version >= 1) return _table;
|
||||
_table = null;
|
||||
if (now < _nextQueryAt || !host.HasGetPluginInterface) return null;
|
||||
_nextQueryAt = now + RequeryMs;
|
||||
var p = (RynthIltServerApiV1*)host.GetPluginInterface(RynthIltServer.PluginName, RynthIltServerApiV1.InterfaceName, RynthIltServerApiV1.InterfaceVersion);
|
||||
if (p != null && p->Version >= 1 && p->StructSize >= (uint)sizeof(RynthIltServerApiV1) && p->GetProfileJson != null)
|
||||
_table = p;
|
||||
return _table;
|
||||
}
|
||||
|
||||
/// <summary>Copies the JSON out, growing the buffer once when RynthILT says it didn't fit.</summary>
|
||||
private string Read(RynthIltServerApiV1* t)
|
||||
{
|
||||
for (int attempt = 0; attempt < 2; attempt++)
|
||||
{
|
||||
int len;
|
||||
fixed (byte* b = _buffer) len = t->GetProfileJson(b, _buffer.Length);
|
||||
if (len <= 0) return "";
|
||||
if (len < _buffer.Length) return Encoding.UTF8.GetString(_buffer, 0, len);
|
||||
if (len + 1 > MaxBuffer) return "";
|
||||
_buffer = new byte[len + 1024];
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>Takes a profile JSON (internal: the tests feed one without RynthILT).</summary>
|
||||
internal void SetJson(string json)
|
||||
{
|
||||
if (json == _lastJson) return;
|
||||
_lastJson = json;
|
||||
Profile = IltServerProfile.Parse(json);
|
||||
Revision++;
|
||||
}
|
||||
}
|
||||
135
Plugins/RynthCore.Plugin.RynthOracle/Data/Legendary.cs
Normal file
135
Plugins/RynthCore.Plugin.RynthOracle/Data/Legendary.cs
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
/// <summary>
|
||||
/// One Legendary Key quest (legendary.csv; list and notes from the "Arwic John Route" sheet).
|
||||
/// The quest's own /myquests flags say whether it was ever done and when it can be run again:
|
||||
/// the first flag is its completion stamp, any others only add their repeat timers (a key pickup
|
||||
/// timer, say). John in Arwic counts 30 different ones (legendaryquestcounter_0913).
|
||||
/// </summary>
|
||||
internal sealed class LegendaryQuest
|
||||
{
|
||||
public string Group = "";
|
||||
public string Name = "";
|
||||
/// <summary>The short name players use ("RTW", "HMD"), or "".</summary>
|
||||
public string CommonName = "";
|
||||
public int Luminance;
|
||||
public string[] Flags = Array.Empty<string>();
|
||||
public string Url = "";
|
||||
public string Note = "";
|
||||
public string Video = "";
|
||||
|
||||
/// <summary>The short name when the sheet has one, else the quest name.</summary>
|
||||
public string Label => CommonName.Length > 0 ? $"{Name} ({CommonName})" : Name;
|
||||
|
||||
/// <summary>Done at least once: any of its flags is on this character.</summary>
|
||||
public bool Have(QuestFlagStore flags)
|
||||
{
|
||||
foreach (string f in Flags)
|
||||
if (flags.TryGet(f, out _)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Time until it can be run again: the longest wait among its flags that have a repeat timer;
|
||||
/// zero when every timer is up (or it has none). Null when it was never done.
|
||||
/// </summary>
|
||||
public TimeSpan? TimeLeft(QuestFlagStore flags, DateTime utcNow)
|
||||
{
|
||||
bool any = false;
|
||||
TimeSpan left = TimeSpan.Zero;
|
||||
foreach (string f in Flags)
|
||||
{
|
||||
if (!flags.TryGet(f, out QuestFlag q)) continue;
|
||||
any = true;
|
||||
if (q.RepeatTime <= TimeSpan.Zero || q.CompletedOnUtc == DateTime.MinValue) continue;
|
||||
TimeSpan d = q.NextAvailableTime(utcNow);
|
||||
if (d > left) left = d;
|
||||
}
|
||||
return any ? left : null;
|
||||
}
|
||||
|
||||
/// <summary>"missing", "ready" or the time left ("14h 3m").</summary>
|
||||
public string Status(QuestFlagStore flags, DateTime utcNow)
|
||||
{
|
||||
TimeSpan? left = TimeLeft(flags, utcNow);
|
||||
if (left == null) return "missing";
|
||||
return left.Value.TotalSeconds > 0 ? TimeText.Friendly(left.Value) : "ready";
|
||||
}
|
||||
}
|
||||
|
||||
internal static class LegendaryList
|
||||
{
|
||||
/// <summary>John's count of different Legendary Key quests done (needs 30).</summary>
|
||||
public const string CounterFlag = "legendaryquestcounter_0913";
|
||||
/// <summary>Legendary Key quests John asks for.</summary>
|
||||
public const int JohnTarget = 30;
|
||||
|
||||
public static List<LegendaryQuest> All { get; } = Load();
|
||||
|
||||
/// <summary>The groups in list order (Graveyard, Rynthid, ...).</summary>
|
||||
public static List<string> Groups { get; } = BuildGroups();
|
||||
|
||||
/// <summary>John's counter for this character; null when /myquests doesn't have it (not started).</summary>
|
||||
public static int? JohnCount(QuestFlagStore flags) =>
|
||||
flags.TryGet(CounterFlag, out QuestFlag q) ? q.Solves : null;
|
||||
|
||||
private static List<LegendaryQuest> Load()
|
||||
{
|
||||
try
|
||||
{
|
||||
using StreamReader r = Csv.OpenEmbedded("legendary.csv");
|
||||
return Parse(r);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// A missing or unreadable list must not take the Quests page down with it.
|
||||
return new List<LegendaryQuest>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a legendary.csv (a header row, then one quest a row). A row without a quest name is
|
||||
/// skipped; a missing column or a luminance that isn't a number reads as empty / 0, so one bad
|
||||
/// line never costs the rest of the list. Internal for the tests.
|
||||
/// </summary>
|
||||
internal static List<LegendaryQuest> Parse(TextReader r)
|
||||
{
|
||||
var list = new List<LegendaryQuest>();
|
||||
Dictionary<string, int> col = Csv.MapColumns(r.ReadLine() ?? "");
|
||||
int cGroup = Csv.Column(col, "Group"), cName = Csv.Column(col, "Quest"), cCommon = Csv.Column(col, "CommonName"),
|
||||
cLum = Csv.Column(col, "Luminance"), cFlags = Csv.Column(col, "Flags"), cUrl = Csv.Column(col, "Url"),
|
||||
cNote = Csv.Column(col, "Note"), cVideo = Csv.Column(col, "Video");
|
||||
while (r.ReadLine() is string line)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(line)) continue;
|
||||
string[] f = Csv.ParseLine(line);
|
||||
string name = Csv.Field(f, cName);
|
||||
if (name.Length == 0) continue;
|
||||
list.Add(new LegendaryQuest
|
||||
{
|
||||
Group = Csv.Field(f, cGroup),
|
||||
Name = name,
|
||||
CommonName = Csv.Field(f, cCommon),
|
||||
Luminance = int.TryParse(Csv.Field(f, cLum), out int lum) ? lum : 0,
|
||||
Flags = Csv.Field(f, cFlags).ToLowerInvariant()
|
||||
.Split(';', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries),
|
||||
Url = Csv.Field(f, cUrl),
|
||||
Note = Csv.Field(f, cNote),
|
||||
Video = Csv.Field(f, cVideo),
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private static List<string> BuildGroups()
|
||||
{
|
||||
var groups = new List<string>();
|
||||
foreach (LegendaryQuest q in All)
|
||||
if (!groups.Contains(q.Group)) groups.Add(q.Group);
|
||||
return groups;
|
||||
}
|
||||
}
|
||||
86
Plugins/RynthCore.Plugin.RynthOracle/Data/NavTargets.cs
Normal file
86
Plugins/RynthCore.Plugin.RynthOracle/Data/NavTargets.cs
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Coordinates in Oracle's text (quest walkthroughs, Dynamic Stamp notes) as RynthNav targets.
|
||||
/// The lists write them every which way: "59.6S 88.0W", "8.8S, 53.1E", "42.6n 62.4e".
|
||||
/// </summary>
|
||||
internal static class NavTargets
|
||||
{
|
||||
private static readonly Regex CoordsRx = new(
|
||||
@"(?<ns>\d+(?:\.\d+)?)\s*(?<nsc>[NnSs])[\s,]*(?<ew>\d+(?:\.\d+)?)\s*(?<ewc>[EeWw])\b",
|
||||
RegexOptions.CultureInvariant);
|
||||
|
||||
/// <summary>One place to go: what the text calls it (may be empty) and its coordinates ("59.6S, 88.0W").</summary>
|
||||
internal readonly record struct Stop(string Label, string Coords)
|
||||
{
|
||||
/// <summary>The RynthNav target: the coordinates, then the label (RynthNav uses an Atlas
|
||||
/// place of that name there, e.g. a dungeon's entrance).</summary>
|
||||
public string Target => Label.Length > 0 ? Coords + " " + Label : Coords;
|
||||
|
||||
/// <summary>How a picker shows it: "Kill Mukkir Progenitor - 86.5N, 57.3E".</summary>
|
||||
public string Display => Label.Length > 0 ? Label + " - " + Coords : Coords;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A named place with no coordinates (an exploration marker's location): its name is the whole
|
||||
/// RynthNav target, and RynthNav finds it on its Atlas.
|
||||
/// </summary>
|
||||
public static Stop Place(string name) => new("", name.Trim());
|
||||
|
||||
/// <summary>The first coordinates in <paramref name="text"/>, written "8.8S, 53.1E", or null.</summary>
|
||||
public static string? FirstCoords(string? text)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text)) return null;
|
||||
Match m = CoordsRx.Match(text);
|
||||
return m.Success ? Format(m) : null;
|
||||
}
|
||||
|
||||
/// <summary><paramref name="text"/> with its coordinates taken out.</summary>
|
||||
public static string WithoutCoords(string? text) => string.IsNullOrEmpty(text) ? "" : CoordsRx.Replace(text, " ");
|
||||
|
||||
/// <summary>
|
||||
/// Every coordinate pair in <paramref name="text"/>, in order, each labelled with the words just
|
||||
/// before it in its step (walkthroughs separate steps with " - "): "Speak with Hoshar ibn Jalaq
|
||||
/// 59.6S 88.0W - Kill Mukkir Progenitor 86.5N 57.3E" gives two stops. The same coordinates
|
||||
/// twice are one stop.
|
||||
/// </summary>
|
||||
public static List<Stop> Stops(string? text)
|
||||
{
|
||||
var stops = new List<Stop>();
|
||||
if (string.IsNullOrEmpty(text)) return stops;
|
||||
foreach (Match m in CoordsRx.Matches(text))
|
||||
{
|
||||
string coords = Format(m);
|
||||
if (stops.Exists(s => s.Coords == coords)) continue;
|
||||
stops.Add(new Stop(LabelBefore(text, m.Index), coords));
|
||||
}
|
||||
return stops;
|
||||
}
|
||||
|
||||
/// <summary>The words between the previous step break (" - ", ". ", "; ", "|") or coordinates and <paramref name="at"/>.</summary>
|
||||
private static string LabelBefore(string text, int at)
|
||||
{
|
||||
int from = 0;
|
||||
foreach (string sep in new[] { " - ", ". ", "; ", "|", "(" })
|
||||
{
|
||||
int i = text.LastIndexOf(sep, Math.Max(0, at - 1), StringComparison.Ordinal);
|
||||
if (i >= 0 && i + sep.Length <= at) from = Math.Max(from, i + sep.Length);
|
||||
}
|
||||
// Not back past the previous coordinates ("Cragstone 26.0N 47.0E Speak with ...").
|
||||
foreach (Match m in CoordsRx.Matches(text.Substring(0, at)))
|
||||
from = Math.Max(from, m.Index + m.Length);
|
||||
string label = text.Substring(from, at - from).Trim(' ', ',', ':', '-', '.', '(', ')');
|
||||
// "at 42.1N ..." and "Meet at 42.1N ...": the little words around the coordinates aren't the place.
|
||||
label = Regex.Replace(label, @"^(at|in|near|to)\s+|\s+(at|in|near|to)$", "", RegexOptions.IgnoreCase).Trim();
|
||||
return label.Length > 60 ? label.Substring(0, 60).TrimEnd() : label;
|
||||
}
|
||||
|
||||
private static string Format(Match m) =>
|
||||
string.Create(CultureInfo.InvariantCulture,
|
||||
$"{m.Groups["ns"].Value}{char.ToUpperInvariant(m.Groups["nsc"].Value[0])}, {m.Groups["ew"].Value}{char.ToUpperInvariant(m.Groups["ewc"].Value[0])}");
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ internal sealed class QuestFlag
|
|||
}
|
||||
|
||||
/// <summary>What one chat line is, as far as /myquests goes.</summary>
|
||||
internal enum MyQuestsLine { None, Quest, Empty, Disabled }
|
||||
internal enum MyQuestsLine { None, Quest, Empty, Disabled, Throttled }
|
||||
|
||||
/// <summary>
|
||||
/// The character's quest flags, read from the server's /myquests reply (ACE: one Broadcast line
|
||||
|
|
@ -55,10 +55,21 @@ internal sealed class QuestFlagStore
|
|||
|
||||
public const string EmptyText = "Quest list is empty.";
|
||||
public const string DisabledText = "The command \"myquests\" is not currently enabled on this server.";
|
||||
/// <summary>ACECustom's per-session throttle reply ("... may only be run once every 60 seconds.").</summary>
|
||||
public const string ThrottledText = "[MyQuests] This command may only be run once every";
|
||||
|
||||
private const int QuietMs = 1500; // a reply is complete once no line came for this long
|
||||
private const int RequestTimeoutMs = 10_000;
|
||||
private const int MinRequestGapMs = 5_000;
|
||||
/// <summary>ACECustom answers one /myquests a minute per session (whoever sent the last one).</summary>
|
||||
private const int ServerThrottleMs = 60_000;
|
||||
/// <summary>
|
||||
/// A reply this much smaller than the flags already held is taken as cut short (chat lines
|
||||
/// dropped before they reached the plugin), so it updates the flags instead of replacing them.
|
||||
/// </summary>
|
||||
private const double PartialReplyRatio = 0.8;
|
||||
/// <summary>Below this many flags held, a smaller reply always replaces (nothing much to lose).</summary>
|
||||
private const int PartialReplyMinHeld = 20;
|
||||
|
||||
public Dictionary<string, QuestFlag> Flags { get; private set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
private Dictionary<string, QuestFlag>? _pending;
|
||||
|
|
@ -66,6 +77,15 @@ internal sealed class QuestFlagStore
|
|||
|
||||
public DateTime LastReadUtc { get; private set; } = DateTime.MinValue;
|
||||
public bool ServerDisabled { get; private set; }
|
||||
/// <summary>The server refused the last /myquests (its once-a-minute limit) until this tick.</summary>
|
||||
public long ThrottledUntilMs { get; private set; } = long.MinValue / 2;
|
||||
/// <summary>This server has shown its throttle line this session, so every reply starts its minute.</summary>
|
||||
private bool _serverThrottles;
|
||||
/// <summary>
|
||||
/// Set when the last reply looked cut short and was merged into the held flags (lines in the
|
||||
/// reply, flags held before it). The plugin logs it once and clears it.
|
||||
/// </summary>
|
||||
public (int Got, int Had)? LastPartialReply { get; set; }
|
||||
/// <summary>Bumps whenever the flags change (views rebuild their caches on it).</summary>
|
||||
public int Revision { get; private set; }
|
||||
|
||||
|
|
@ -77,10 +97,16 @@ internal sealed class QuestFlagStore
|
|||
|
||||
public bool Loading => _pending != null || AwaitingOurs;
|
||||
|
||||
/// <summary>Seconds left on the server's /myquests limit (0 when a request would be answered).</summary>
|
||||
public int ThrottleSecondsLeft(long nowMs) =>
|
||||
nowMs < ThrottledUntilMs ? (int)((ThrottledUntilMs - nowMs + 999) / 1000) : 0;
|
||||
|
||||
/// <summary>Sends /myquests unless one went out moments ago. Returns false if nothing was sent.</summary>
|
||||
public bool Request(Func<string, bool> invokeChat, long nowMs)
|
||||
{
|
||||
if (nowMs - _requestedMs < MinRequestGapMs) return false;
|
||||
// The server would only answer with its throttle line; don't spend the request.
|
||||
if (nowMs < ThrottledUntilMs) return false;
|
||||
_requestedMs = nowMs;
|
||||
Interlocked.Increment(ref _selfSends);
|
||||
if (!invokeChat("/myquests"))
|
||||
|
|
@ -120,6 +146,16 @@ internal sealed class QuestFlagStore
|
|||
Revision++;
|
||||
return MyQuestsLine.Disabled;
|
||||
}
|
||||
if (line.Contains(ThrottledText, StringComparison.Ordinal))
|
||||
{
|
||||
// No reply is coming: stop "Reading..." and keep the flags already held. The minute
|
||||
// really started at the last answered request; a full minute from now is the safe side.
|
||||
_serverThrottles = true;
|
||||
ThrottledUntilMs = nowMs + ServerThrottleMs;
|
||||
AwaitingOurs = false;
|
||||
Revision++;
|
||||
return MyQuestsLine.Throttled;
|
||||
}
|
||||
if (line.IndexOf(" solves (", StringComparison.Ordinal) < 0) return MyQuestsLine.None;
|
||||
|
||||
QuestFlag? flag = Parse(line);
|
||||
|
|
@ -139,9 +175,27 @@ internal sealed class QuestFlagStore
|
|||
|
||||
if (_pending != null && nowMs - _lastLineMs >= QuietMs)
|
||||
{
|
||||
Flags = _pending;
|
||||
Dictionary<string, QuestFlag> reply = _pending;
|
||||
_pending = null;
|
||||
int had = Flags.Count;
|
||||
// A full reply replaces the list (a flag the server dropped goes away). One much
|
||||
// smaller than what is held lost lines on the way (the engine's chat queue drops the
|
||||
// oldest of a long burst): update what came and keep the rest, rather than blanking.
|
||||
if (had >= PartialReplyMinHeld && reply.Count > 0 && reply.Count < had * PartialReplyRatio)
|
||||
{
|
||||
var merged = new Dictionary<string, QuestFlag>(Flags, StringComparer.OrdinalIgnoreCase);
|
||||
foreach (KeyValuePair<string, QuestFlag> kv in reply) merged[kv.Key] = kv.Value;
|
||||
Flags = merged;
|
||||
LastPartialReply = (reply.Count, had);
|
||||
}
|
||||
else
|
||||
{
|
||||
Flags = reply;
|
||||
}
|
||||
LastReadUtc = DateTime.UtcNow;
|
||||
// On a throttling server any reply (ours, the player's, RynthAi's poll) starts its minute.
|
||||
if (_serverThrottles)
|
||||
ThrottledUntilMs = nowMs + ServerThrottleMs - QuietMs;
|
||||
AwaitingOurs = false;
|
||||
Revision++;
|
||||
}
|
||||
|
|
@ -158,6 +212,9 @@ internal sealed class QuestFlagStore
|
|||
AwaitingOurs = false;
|
||||
LastReadUtc = DateTime.MinValue;
|
||||
ServerDisabled = false;
|
||||
ThrottledUntilMs = long.MinValue / 2;
|
||||
_serverThrottles = false;
|
||||
LastPartialReply = null;
|
||||
Revision++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,11 @@ internal static class ServerTags
|
|||
public const string Aelrynth = "Aelrynth";
|
||||
public const string Conquest = "Conquest";
|
||||
public const string Levistras = "Levistras";
|
||||
/// <summary>Infinite Leaftide (ACECustom). Its server rules come from RynthILT ("RynthILT.Server").</summary>
|
||||
public const string InfiniteLeaftide = "InfiniteLeaftide";
|
||||
|
||||
/// <summary>Tags with a quest pack (Resources\quests.<tag>.csv) or features.</summary>
|
||||
public static readonly string[] Known = { Aelrynth, Conquest, Levistras };
|
||||
public static readonly string[] Known = { Aelrynth, Conquest, Levistras, InfiniteLeaftide };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -31,8 +33,9 @@ internal static class ServerTags
|
|||
/// mod's player properties 9101-9103, which only Aelrynth sends.
|
||||
/// Aelrynth's live config still names the world "Aeshnidae" (its earlier name); both count.
|
||||
/// ConquestAC and Levistras are matched on their world names, as upstream does
|
||||
/// (Decal's CharacterFilter.Server). Infinite Leaftide has no RynthOracle pages: its screens are
|
||||
/// RynthILT's, so RynthCore's "ilt" server gives no tag here.
|
||||
/// (Decal's CharacterFilter.Server). Infinite Leaftide is matched on a world name containing
|
||||
/// "Leaftide", or on RynthILT's own verdict (its world list or the character's override) when
|
||||
/// RynthILT is loaded.
|
||||
/// </summary>
|
||||
internal sealed class ServerIdentity
|
||||
{
|
||||
|
|
@ -55,11 +58,12 @@ internal sealed class ServerIdentity
|
|||
Set("", "", "not logged in");
|
||||
}
|
||||
|
||||
/// <param name="rynthIltSaysIlt">RynthILT's profile reports an ILT world (IltServerLink); false without RynthILT.</param>
|
||||
/// <param name="engine">
|
||||
/// RynthCore's server list (plugin API v86, ServerStateClient); null on older engines. When there,
|
||||
/// it decides: it already applies this character's overrides and the Diagnostics page's pick.
|
||||
/// </param>
|
||||
public void Refresh(RynthCoreHost host, uint playerId, EngineServerState? engine = null)
|
||||
public void Refresh(RynthCoreHost host, uint playerId, bool rynthIltSaysIlt = false, EngineServerState? engine = null)
|
||||
{
|
||||
if (engine != null)
|
||||
{
|
||||
|
|
@ -98,6 +102,11 @@ internal sealed class ServerIdentity
|
|||
source = "the Aelrynth Bank properties (older engine)";
|
||||
}
|
||||
}
|
||||
if (tag.Length == 0 && rynthIltSaysIlt)
|
||||
{
|
||||
tag = ServerTags.InfiniteLeaftide;
|
||||
source = "RynthILT: an Infinite Leaftide world";
|
||||
}
|
||||
Set(tag, world, source);
|
||||
}
|
||||
|
||||
|
|
@ -139,6 +148,7 @@ internal sealed class ServerIdentity
|
|||
/// <summary>The tag for a RynthCore server id; "" for servers without RynthOracle features.</summary>
|
||||
public static string TagForEngineId(string? id) => (id ?? "").Trim().ToLowerInvariant() switch
|
||||
{
|
||||
EngineServerState.IltId => ServerTags.InfiniteLeaftide,
|
||||
EngineServerState.AelrynthId => ServerTags.Aelrynth,
|
||||
"conquest" => ServerTags.Conquest,
|
||||
"levistras" => ServerTags.Levistras,
|
||||
|
|
@ -148,6 +158,7 @@ internal sealed class ServerIdentity
|
|||
/// <summary>The RynthCore server id for a tag; "" for none.</summary>
|
||||
public static string EngineIdForTag(string? tag) => tag switch
|
||||
{
|
||||
ServerTags.InfiniteLeaftide => EngineServerState.IltId,
|
||||
ServerTags.Aelrynth => EngineServerState.AelrynthId,
|
||||
ServerTags.Conquest => "conquest",
|
||||
ServerTags.Levistras => "levistras",
|
||||
|
|
@ -165,6 +176,9 @@ internal sealed class ServerIdentity
|
|||
return ServerTags.Conquest;
|
||||
if (w.Equals(ServerTags.Levistras, StringComparison.OrdinalIgnoreCase))
|
||||
return ServerTags.Levistras;
|
||||
// "InfiniteLeaftide", "Infinite Leaftide", staging copies: RynthILT's own world rule.
|
||||
if (w.IndexOf("Leaftide", StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
return ServerTags.InfiniteLeaftide;
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ internal sealed class VoidDot
|
|||
/// <summary>Cast while Surge of Destruction was up (shown highlighted).</summary>
|
||||
public bool Destruction;
|
||||
|
||||
/// <summary>ConquestAC scales void DoT duration by the caster's augs (1.0 elsewhere).</summary>
|
||||
/// <summary>A server's own rule scales void DoT duration (Conquest's, from RynthConquest's profile; 1.0 elsewhere).</summary>
|
||||
public double DurationScale = 1.0;
|
||||
|
||||
/// <summary>Corrosion 15 s, Corruption and Destructive Curse 30 s (upstream's retail values), times the server's scale.</summary>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,24 @@ internal sealed class OracleContext
|
|||
public readonly VoidTracker Void = new();
|
||||
public readonly FellowshipTracker Fellowship = new();
|
||||
public readonly ServerIdentity Server = new();
|
||||
/// <summary>RynthILT's server profile (Leaftide features, fellowship rules, the /qb list); None without RynthILT.</summary>
|
||||
public readonly IltServerLink Ilt = new();
|
||||
/// <summary>RynthILT's "RynthILT.Data" (charms, pet breeding, the Temple guardians).</summary>
|
||||
public readonly RynthCore.Plugin.Shared.RynthIltDataClient IltData = new();
|
||||
/// <summary>The charms RynthILT last reported (None without RynthILT); read while the Character tab shows.</summary>
|
||||
public RynthCore.Plugin.Shared.IltCharmsView Charms = RynthCore.Plugin.Shared.IltCharmsView.None;
|
||||
/// <summary>The last charm Toggle's outcome, shown under the charms list.</summary>
|
||||
public string CharmMessage = "";
|
||||
/// <summary>RynthILT's pet breeding tracker (None without it); read while the Pet Breeding tab shows.</summary>
|
||||
public RynthCore.Plugin.Shared.IltBreedingView Breeding = RynthCore.Plugin.Shared.IltBreedingView.None;
|
||||
/// <summary>The last breeding button's outcome, shown under the tab's buttons.</summary>
|
||||
public string BreedingMessage = "";
|
||||
/// <summary>RynthILT's Temple guardians (None without RynthILT 0.3.3+); read while the Quests tab shows on Infinite Leaftide.</summary>
|
||||
public RynthCore.Plugin.Shared.IltGuardianView Guardian = RynthCore.Plugin.Shared.IltGuardianView.None;
|
||||
/// <summary>Goes up each time <see cref="Guardian"/> changes, so the Quests list rebuilds its guardian rows.</summary>
|
||||
public int GuardianRevision;
|
||||
/// <summary>The last guardian button's outcome, shown under the guardian controls.</summary>
|
||||
public string GuardianMessage = "";
|
||||
/// <summary>RynthAi's session (the one session every tracker shows); read while the Character tab shows.</summary>
|
||||
public readonly RynthCore.Plugin.Shared.RynthAiSessionClient AiSession = new();
|
||||
/// <summary>The last session RynthAi reported; SessionKnown false without RynthAi.</summary>
|
||||
|
|
@ -27,10 +45,11 @@ internal sealed class OracleContext
|
|||
public bool SessionKnown;
|
||||
/// <summary>RynthCore's server list (API v86) and the active server owner's settings; State null on older engines.</summary>
|
||||
public readonly RynthCore.Plugin.Shared.ServerStateClient ServerState = new();
|
||||
/// <summary>ConquestAC-only data (tag Conquest); fed only while on ConquestAC.</summary>
|
||||
public readonly ConquestData Conquest = new();
|
||||
/// <summary>Aelrynth's leaderboards (tag Aelrynth); fed only while on Aelrynth.</summary>
|
||||
public readonly AelrynthBoards Boards = new();
|
||||
/// <summary>
|
||||
/// The active server's Void DoT duration rule: its plugin's profile value "voidDotDurationScale"
|
||||
/// (RynthConquest publishes Conquest's), 1 on every other server or without the plugin.
|
||||
/// </summary>
|
||||
public double VoidDotScale = 1.0;
|
||||
|
||||
/// <summary>Titles the character holds (engine API v75); TitlesKnown false until the engine has the list.</summary>
|
||||
public readonly System.Collections.Generic.HashSet<int> EarnedTitles = new();
|
||||
|
|
@ -64,6 +83,34 @@ internal sealed class OracleContext
|
|||
/// <summary>Set by the plugin: runs a chat command through RynthCore's plugin dispatch (another plugin's window).</summary>
|
||||
public Func<string, bool> RunCommand = _ => false;
|
||||
|
||||
/// <summary>Set by the plugin: asks RynthILT to use a carried charm or Guardian Hand (its toggle id).</summary>
|
||||
public Func<uint, bool> ToggleCharm = _ => false;
|
||||
|
||||
/// <summary>Set by the plugin: sends a verb to RynthILT's breeding tracker (RynthIltDataApi PetBreedingCommand).</summary>
|
||||
public Func<string, bool> BreedingCommand = _ => false;
|
||||
|
||||
/// <summary>Set by the plugin: sends a verb to RynthILT's guardians (RynthIltDataApi GuardianCommand).</summary>
|
||||
public Func<string, bool> GuardianCommand = _ => false;
|
||||
|
||||
/// <summary>Set by the plugin: "<verb> <targets>" for RynthNav's /rnav (go, route, arrow); false when RynthNav isn't there.</summary>
|
||||
public Func<string, bool> SendNav = _ => false;
|
||||
|
||||
/// <summary>Set by the plugin: the name of a Parchment carried (null when none). Null here: the Quests tab doesn't look.</summary>
|
||||
public Func<string?>? ParchmentFinder;
|
||||
|
||||
/// <summary>
|
||||
/// Set by the plugin: RynthAi is loaded and so can take the Quests tab's "/ub give" (the Give
|
||||
/// Parchment button). False disables the button with a tooltip.
|
||||
/// </summary>
|
||||
public Func<bool> UbGiveAvailable = () => false;
|
||||
/// <summary>
|
||||
/// The loaded RynthAi answered a "/ub give" with "Unrecognized /ub command": it has no such verb,
|
||||
/// so the Give Parchment button stays disabled (set by the plugin from the chat line).
|
||||
/// </summary>
|
||||
public bool UbGiveMissing;
|
||||
/// <summary>When the Give Parchment button last sent "/ub give" (NowMs), so a rejection in chat can be tied to it.</summary>
|
||||
public long UbGiveSentMs = long.MinValue / 2;
|
||||
|
||||
/// <summary>Set by the plugin: shows or hides the Quest Timers window.</summary>
|
||||
public Action<bool> SetQuestTimersWindow = _ => { };
|
||||
/// <summary>Set by the plugin: whether the Quest Timers window is showing.</summary>
|
||||
|
|
@ -71,6 +118,18 @@ internal sealed class OracleContext
|
|||
|
||||
public Func<uint, int> Props => id => Character.Int(Host, id);
|
||||
|
||||
/// <summary>
|
||||
/// A chat line seen just after the Give Parchment button sent "/ub give": RynthAi's "Unrecognized
|
||||
/// /ub command" means this RynthAi has no such verb, so the button stays off. True when it did.
|
||||
/// </summary>
|
||||
public bool NoteChatLineForGive(string line, long nowMs)
|
||||
{
|
||||
if (nowMs - UbGiveSentMs >= 5000 || UbGiveMissing) return false;
|
||||
if (line.IndexOf("Unrecognized /ub", StringComparison.OrdinalIgnoreCase) < 0) return false;
|
||||
UbGiveMissing = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>A line in the player's chat window only (nothing is sent to the server).</summary>
|
||||
public void Print(string text)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,16 +27,32 @@ internal sealed class OracleSettings
|
|||
public bool QuestTimersOpen;
|
||||
/// <summary>The selected tab, by name (the set of tabs depends on the server).</summary>
|
||||
public string TabName = "Quests";
|
||||
/// <summary>ConquestAC: "/bank deposit" at every ten-minute mark (upstream's auto-deposit; off by default).</summary>
|
||||
public bool ConquestAutoDeposit;
|
||||
/// <summary>Say so in chat when a tracked quest's timer comes up.</summary>
|
||||
public bool AlertTimers = true;
|
||||
/// <summary>false: only tracked quests are watched; true: every quest the character holds.</summary>
|
||||
public bool AlertAllTimers;
|
||||
|
||||
private static string FilePath => Path.Combine(
|
||||
/// <summary>Where the tests keep the settings file (a scratch path); null means the rynthoracle.json in RynthCore's %APPDATA% folder.</summary>
|
||||
internal static string? PathOverride;
|
||||
|
||||
internal static string FilePath => PathOverride ?? Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RynthCore", "rynthoracle.json");
|
||||
|
||||
/// <summary>The names this version reads and writes; any other value in the file is kept as it was.</summary>
|
||||
private static readonly string[] KnownNames =
|
||||
{
|
||||
"readQuestsAtLogin", "hideOwnQuestReplies", "checkQuestListDaily", "lastQuestListCheck", "autoShowVoidWindow",
|
||||
"mainWindowOpen", "questTimersOpen", "alertTimers", "alertAllTimers", "tabName",
|
||||
};
|
||||
// "conquestAutoDeposit" moved to RynthConquest (2026-10-20), which takes it over from this file once;
|
||||
// it is kept here (as any value this version doesn't use) until then.
|
||||
|
||||
/// <summary>
|
||||
/// Values in the file this version doesn't use (a newer version's, or a setting that moved to
|
||||
/// another plugin, which reads it from here once), written back unchanged so a save never loses them.
|
||||
/// </summary>
|
||||
private readonly System.Collections.Generic.List<(string Name, string Raw)> _kept = new();
|
||||
|
||||
public void Load()
|
||||
{
|
||||
try
|
||||
|
|
@ -45,13 +61,15 @@ internal sealed class OracleSettings
|
|||
using var doc = JsonDocument.Parse(File.ReadAllText(FilePath));
|
||||
JsonElement r = doc.RootElement;
|
||||
if (r.ValueKind != JsonValueKind.Object) return;
|
||||
_kept.Clear();
|
||||
foreach (JsonProperty p in r.EnumerateObject())
|
||||
if (Array.IndexOf(KnownNames, p.Name) < 0 && !_kept.Exists(k => k.Name == p.Name)) _kept.Add((p.Name, p.Value.GetRawText()));
|
||||
ReadQuestsAtLogin = Bool(r, "readQuestsAtLogin", ReadQuestsAtLogin);
|
||||
HideOwnQuestReplies = Bool(r, "hideOwnQuestReplies", HideOwnQuestReplies);
|
||||
CheckQuestListDaily = Bool(r, "checkQuestListDaily", CheckQuestListDaily);
|
||||
AutoShowVoidWindow = Bool(r, "autoShowVoidWindow", AutoShowVoidWindow);
|
||||
MainWindowOpen = Bool(r, "mainWindowOpen", MainWindowOpen);
|
||||
QuestTimersOpen = Bool(r, "questTimersOpen", QuestTimersOpen);
|
||||
ConquestAutoDeposit = Bool(r, "conquestAutoDeposit", ConquestAutoDeposit);
|
||||
AlertTimers = Bool(r, "alertTimers", AlertTimers);
|
||||
AlertAllTimers = Bool(r, "alertAllTimers", AlertAllTimers);
|
||||
if (r.TryGetProperty("tabName", out JsonElement t) && t.ValueKind == JsonValueKind.String) TabName = t.GetString() ?? TabName;
|
||||
|
|
@ -78,11 +96,12 @@ internal sealed class OracleSettings
|
|||
sb.Append(" \"autoShowVoidWindow\": ").Append(AutoShowVoidWindow ? "true" : "false").Append(",\n");
|
||||
sb.Append(" \"mainWindowOpen\": ").Append(MainWindowOpen ? "true" : "false").Append(",\n");
|
||||
sb.Append(" \"questTimersOpen\": ").Append(QuestTimersOpen ? "true" : "false").Append(",\n");
|
||||
sb.Append(" \"conquestAutoDeposit\": ").Append(ConquestAutoDeposit ? "true" : "false").Append(",\n");
|
||||
sb.Append(" \"alertTimers\": ").Append(AlertTimers ? "true" : "false").Append(",\n");
|
||||
sb.Append(" \"alertAllTimers\": ").Append(AlertAllTimers ? "true" : "false").Append(",\n");
|
||||
sb.Append(" \"tabName\": \"").Append(JsonEncodedText.Encode(TabName).ToString()).Append("\"\n");
|
||||
sb.Append("}\n");
|
||||
sb.Append(" \"tabName\": \"").Append(JsonEncodedText.Encode(TabName).ToString()).Append('"');
|
||||
foreach ((string name, string raw) in _kept)
|
||||
sb.Append(",\n \"").Append(JsonEncodedText.Encode(name).ToString()).Append("\": ").Append(raw);
|
||||
sb.Append("\n}\n");
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(FilePath)!);
|
||||
string tmp = FilePath + ".tmp";
|
||||
File.WriteAllText(tmp, sb.ToString());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public static unsafe class PluginExports
|
|||
public static IntPtr GetVersion()
|
||||
{
|
||||
// Keep in step with RynthOraclePlugin.Version (a u8 literal can't be built from a const string).
|
||||
try { return LiteralPointer("0.2.2"u8); }
|
||||
try { return LiteralPointer("0.3.0"u8); }
|
||||
catch { return IntPtr.Zero; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
Server,Name,QuestFlag,Url,Hint
|
||||
Conquest,Darshmaul the Brutal,assaultonaimaru,,Shoushi - Portal to Fort 33.6S 74.9E - Kill Darshmaul the Brutal 34.3S 80.7E - Loot Finger - Shoushi - Give to Vovran 33.4S 72.8E
|
||||
Conquest,Forgotten One,GhostDenCompleted,,Desolution Beach - Helsing 82.5N 43.5W - Den of Ghosts 82.4N 41.3W - Head North and hug left. Don't go downstairs - Defeat The Forgotten One and Loot Head - Back to Helsing
|
||||
Conquest,Ice Giants,icegiantkilltask,,No hint available
|
||||
Conquest,Thorsten's Tears,cragstonetearspickup,,No hint available
|
||||
Conquest,Uber Bobo,uberpawlooted,,No hint available
|
||||
Conquest,Uber Curator,uberrtwreward,,No hint available
|
||||
|
244
Plugins/RynthCore.Plugin.RynthOracle/Resources/dynstamps.csv
Normal file
244
Plugins/RynthCore.Plugin.RynthOracle/Resources/dynstamps.csv
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
Area,Place,Npc,Reward,Stamp,Note
|
||||
"Facility Hub","Folthid Cellar","Raxanza Folthid","O-Yoroi Leggings","Dynamic_1_Aq2hMsFmW!",""
|
||||
"Facility Hub","Folthid Cellar","Felscuda","Healing Rabbit Pie","Dynamic_1_&9jiyTB!","8.8S, 53.1E"
|
||||
"Facility Hub","Folthid Cellar","Mi Krau-Li","examines your Parchment","Dynamic_1_WAuFukcRLoL5!",""
|
||||
"Looking Around","","Le-Ai Rea","Blue Molly","Dynamic_1_XH!!nh#^NaRp!","75.9S 57.3E"
|
||||
"Looking Around","Frost Haven","Robert","Greater Celdon Shadow Sleeves","Dynamic_1_HLq&!",""
|
||||
"Looking Around","Frost Haven","Elijah","Homemade Stout","Dynamic_1_MpBeVDU!",""
|
||||
"Looking Around","Frost Haven","Emma","Frost Slingshot","Dynamic_1_bEt6H5ECwGb2!",""
|
||||
"Looking Around","Frost Haven","Chef Pleist","Stone Mace","Dynamic_1_HgaUKA#hxa!",""
|
||||
"Looking Around","Frost Haven","The Mayor","Fried Egg","Dynamic_1_MRfxp5!g!",""
|
||||
"Looking Around","Frost Haven","Numb","Perfect Coruscating Isparian Mace","Dynamic_1_z8LpGZpe4rq!",""
|
||||
"Looking Around","Land Bridge Staging Complex","Director's Majordomo","Spitter Trochanter Metamorphi","Dynamic_1_FZYLYrAW1Zb!",""
|
||||
"Looking Around","Frost Haven","Mossy Chamber","Broken Virindi","Dynamic_1_ANND",""
|
||||
"Looking Around","Freebooter","Jusad the Collector","Renegade Atlatl of the Mountains","Dynamic_1_!mqkm9M!",""
|
||||
"Looking Around","Lum Seer","Shade of Lady Adja","Frost Board with Nail","Dynamic_1_ps6iG^P!ndH!",""
|
||||
"Looking Around","Frost Haven","Ka'hiri","Hearty Spiced Applesauce","Dynamic_1_s5MAzDcP9!",""
|
||||
"Looking Around","Frost Haven","Liam of Gelid","Composite Crossbow with Handle","Dynamic_1_7cv3O^MTLLKzs&!",""
|
||||
"Looking Around","84.1N, 44.1E","Aerlinthe Node Golem","Silifi of Crimson Stars","Dynamic_1_D6YxLUyUIW!","84.1N, 44.1E"
|
||||
"Looking Around","62.0N, 18.0E","Esper Node Golem","Composite Bow with Handle","Dynamic_1_LE5V8SVHG!","62.0N, 18.0E"
|
||||
"Looking Around","93.8N, 67.4W","Halaetan Node Golem","Slashing Longbow","Dynamic_1_QfLhcZJ64Hkold!","93.8N, 67.4W"
|
||||
"Looking Around","64.8S, 59.3E","Linvak Node Golem","Greater Celdon Shadow Girth","Dynamic_1_V8&t5$!","64.8S, 59.3E"
|
||||
"Looking Around","Ulgrim Island","Ulgrim the Unappreciated","Applesauce","Dynamic_1_x!zs79y!",""
|
||||
"Looking Around","Fake Niffis Crate Quest","Chef Jonus","Fish","Dynamic_1_j&T!ZrQwKvo!",""
|
||||
"Looking Around","Frost Haven","Larnia","Acid Hand Axe","Dynamic_1_88P$YBwEl!",""
|
||||
"Looking Around","Tanada Chamber of Scroll / Fire","Tanada Han-Tu","Hearty Ice Cream","Dynamic_1_STjY86!0Iu8x!",""
|
||||
"Looking Around","Frost Haven","Tanada Hido","Acid Mace","Dynamic_1_3ZhBEF!",""
|
||||
"Looking Around","Frost Haven","Tanada Shouka","Pouch of Dried Meat","Dynamic_1_YgClBFy!",""
|
||||
"Looking Around","Gerent's Compound at 87.2S, 17.5W","Representative of the Singularity","Fish","Dynamic_1_qkU0b^i!","87.2S, 17.5W"
|
||||
"Odd Stamps","93.2N, 48.2W in the Shattered Outlands","Arialle du Bellenesse","Healing Holtburger","Dynamic_1_ADm5RsrDGCbT!","93.2N, 48.2W"
|
||||
"Odd Stamps","Crater","Silencia's Magma Golem","Slicing Royal Atlatl","Dynamic_1_fR730X5VsPULE5!",""
|
||||
"Odd Stamps","Colosseum","Master Arbitrator","Palenqual's Tewhate","Dynamic_1_XnFt&!",""
|
||||
"Odd Stamps","","Colosseum Ticket Vendor","Silifi of Crimson Stars","Dynamic_1_luguukhgZg!",""
|
||||
"Odd Stamps","Beach Fort","Suzuhara Sheshumi","Silifi of Crimson Stars","Dynamic_1_n5u2imCs!",""
|
||||
"Odd Stamps","Obsidian Plains","Varetha","Major Smoldering Atlan Bow","Dynamic_1_P1&xxk5!","44.3S, 62.5W"
|
||||
"Odd Stamps","Crystal Crag","Oorjit","Perfect Shimmering Isparian Bow","Dynamic_1_lPn&BaZ!",""
|
||||
"Odd Stamps","","Jyotsana","Cragstone Farms Mac&Cheese","Dynamic_1_YCGJJ7cA!",""
|
||||
"Odd Stamps","","Tokashi Ando","Perfect Dissolving Isparian Crossbow","Dynamic_1_R#HIf!",""
|
||||
"Odd Stamps","Ries Woron's Story","Thrungus","Expired Stamina Draught","Dynamic_1_eMJVhyPzaa$aGn!",""
|
||||
"Odd Stamps","Mite Maze","Roderick","Apple Pie","Dynamic_1_#C^p&w0gV$$!",""
|
||||
"Odd Stamps","Sawato","Ssavish","Composite Bow with Handle","Dynamic_1_NMlDXfx2t!",""
|
||||
"Odd Stamps","dryreach rescue","Dansha-Ki","Composite Bow with Handle","Dynamic_1_FnXoHWS&kaM!",""
|
||||
"Odd Stamps","Seat of Knorr","Arikas, Warden of Knorr","Hearty Healing Rabbit Noodle","Dynamic_1_aWOWTc30f4",""
|
||||
"Odd Stamps","Swamp Garden","Terese","Diforsa Bracers","Dynamic_1_PTy0kqqTLP1Dn^!",""
|
||||
"Odd Stamps","Dark Isle","Tyrina of Arwic","Major Shadow Gauntlets","Dynamic_1_zJNxGBc!","84.7n 58.7e"
|
||||
"Odd Stamps","Dark Isle","Francois di Terli","Habraeloi","Dynamic_1_3!Og!",""
|
||||
"Odd Stamps 2","Aun Settlement 82.7N 21.2E.","Aun Tikakhe","Good Chilling Isparian Mace","Dynamic_1_hafO$cQvbkg!","82.7N 21.2E"
|
||||
"Odd Stamps 2","","Aun Saritea","Health Tonic","Dynamic_1_7yW17JvMHKu!",""
|
||||
"Odd Stamps 2","","Aun Aulakhe","Mana Rabbit Pie","Dynamic_1_5xE2TM!",""
|
||||
"Odd Stamps 2","Lost Wish Cottages (Arwic) 42.6n 62.4e","Lartorus","Pants","Dynamic_1_$GB72K!","42.6n 62.4e"
|
||||
"Odd Stamps 2","Catacombs of Opposition","Ripper","Gladiatorial Tunic","Dynamic_1_69Rjbany2pKD!",""
|
||||
"Odd Stamps 2","","Rat Nose","Fine Atlan Staff","Dynamic_1_eBlku!",""
|
||||
"Odd Stamps 2","","Nanoc, Basher of Bugs","Mana Potion","Dynamic_1_XCTiy!",""
|
||||
"Odd Stamps 2","","Narg","Iron Rusted Mace","Dynamic_1_S!AhI!",""
|
||||
"Odd Stamps 2","","Scout Luzumin Abigwei","Alduressa Helm","Dynamic_1_NFf5!",""
|
||||
"Odd Stamps 2","","Teela","Orange Molly","Dynamic_1_Bl#Y!",""
|
||||
"Odd Stamps 2","","Scout Tel al-Arat","Envoy's Heaume","Dynamic_1_AJ3Wm9Bk!",""
|
||||
"Odd Stamps 2","","Pincer Danta","Olthoi Sollerets","Dynamic_1_VezOOBWbn43KU!!",""
|
||||
"Odd Stamps 2","Vissidal","Merwart Pelagurg","Superior Smoldering Atlan Staff","Dynamic_1_DOIC1!",""
|
||||
"Odd Stamps 2","Vissidal","Merwart Urglurg","Butter Knife of Slaying","Dynamic_1_&!iRR#RrhnGA!",""
|
||||
"Odd Stamps 2","Vissidal","Dayla Bint Kazm","Hearty Healing Chicken Pie","Dynamic_1_nDAXG!",""
|
||||
"Odd Stamps 2","Vissidal","Peng-Ya","Major Dissolving Isparian Crossbow","Dynamic_1_sx^9H^&Mnqp!",""
|
||||
"Odd Stamps 2","Vissidal","Colista Fluress","Lesser Amuli Shadow Leggings","Dynamic_1_Ej!Zz!",""
|
||||
"Odd Stamps 2","99.7S 96.7W","Surloshen Realaidain","Hammer of Lightning","Dynamic_1_tiiFC!","99.7S 96.7W"
|
||||
"Odd Stamps 2","Silyiun - 89.1N 47.6W","Fiun Gaya","Enhanced Shadow Gauntlets","Dynamic_1_hev0!","89.1N 47.6W"
|
||||
"Odd Stamps 2","Hermit - Thrungus Hole","Hermit","Scored Amuli Leggings","Dynamic_1_rDBG!",""
|
||||
"Odd Stamps 2","93.2N 48.2W - Eastwatch","Commander Rylane di Cinghalle","Acid Crossbow","Dynamic_1_pZpx41&!","93.2N 48.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Arbelests","Healing Carrot Soup","Dynamic_1_L3Hb3O!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Fists","Platemail Breastplate","Dynamic_1_xj&USOHNL9K&!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Bows","Tasty Stout","Dynamic_1_hw2LNdjT6!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Atlatls","Composite Crossbow with Handle","Dynamic_1_P6!!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Axes","Three Eyed Guppy","Dynamic_1_xX^IHjOo##J$8E!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Blades","Flaming Weeping Dagger","Dynamic_1_iFuvP!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Staves","Composite Crossbow","Dynamic_1_J$JV&VKf!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Orbs","Health Tincture","Dynamic_1_S&JMdWiBDy!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Maces","Wooden Scarecrow Guise","Dynamic_1_^pTx!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","32.0N, 43.2W - Virindi Crafters","Crafter of Knives","Scalemail Hauberk","Dynamic_1_6ZR$k^$Srwc3g!","32.0N, 43.2W"
|
||||
"Odd Stamps 2","83.4S 97.2E - Ithaenc","Abbess Zik'Lir","Hearty Fish Noodle","Dynamic_1_jmCfm1p5a!","83.4S 97.2E"
|
||||
"Odd Stamps 2","72.8N,25.0W - Stonehold nearby","Lord Pyrovor","Enhanced Shadow Greaves","Dynamic_1_Tw$7Zwmutan!","72.8N,25.0W"
|
||||
"Odd Stamps 2","VoD Encampment","Guard Alfric","Bowl of Rice","Dynamic_1_LZkvsu4Ln2$h!",""
|
||||
"Odd Stamps 2","VoD Encampment","Guard Taziq","Blackfire Shadow Sollerets","Dynamic_1_t9uxr!",""
|
||||
"Odd Stamps 2","VoD Encampment","Guard Q'alia","Ancient Relic Gauntlets","Dynamic_1_m1KeUXELMuH!",""
|
||||
"Odd Stamps 2","VoD Encampment","Guard Li","Frost Hatchet","Dynamic_1_XgrV$!",""
|
||||
"Odd Stamps 2","77.7S 97.0E Ithaenc","Shah-hi","Katar","Dynamic_1_G3N9HSXlowLT$!","77.7S 97.0E"
|
||||
"Odd Stamps 2","Releasing the Light - Reward Room","Calitoth","Fish","Dynamic_1_mu^91#T!",""
|
||||
"Odd Stamps 2","VoD Encampment","Guardian of the Forbidden","Princely Runed Dart Flinger","Dynamic_1_#BELoT72Ib!","Small Creepy Statue"
|
||||
"Odd Stamps 2","Shattered Outlands 94.0n 45.9w","Torgash","examines your Parchment","Dynamic_1_S","94.0n 45.9w"
|
||||
"Odd Stamps 2","Hoshino Must Die last room","Spirit of Bist'elle","Enhanced Shadow Breastplate","Dynamic_1_b!",""
|
||||
"Bandit Castle","","Karwin, the Lunatic","Chainmail Pauldrons","Dynamic_1_HIlMkY!",""
|
||||
"Bandit Castle","","Kiriel Shadowborn","Healing Apple Pie","Dynamic_1_WBzVFJpFUzHkC!",""
|
||||
"Bandit Castle","","Jourgensson","Hearty Healing Mushroom Pie","Dynamic_1_$W&Pl4!",""
|
||||
"Bandit Castle","","Gillian the Poacher","Peppermint Ice Cream","Dynamic_1_5oLp!",""
|
||||
"Bandit Castle","","Alison Dulane","Amuli Shadow Leggings","Dynamic_1_079u9!",""
|
||||
"Bandit Castle","","Arianna the Adept","Expired Stamina Draught","Dynamic_1_hZIsyYE!!OmcQ!",""
|
||||
"Bandit Castle","","Shanrek the Forger","Sparring Shirt","Dynamic_1_fbcmDRC!",""
|
||||
"Bandit Castle","","Neela Nashua","Perfect Dissolving Isparian Spear","Dynamic_1_4tXQFu&&o!",""
|
||||
"Bandit Castle","","Gwillim, the Apprentice","Lightning Flanged Mace","Dynamic_1_is#X6rBaprU!",""
|
||||
"Bur","","Drogur","Frost Yari","Dynamic_1_KS8e32dtk7t!",""
|
||||
"Bur","","Collector Golem","Upper Exoskeleton Metamorphi","Dynamic_1_4xdYA1QvaiDf^!",""
|
||||
"Bur","","Kuurak","Hearty Healing Chicken Noodle","Dynamic_1_Zapx!",""
|
||||
"Bur","","Furgal","Spitter Thorax Metamorphi","Dynamic_1_4rk&MTz!",""
|
||||
"Bur","","Tibik","Gear Crossbow","Dynamic_1_!Ce^d!",""
|
||||
"Bur","","Nimeruuk","Greater Celdon Shadow Sleeves","Dynamic_1_zIX1Sf6FJt!",""
|
||||
"Bur","","Kurket","Acidic Rejuvenation","Dynamic_1_snVaz#0Ze3R#4M!",""
|
||||
"Bur","","Brogosh","Lugian Morning Star","Dynamic_1_$9YdvC2jYTxWZ!",""
|
||||
"Bur","","Mohor","Quality Isparian Crossbow","Dynamic_1_qpXiWqwBTN4!",""
|
||||
"Bur","","Kushuk","Silifi of Crimson Stars","Dynamic_1_3ISBG!",""
|
||||
"Bur","","Borsh","Health Tonic","Dynamic_1_Jh4!",""
|
||||
"Bur","","Kuuru","Electric Compound Bow","Dynamic_1_vNktko1!",""
|
||||
"Bur","","Torgluuk, High Shaman of Kor-Gursha","Stout","Dynamic_1_2yxpXSMY!",""
|
||||
"Bur","","Scout Leader Tmauruk","Hood","Dynamic_1_fEiU!",""
|
||||
"Bur","","Gruuk'lar","Rynthid Tentacle Dagger","Dynamic_1_xFipmT1!",""
|
||||
"Gear Knight","Inner Sea Gearknight Invasion","Lieutenant Micham","Dabus","Dynamic_1_CQxkFJvoJrVx!",""
|
||||
"Gear Knight","Inner Sea Gearknight Invasion","Sir Oakley","Composite Crossbow with Handle","Dynamic_1_lh9wOaXR0!",""
|
||||
"Gear Knight","Inner Sea Gearknight Invasion","Lieutenant Faen","Blunt Bow","Dynamic_1_Vz#gp!",""
|
||||
"Gear Knight","Inner Sea Gearknight Invasion","Sir Stavitor","Red Tea","Dynamic_1_ogt05i!",""
|
||||
"Gear Knight","Inner Sea Gearknight Invasion","Dame Alistra","Superb Flaming Isparian Claw","Dynamic_1_y!",""
|
||||
"Gear Knight","Direland Gearknight Invasion","Sir Yanov","Major Shadow Greaves","Dynamic_1_BlAckAuHU#!",""
|
||||
"Gear Knight","Direland Gearknight Invasion","Sir Durnstad","Silifi of Crimson Stars","Dynamic_1_#Dfd!",""
|
||||
"Gear Knight","Direland Gearknight Invasion","Squire Tylaen","Good Coruscating Isparian Atlatl","Dynamic_1_i1Cxg8Bt!",""
|
||||
"Gear Knight","Direland Gearknight Invasion","Dame Trielle","Frost Yari","Dynamic_1_h^MdsKZ$6SSD!",""
|
||||
"Gear Knight","Direland Gearknight Invasion","T'ing Douzen","Panaq","Dynamic_1_p0BEy$e!",""
|
||||
"Gear Knight","Atamarr Tasks Dungeon","Bronze Gauntlet Knight-Commander","Frost Greataxe","Dynamic_1_REv&biyDw!",""
|
||||
"Gear Knight","Direland Gearknight Invasion","Copper Cog Craftsmaster","Greater Amuli Leggings of Frost","Dynamic_1_4uls5J!",""
|
||||
"Wai Jhou","","Kreavon","Skeleton Fish","Dynamic_1_KrPl9N5!",""
|
||||
"Wai Jhou","","Aun Teverea","Singularity Crossbow","Dynamic_1_Y9wg!RfKHoyL!",""
|
||||
"Wai Jhou","","Nona","Fish","Dynamic_1_JrzQr8U!",""
|
||||
"Wai Jhou","","Zho Heishan","Bandit Dagger","Dynamic_1_Abm8qK2!",""
|
||||
"Wai Jhou","","Sarkin Killcrane","Shadow Tassets","Dynamic_1_mb7NAtZEdBaz!",""
|
||||
"Wai Jhou","","Riordin Nightbane","Hafted Serpent Spear","Dynamic_1_cCzQdsl5JxLC!",""
|
||||
"Wai Jhou","","Lacarra Avanthi","Shou-jen Shozoku Trousers","Dynamic_1_ip&NsyQ!",""
|
||||
"Wai Jhou","","Xanda Har","Gold Fish","Dynamic_1_1CiKW8^x^$!",""
|
||||
"Rynthid","","Lohrn","Shreth Hide Shoes","Dynamic_1_cS!mivYZ^b!cAA!",""
|
||||
"Rynthid","","Rhys","Plate Leggings","Dynamic_1_A!!",""
|
||||
"Rynthid","","Morgethais","Silifi of Crimson Stars","Dynamic_1_wDTf#!",""
|
||||
"Rynthid","","Geilla","Audetaunga's Korua of the Mountains","Dynamic_1_&dNG5U4!",""
|
||||
"Rynthid","","Rinne Gorber","Brilliant Celdon Leggings","Dynamic_1_ln!Lx!",""
|
||||
"Rynthid","","Aun Ol'tra","Small Beer","Dynamic_1_&^3Hve4JXH^!",""
|
||||
"Rynthid","","Ranulf","Prismatic Celdon Sleeves","Dynamic_1_8n2l!",""
|
||||
"Rynthid","","Sylvanus","Ursuin Hide Coat","Dynamic_1_veaD!",""
|
||||
"Rynthid","","Marcus","Fish","Dynamic_1_bpNCu!rsf45Fk!",""
|
||||
"Rynthid","","Ilte Krongal","Hearty Mana Rabbit Noodle","Dynamic_1_AusVgDl!",""
|
||||
"Rynthid","","The Bringer of Light","Peppermint Hot Chocolate","Dynamic_1_LrpV!62!",""
|
||||
"Paradox Camp","Paradox Olthoi Camp","Ethan Wintermaine","Superb Flaming Isparian Bow","Dynamic_1_PPtO6!7dB!",""
|
||||
"Paradox Camp","","Adrien Swiftblade","Oak Stormwood Crossbow","Dynamic_1_R^1Uv!J8k!",""
|
||||
"Paradox Camp","","Alicia Swiftblade","Badlands Siraluun Dress","Dynamic_1_G0Rn1lOZKj7C!",""
|
||||
"Paradox Camp","","Tomihino","Dart Flinger","Dynamic_1_!$cc!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Peda's Assistant","examines your Parchment","Dynamic_1_3ddaHUzi!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Peda","examines your Parchment","Dynamic_1_1R9O85L$b!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Crusher","examines your Parchment","Dynamic_1_a&Z2!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Deena","examines your Parchment","Dynamic_1_cIZV2uDB6B!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Mac","examines your Parchment","Dynamic_1_5x^G2$X9!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Swift-Eye","examines your Parchment","Dynamic_1_o$yT7al7ZTxv!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Sasha","examines your Parchment","Dynamic_1_CvzZIz!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Dead-Eye","examines your Parchment","Dynamic_1_fP9y!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Lash","examines your Parchment","Dynamic_1_AniHdl4wtIuF0!",""
|
||||
"Paradox Camp","North Olthoi Burrow","Long-Shot","examines your Parchment","Dynamic_1_jJ^yEFc#m^M!",""
|
||||
"Graveyard","","Renata","Singularity Spear","Dynamic_1_1fDZO3!",""
|
||||
"Graveyard","","Yoite","Composite Bow with Handle","Dynamic_1_OG6jdId!",""
|
||||
"Graveyard","","Gadi","Scored Celdon Girth","Dynamic_1_ELgh#!",""
|
||||
"Graveyard","","Aethelswith","Leather Helm","Dynamic_1_cF!",""
|
||||
"Graveyard","","Mhoire Soldier","Superb Isparian Bow","Dynamic_1_VgB#WcZOIA!","North Soldier - Opposite side of bunker"
|
||||
"Graveyard","","Mhoire Soldier","Hafted Gromnie Banner with Crest","Dynamic_1_z$DX!","South Soldier - Opposite side of bunker"
|
||||
"Graveyard","","Apep-tek the Tolerant","Spectacular Lager","Dynamic_1_Y55^MqgC!","Above ground, outside bunker 65.3w 44.0w"
|
||||
"Graveyard","","Laylana","Stiletto","Dynamic_1_&SRgbH!","Above ground, outside bunker 65.2s 44.3w"
|
||||
"Graveyard","","Lo Shoen","Amateur Explorer Pants","Dynamic_1_102!pkgn8wAYSe!","Floating Platform - Level 50 req"
|
||||
"Graveyard","","Slubbley","Healing Cake","Dynamic_1_mDaEh7!",""
|
||||
"Graveyard","","Jailer","Good Shimmering Isparian Bow","Dynamic_1_2Hm6DL!","NE bunker aboveground 64.9s 44.1w"
|
||||
"Graveyard","","Kousu Temo","Fried Mushroom Rice Dough","Dynamic_1_QUXbn6!","EW Initiation guy, 64.2s 44.0w"
|
||||
"Graveyard","","Candrus Steady-Hand","Academy Mana Potion","Dynamic_1_BKq6N6nXoR!","CH Initiation guy, 65.8s 45.3w"
|
||||
"Graveyard","","Ancient Stones","Bandit Flaming Jambiya","Dynamic_1_xL!g4ZoCuv!H","Pile of stones at 66.5s 44.7w"
|
||||
"Graveyard","Mhoire Castle - Great Hall","Ancient Throne","Taiaha","Dynamic_1_&y4ettwcivZ5Nm!",""
|
||||
"Graveyard","Mhoire Castle - Great Hall","Shade of Antemy","Left Peg Leg","Dynamic_1_CphV&!",""
|
||||
"Graveyard","Mhoire Castle - Great Hall","Shade of Fordroth","Perfect Chilling Isparian Atlatl","Dynamic_1_M0u7js^$E!",""
|
||||
"Graveyard","Mhoire Castle - Great Hall","Shade of Terelev","Silifi of Crimson Stars","Dynamic_1_XPvw!",""
|
||||
"Graveyard","Mhoire Castle - Great Hall","Guliant","Celdon Girth of Acid","Dynamic_1_aCEEdQil42!",""
|
||||
"Neftet","","T'ing Setsuko","Flaming Broad Sword","Dynamic_1_JfmjJmY0O8r!",""
|
||||
"Neftet","","Nephthys","Red Tea","Dynamic_1_mnJCjm5QR$s&!",""
|
||||
"Neftet","","Fahneph","Gear Crossbow","Dynamic_1_owGS9WGJ1Q!",""
|
||||
"Neftet","","Nekshla","Mana Pumpkin Pie","Dynamic_1_AAQ1#!",""
|
||||
"Neftet","","Sir Hassim bin Tamarek","Enhanced Shadow Greaves","Dynamic_1_r7zID$U!",""
|
||||
"Neftet","","Sir Adarl","Bobo's Stout","Dynamic_1_SoBgM6JPckOY9!",""
|
||||
"Neftet","","Sir Ibreh bin Kassim","Expired Mana Tincture","Dynamic_1_aVMuY!",""
|
||||
"Neftet","","Sir Daeglan","Quality Coruscating Isparian Crossbow","Dynamic_1_n!",""
|
||||
"Neftet","","Bemeth the Gatherer","Lesser Koujia Breastplate of Acid","Dynamic_1_bda1WYoI!",""
|
||||
"Neftet","","Hammah al Rundik","Olthoi Greaves","Dynamic_1_9v^POv6ADt3r!",""
|
||||
"Neftet","22.2S 8.7E","Kaltus","Composite Bow with Handle","Dynamic_1_xWYS3fqIjPN!","22.2S 8.7E Not Dangerous run"
|
||||
"Frozen Valley","","Sir Donovan","Pickled Egg","Dynamic_1_ypu2L!",""
|
||||
"Frozen Valley","","Sir Learth","Royal Cabbage","Dynamic_1_xpAJDzm$!",""
|
||||
"Frozen Valley","","Lady Daenerah","Acid Spadone","Dynamic_1_$SDp1uWx8wq$!",""
|
||||
"Frozen Valley","","Gregoria, Gurog Destroyer","Chocolate Gromnie","Dynamic_1_!vr&1c1Ug1XI!",""
|
||||
"Frozen Valley","","Hunter","Hearty Healing Chicken Pie","Dynamic_1_Sy!9l0FAJFI!",""
|
||||
"Frozen Valley","","Leilah","Lightning Silifi","Dynamic_1_uyoL!",""
|
||||
"Frozen Valley","","Halvor","Noble Quarterstaff","Dynamic_1_LfLac!",""
|
||||
"Frozen Valley","","Kumiko","Expired Health Potion","Dynamic_1_TB!q!",""
|
||||
"Frozen Valley","","Archmage Ichihiri","Arbalest","Dynamic_1_HzvCs4B2!",""
|
||||
"Hoshino Tent","","Sergeant Trebuus","Soldier Pincer Metamorphi","Dynamic_1_GQIb1mF!",""
|
||||
"Hoshino Tent","","Sergeant Freng","Lightning War Axe","Dynamic_1_wVJm&#Lpz7AQ#F",""
|
||||
"Hoshino Tent","","Aun Kirtal","Arena Bow","Dynamic_1_V9ffGx!",""
|
||||
"Hoshino Tent","","Lieutenant Aurin","Enhanced Smoldering Atlan Sword","Dynamic_1_4qlVcAWbM!",""
|
||||
"Hoshino Tent","","Lord Eorlinde","Major Shadow Gauntlets","Dynamic_1_zkzTna!",""
|
||||
"Hoshino Tent","","Griffon","Mana Elixir","Dynamic_1_b4^F&M1^uG!",""
|
||||
"Hoshino Tent","","Hanamoto Aki'ko","Lightning Nekode","Dynamic_1_3Qlg!",""
|
||||
"Hoshino Tent","","Corporal Irashi","Lesser Koujia Shadow Leggings","Dynamic_1_2DBoreKEH!",""
|
||||
"Hoshino Tent","","Lieutenant Takamaki","Silifi of Crimson Stars","Dynamic_1_#hzL!",""
|
||||
"Hoshino Tent","","Lieutenant Roothe","Fried Rabbit","Dynamic_1_XuH!z7l!",""
|
||||
"Viridian Rise","","Brellegia","Greater Celdon Breastplate of Acid","Dynamic_1_mCyu9F!","Requires Viridian Rise Recall Gem"
|
||||
"Viridian Rise","","Summercrown","Tachi","Dynamic_1_R8H6nh!",""
|
||||
"Viridian Rise","","Aangesilus","Slashing Compound Bow","Dynamic_1_2LJyvGJL!",""
|
||||
"Viridian Rise","","Dridge","Greater Amuli Leggings of Flame","Dynamic_1_LP3Ee7tH!",""
|
||||
"Viridian Rise","","Kervim'telek","Ursuin Hide Coat","Dynamic_1_E5$S!",""
|
||||
"Viridian Rise","","Swift","Fried Chicken","Dynamic_1_hYVV!",""
|
||||
"Ayan","","Aludi al-Jaladh","Seasoned Explorer Gauntlets","Dynamic_1_7$I7bC!",""
|
||||
"Ayan","","Aun Javhalrea, the Game Warden","Frost Ono","Dynamic_1_UdRA9W!",""
|
||||
"Ayan","","Aun Khekierea","Rich Mocha","Dynamic_1_Yt1uiSkCgK!",""
|
||||
"Ayan","","Aun Aukherea","Chocolate Cookie","Dynamic_1_G$iqi763E!",""
|
||||
"Ayan","","Shuthoth","Silifi of Crimson Stars","Dynamic_1_CkuPj0IwP!",""
|
||||
"Ayan","","Yuan Hanzu","Acid Hatchet","Dynamic_1_t^CiJAt2TBz17!",""
|
||||
"Ayan","","Joku Shunja","Dho Life Apprentice Robe","Dynamic_1_&X4EDhy!",""
|
||||
"Ayan","","Aaminah","Upgraded Marksman's Robe","Dynamic_1_YlHC^cbS!",""
|
||||
"Ayan","","Anfram Mellow","Ulgrim's Bunny Slippers","Dynamic_1_$MJj0ytiSy0CKN!",""
|
||||
"Ayan","","Alishia bint Aldan","Lightning Hatchet","Dynamic_1_87z&&Ok2o&jo!",""
|
||||
"Ayan","","Vierana du Canamorra","Fine Shadow Atlan Mace","Dynamic_1_qtZdY0C!ae!",""
|
||||
"Ayan","","Qurakh al-Taal","Hearty Mana Beef Stew","Dynamic_1_Ug2snTqb44!",""
|
||||
"Ayan","","Laedron the Geomancer","Fine Stinging Atlan Spear","Dynamic_1_2lXQdqHWxPU!",""
|
||||
"Ayan","","Rohula bint Ludun","Arena Staff","Dynamic_1_SjjPqyCHNigY!",""
|
||||
"Ayan","","Guard Winterborn","Silifi of Crimson Stars","Dynamic_1_!fzudXFZV0Je3!",""
|
||||
"Ayan","","Ennio di Cinghalle","Perfect Chilling Isparian Claw","Dynamic_1_fYP!",""
|
||||
"Ayan","","Lydda","Pathwarden Scale Hauberk","Dynamic_1_neYBz15!",""
|
||||
"Ayan","","Gaston Shadowbound","Major Shadow Tassets","Dynamic_1_jdMT!",""
|
||||
"Ayan","","Harkwull the Discreet","Quality Flaming Isparian Crossbow","Dynamic_1_Bq7Brhg!",""
|
||||
"Ayan","","Tanami Kei","Souldrinker","Dynamic_1_en!",""
|
||||
"Ayan","","Lamorda Loschi","Major Shadow Sollerets","Dynamic_1_2xn4LwsUdh!",""
|
||||
"Ayan","","Soju Bo-Ki","Composite Crossbow with Handle","Dynamic_1_ADDKG!",""
|
||||
"Ayan","","Hoshar ibn Jalaq","High Balance Testing Coat","Dynamic_1_bZ4bc!",""
|
||||
"Ayan","","Guard Bey","Tasty Stout","Dynamic_1_&!4f5YlXZ!",""
|
||||
"Ayan","","Ishaq the Philosopher","Enhanced Skeletal Atlatl","Dynamic_1_H3UNETkRXTX!",""
|
||||
"Candeth Keep","","Morathe gives you","Superb Isparian Atlatl","Dynamic_1_g9M7bV3z3#S!",""
|
||||
"Candeth Keep","","Aun Autuorea gives you","Singularity Katar","Dynamic_1_5kEI0!",""
|
||||
"Candeth Keep","","Talira Dain","Composite Bow","Dynamic_1_5i1z1Mb!","No text about being given item, it just shows up in backpack"
|
||||
"Candeth Keep","","Dalius Kendmar gives you","Undead Guise","Dynamic_1_YFrw!",""
|
||||
"Candeth Keep","","Grania the Bold gives you","Composite Crossbow with Handle","Dynamic_1_DaevbVP!",""
|
||||
"Candeth Keep","","Yukara Miko the Collector","Acid Longbow","Dynamic_1_F1r^qTQ!",""
|
||||
"Candeth Keep","","Ryukai Hiro","Good Olthoi Pauldrons","Dynamic_1_HeucrAy6c!",""
|
||||
"Candeth Keep","","Garaena the Emissary","Seasoned Explorer Arbalest","Dynamic_1_es^0FY!","Aerlinthe Portal NPC"
|
||||
|
41
Plugins/RynthCore.Plugin.RynthOracle/Resources/legendary.csv
Normal file
41
Plugins/RynthCore.Plugin.RynthOracle/Resources/legendary.csv
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
Group,Quest,CommonName,Luminance,Flags,Url,Note,Video
|
||||
"Graveyard","Count Phainor's Amulet","",10000,"graverobbercompleted_0213","https://acportalstorm.com/wiki/Count_Phainor's_Amulet","Not too long, but long enough that its noot wworth 10k to do daily, but easy to do once in a while to get to 30 quests.","https://youtu.be/JRmFOlC-EFw"
|
||||
"Graveyard","Mhoire Castle","",15000,"cleansingthethronewaiting_1209","https://acportalstorm.com/wiki/Castle_of_Lord_Mhoire_Quest","DON'T RECOMMEND: Don't hand this in, do it and keep your Oubliette flag open. You need to only flag once in the 3 towers and then you can skip straight to the boss daily if you like (I wouldn't, but I'd do it to get to 30). Flagging is easy if you use a flame rare for the SE/SW towers UPDATE: this was bugged for me, it does lock you out of the castle and you need to re-do the flag each time to get in. This is more of a pain to use it now, but the only way to get to Oubliette","https://youtu.be/2ww40h-MUIE"
|
||||
"Graveyard","Oubliette of Mhoire Castle Quest","Oubliette",30000,"pickeduptokenoublietteboss_0112;startedoublietteboss_0112","https://acportalstorm.com/wiki/Oubliette_of_Mhoire_Castle_Quest","Time consuming but once you're flagged you can run it right after defeating the shade of Lord R in Mhoire castle, just need to collect so many of those stupid portal gems. UPDATE: Don't hand in Shade of Lord R for Mhoire castle and you can skip all that flagging and just run this each time, I recommend that, have to do Mhoire castle just the first time if done that way","https://youtu.be/HmskwQDBel0"
|
||||
"Rynthid","Defeating the Curator of Torment","RTW",90000,"rtwcompleted_1013","https://acportalstorm.com/wiki/Defeating_the_Curator_of_Torment","Done by the server daily at 8:30 PM EST. Also done like 30 more times throughout the day, just join in, or learn how to open and do it yourself :D","https://youtu.be/uqkV3clTne8"
|
||||
"Rynthid","Fear Factory Quest","",12000,"fearfactoryreleased_0813","https://acportalstorm.com/wiki/Fear_Factory_Quest","Small lum, so I wouldn't run it daily since its a bit out of the way, but its super easy. Run through rynthid talking to 5 shadows in a neat dungeon. One of the more unique dungeons.","https://youtu.be/rWa_8pngbWc"
|
||||
"Rynthid","Rynthid Foundry Quest","",10000,"changinggearscompleted_0813","https://acportalstorm.com/wiki/Rynthid_Foundry_Quest","Not worth 10k Lum, but soloable. Dont' alert the guards in the first 2 rooms, then destroy the door once you're through the first door you can run through and hand out your 3 oils in a linear path","https://youtu.be/bZEBCl9vztk"
|
||||
"Rynthid","Seed of Power","",15000,"visitors4completed_0713","https://acportalstorm.com/wiki/Seed_of_Power","Pain in the ass, 4 dungeons. Run through hitting switches, or doing jumps and finally following the lightning on the floor in a tedius walk through room. (There is a skip for this, search discord for Nan's youtube video showing the skip of the last room)",""
|
||||
"Rynthid","Rynthid Foothold","Rynthid Recall",27500,"genesiscompleted_0813","https://acportalstorm.com/wiki/Rynthid_Foothold","Rynth recall. If you want to solo it, bring a lightning rare and its simplified",""
|
||||
"Rynthid","Shroud of Emotion","",20000,"spiritedcompleted_0813","https://acportalstorm.com/wiki/Shroud_of_Emotion","Gives a great necklace, a bit too long to be a daily quest. Can easily be solo'd if you're able to navigate rynthid Virindi, if not you can easily get through with 1-2 friends.","https://youtu.be/n-75FEZXp-w"
|
||||
"Rynthid","Rynthid Training","",20000,"rynthidtrainingcompleted_1013","https://acportalstorm.com/wiki/Rynthid_Training","Incredibly easy, though a bit buggy and you may need to reset from time to time, hopefully it gets fixed. Either way, Easy as hell to run.","https://youtu.be/oMRiCPELW5g"
|
||||
"Rynthid","Lugian Assault","LA",20000,"lugianassaultcompleted_0913","https://acportalstorm.com/wiki/Lugian_Assault","Followed by Curator daily, also easy to solo.","https://youtu.be/BCqrQS2mloI"
|
||||
"Rynthid","End of Days","EoD",15000,"eodcompleted_1013","https://acportalstorm.com/wiki/End_of_Days","Followed by Lugian Assault daily, also easy to solo.","https://youtu.be/Pnw9QcFm_Ag"
|
||||
"Hoshino","Save Karul","",20000,"deconstructioncompleted_0213","https://acportalstorm.com/wiki/Save_Karul","Hosh quest, short dungeon, boss fight has a lot of tanky friends but with enough melee D they dont' really hit you. Bring a friend to make this fight go quicker.","https://youtu.be/U5GczhliqKg"
|
||||
"Hoshino","Ninja Academy","",15000,"ninjaacademyfinished_0812","https://acportalstorm.com/wiki/Ninja_Academy","More Hosh, this one I feel needed at least 1 other person, can be solo'd but the enemies hit so hard and the last room has a bit if you run too quickly through to it as it locks you in.","https://youtu.be/HfPZj2SUNss"
|
||||
"Hoshino","Tanada Intercept and Slaughter","",30000,"tanadaslaughterfinished_0912","https://acportalstorm.com/wiki/Tanada_Intercept","This is two quests but it only counts as 1, each give 15k lum each. One is collecting 6 items in the dungeon and the other is defeating the boss at the end of the dungeon, so do them together. Part of the Ninja academy quest chain and for some reason is easier than part 1","https://youtu.be/6MHFjofk55Y"
|
||||
"Hoshino","Nanjou Stockade","",15000,"nanjoustockadefinished_1012","https://acportalstorm.com/wiki/Nanjou_Stockade","Third part of the quest chain, still easier than part 1, lol. Just do them all together but I probably wouldn't do these daily but to get to 30.. yes","https://youtu.be/XjrU-tdHhXg"
|
||||
"Hoshino","Hoshino Must Die","HMD",100000,"defeathoshinokeicompleted_0113","https://acportalstorm.com/wiki/Defeat_Hoshino_Kei","Best done with a large group, don't see this run enough.",""
|
||||
"Hoshino","Hoshino Fortress Infiltration","HFI",48000,"hoshinotowercomplete_0812","https://acportalstorm.com/wiki/Hoshino_Fortress_Infiltration","Would love to see this done daily but it definitely needs a group. Okay people can solo this, but its better off with a group. Update: There is a nice wall jump skip you can see an ATW youtube video showing this, makes it easier to solo.",""
|
||||
"Frozen Valley","Halt Dericost Ritual Quest","Halt",40000,"ritualtimecompleted_0411","https://acportalstorm.com/wiki/Halt_Dericost_Ritual_Quest","UPDATE: Been seeing this run more often lately, flag for this quest and its an easy 40k lum and a good check on the john quests. Some people like to do this daily, I've only run it once at this point. Did it with 3 people, seemed like a solid number to do it with, the boss wave hits hard (4th wave)","https://youtu.be/AKRt1mST5zc"
|
||||
"Frozen Valley","Deewain's Dark Cavern","",30000,"deewaincompleted0211;deewainlegkeypickuptimer","https://acportalstorm.com/wiki/Deewain's_Dark_Cavern","Another good daily you should be doing if you're not learn the maze and the jumps and you can be through it quick for some nice lum.","https://youtu.be/PWfd9Hz7Yes"
|
||||
"Frozen Valley","Bloodstone Investigation","BS3",45000,"bloodstonefactorycompleted_0211","https://acportalstorm.com/wiki/Bloodstone_Investigation","Hoard bs3s in your inventory and do this one daily, best source of lum, a bit harder than the previous quests but easily soloable.","https://youtu.be/pdos-PebuiM"
|
||||
"Frozen Valley","Geraine's Study","",30000,"geraineslibrarycompleted0312","https://acportalstorm.com/wiki/Mhoire_Infiltration","I'd put this further down the list but its so convientent to do right after bs3, the exit of bs3 brings you right to study, getting the pages and the symbols are a pain and Geraine takes a while to go down. Bring a friend to make it tolerable","https://youtu.be/HzfzkEAP71M"
|
||||
"Frozen Valley","Gurog Creation","",10000,"gurogcreationcompleted_1110;journalnoteturninwait","https://acportalstorm.com/wiki/Gurog_Creation","Really easy, would be up higher if it was better than 10k lum, not worth the time to do daily but easy to throw in next time you're in FV and looking to get up to 30 quests.","https://youtu.be/46oPIQKfWdE"
|
||||
"Neftet","First Sister","Bulb of Mornings",21000,"firstsistercompleted_1012","https://acportalstorm.com/wiki/Harvesting_the_Bulb_of_Mornings","Do all 3 sister quests solo, as they each require you to pick up 10-15 items and hand to a bulb. First sisters, beware the reedsharks, they hit hard. Don't take them lightly.","https://youtu.be/VBYojr1vbns"
|
||||
"Neftet","Slave Master Quest","",30000,"neftetfreehatsheputwait;findmumiyahdevicewait","https://acportalstorm.com/wiki/Slave_Master_Quest","Soloable for sure, but I don't like this quest. Using the scrying rod is stupid, and it makes you do it twice. It also makes you clear out the entire dungeon worth of enemies to proceed, no skipping fights, bah",""
|
||||
"Neftet","Janthef's Release","Escape",20000,"escapecompleted_0213","https://acportalstorm.com/wiki/Janthef's_Release","Neftet recall, talk to NPC. Another daily, just be careful of the void statues.","https://youtu.be/Sx-10_oSt2o"
|
||||
"Neftet","Foundry of Izexi Quest","",15000,"foundryofizexicompleted_1212","https://acportalstorm.com/wiki/Foundry_of_Izexi_Quest","Newly added quest, worthy of being daily I might move this up the list with some more practice. 2 crystals to progress through the dungeon, just be careful of the spirits spamming war, don't get careless like me :D Update: I moved this below Janthef, do them together while at Neftet, might be worth doing daily just less lum than janthef","https://youtu.be/AF0XrmVtr9M"
|
||||
"Neftet","Four Corners of Dereth","",20000,"fourcornerscompleted_1113","https://acportalstorm.com/wiki/Four_Corners_of_Dereth","UPDATE: I moved this up the list. Tge first four dungeons is a flag for the final part in Neftet, do it once then you can do a fairly quick quest for 20k Lum. Not the fastest 20k lum quest but its 100% worth being one of your 30 now. Only reason its so low is it takes time, 4 dungeons on the corners of the map and then another dungeon with a boss room at the end. If you don't like jumping puzzles, you might skip this. Recommend doing this quest at least once though, its a fun one just long. First 4 dungeons are easy, last dungeon picks up the difficulty a little but all soloable","https://youtu.be/qtklyqjjHC8"
|
||||
"Random Locations","Third Sister","Bulb of Twilight",21000,"thirdsistercompleted_1212","https://acportalstorm.com/wiki/Harvesting_the_Bulb_of_Twilight","Needs to spawn more ore, be careful of the war spam in the ore collecting area. Not too bad, do it alone.","https://youtu.be/NTiCEE07MYI"
|
||||
"Random Locations","Second Sister","Bulb of Harvests",21000,"secondsistercompleted_1112","https://acportalstorm.com/wiki/Harvesting_the_Bulb_of_Harvests","Do this to unlock the 3rd sister, and do it as part of your 30 if you have high enough jump (600+) to do it each time. If not, use a jump rare the first time to unlock sister 3 and skip in the future.","https://youtu.be/MFLDhvg5WVQ"
|
||||
"Random Locations","Releasing the Light","",25000,"blessedcavecompleted_0912","https://acportalstorm.com/wiki/Releasing_the_Light","Out of the way quest, wouldn't run this daily. Extra 5k lum if you grab the book from an easy jump puzzle. Easy enough to be in the top 30. First quest in the 3 sister quest chain, follow up with 3 sisters.","https://youtu.be/qpRIxvvFy4M"
|
||||
"Random Locations","Dream Reaver Investigation","DRI",20000,"btmcompleted_0513","https://acportalstorm.com/wiki/Dream_Reaver_Investigation","A good daily, a lot of people wait until someone collects the keys then tags along. I did that too, but then I learned the keys and they're super simple, good daily quest.","https://youtu.be/phB-O5AQTQM"
|
||||
"Random Locations","Purging the Corruption","Purge",20000,"jtmcompleted_0613","https://acportalstorm.com/wiki/Purging_the_Corruption","Another good daily to do, a bit out of the way. Tie to tumerok caves on an alt and have a candeth portal (or get the recall) for quick turn in and it becomes a good daily","https://youtu.be/-eI7A5jBgG0"
|
||||
"Random Locations","Rescuing Mouf P","Mouf",17500,"moufreward","https://acportalstorm.com/wiki/Rescuing_Mouf_P","One of the first legendary quests you probably learned and most people can do with their eyes closed.","https://youtu.be/eqfBYpXbG7o"
|
||||
"Random Locations","Liberation of Uziz","",20000,"abductedcompleted_0313","https://acportalstorm.com/wiki/Liberation_of_Uziz","Another daily many people do, if you don't next time you see someone liberating uziz, tag along its quick and easy.","https://youtu.be/K8o_yoxqGyg"
|
||||
"Random Locations","Lost Lore","",18000,"lostlorepagecompleted_0712","https://acportalstorm.com/wiki/Lost_Lore","This is really easy, just a bit out of the way in my opinion. Honestly could be a decent daily.","https://youtu.be/bO1nOM00Unk"
|
||||
"Random Locations","Serpent Burial Grounds Quest","",18000,"serpentburialgroundsdone","https://acportalstorm.com/wiki/Serpent_Burial_Grounds_Quest","The dungeon is quick to get to, easy to navigate and the boss packs a mean punch. Bring someone who can debuff the boss and tugak his sclavus swarm, that'd be nice. The sclavus have high melee D and the boss hurts, debuff that sword. I recommend 2-3 people though it could be solo'd . UPDATE- I solo'd this, debuff his sword and its a pain in the ass but doable, took too long though solo.","https://youtu.be/h-NAwcVrrIQ"
|
||||
"Random Locations","Empyrean Rescue Quest","",35000,"empyreanrescuecompleted_1010;erqlegkeypickuptimer","https://acportalstorm.com/wiki/Empyrean_Rescue_Quest","The longest part of this was finding the portal in the first dungeon, once you find it and go through to the last dungeon, you can tie to the end and skip most of this quest, but you still have to deal with triangles of death and a boss that will instant kill you. Not TERRIBLe but I still don't care much for it",""
|
||||
"Random Locations","Geraine's Hosts","Hosts",70000,"gerainesbodiescompleted0412","https://acportalstorm.com/wiki/Geraine%27s_Hosts","I wanted to put this above slave master because fuck slave master, but collecting all 7 Geraine's books takes sooo long. I want to confirm you need all 7 and not just the first 1-4 hand in to get credit UPDATE: You only need to hand in books 1-4 for this to count, still time consuming",""
|
||||
"Random Locations","Hive Queen Assault","",40000,"idoqcompleted_0413","https://acportalstorm.com/wiki/Hive_Queen_Assault","Way too time consuming, not hard but dropping 5 forks is long enough as it is. One of last one's I'd do if ever.","https://youtu.be/bafe1w3NQUQ"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<!-- Plugin manifest (embedded in the DLL; Plugins\Directory.Build.targets). minEngineApi is the
|
||||
highest API use NOT behind a Has*/version check. Script windows (v71, HasUi) draw its window and titles/server info (v75) are guarded with fallbacks; below v71 it runs without a window (/ro status), as on an engine with ImGui off. -->
|
||||
<RynthPluginMinEngineApi>66</RynthPluginMinEngineApi>
|
||||
<RynthPluginDescription>Quests, character, titles and leaderboards.</RynthPluginDescription>
|
||||
<RynthPluginDescription>Quests (with the Legendary, marker, Dynamic Stamp and Temple guardian trackers), character and titles.</RynthPluginDescription>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -44,7 +44,10 @@
|
|||
<EmbeddedResource Include="Resources\society.csv" LogicalName="RynthOracle.society.csv" />
|
||||
<EmbeddedResource Include="Resources\titles.csv" LogicalName="RynthOracle.titles.csv" />
|
||||
<EmbeddedResource Include="Resources\markers.csv" LogicalName="RynthOracle.markers.csv" />
|
||||
<EmbeddedResource Include="Resources\customquests.csv" LogicalName="RynthOracle.customquests.csv" />
|
||||
<!-- Legendary Key quests, rows of the Quests tab (list and notes: the "Arwic John Route" sheet). -->
|
||||
<EmbeddedResource Include="Resources\legendary.csv" LogicalName="RynthOracle.legendary.csv" />
|
||||
<!-- Infinite Leaftide Dynamic Stamps (the players' ExtraDyn sheet, 10.13.2026): Data\DynamicStamps.cs. -->
|
||||
<EmbeddedResource Include="Resources\dynstamps.csv" LogicalName="RynthOracle.dynstamps.csv" />
|
||||
<!-- Spell names and durations: RynthAi's spell table, shared rather than copied. -->
|
||||
<EmbeddedResource Include="..\RynthCore.Plugin.RynthAi\Combat\SpellData.txt" LogicalName="RynthOracle.SpellData.txt" Link="Shared\SpellData.txt" />
|
||||
</ItemGroup>
|
||||
|
|
@ -52,6 +55,10 @@
|
|||
<ItemGroup>
|
||||
<!-- Fellowship reader (client memory, VirtualQuery-guarded), shared source with RynthAi. -->
|
||||
<Compile Include="..\RynthCore.Plugin.RynthAi\Combat\FellowshipTracker.cs" Link="Shared\FellowshipTracker.cs" />
|
||||
<!-- RynthILT's "RynthILT.Server" interface (Leaftide features, fellowship rules, the /qb list) and
|
||||
"RynthILT.Data" (charms, breeding, the Temple guardians): shared source, so the layouts can't drift. -->
|
||||
<Compile Include="..\Shared\RynthIltServerApi.cs" Link="Shared\RynthIltServerApi.cs" />
|
||||
<Compile Include="..\Shared\RynthIltDataApi.cs" Link="Shared\RynthIltDataApi.cs" />
|
||||
<!-- RynthAi's session stats ("RynthAi.Hub" SessionStats): the Character tab's session rates
|
||||
count the same session as the Mini Remote's Session Stats. -->
|
||||
<Compile Include="..\Shared\RynthAiHubApi.cs" Link="Shared\RynthAiHubApi.cs" />
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ namespace RynthCore.Plugin.RynthOracle;
|
|||
/// </summary>
|
||||
public sealed class RynthOraclePlugin : RynthPluginBase
|
||||
{
|
||||
// Previous release: 0.2.1.
|
||||
public const string Version = "0.2.2";
|
||||
// Previous release: 0.2.2.
|
||||
public const string Version = "0.3.0";
|
||||
|
||||
private const long QuestReadDelayMs = 6000; // after login, before the hidden /myquests
|
||||
private const long CharacterReadMs = 1000;
|
||||
|
|
@ -41,15 +41,18 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
private long _loginMs;
|
||||
private long _nextCharacterReadMs;
|
||||
private long _nextCharacterExtrasMs;
|
||||
private string _charmsJson = "";
|
||||
private long _nextBreedingMs;
|
||||
private string _breedingJson = "";
|
||||
private long _nextGuardianMs;
|
||||
private string _guardianJson = "";
|
||||
private bool _voidAutoDecided;
|
||||
private bool _dailyCheckStarted;
|
||||
private int _seenFlagRevision = -1, _seenCatalogRevision = -1, _seenVoidRevision = -1;
|
||||
private int _seenFlagRevision = -1, _seenCatalogRevision = -1, _seenVoidRevision = -1, _seenIltRevision = -1;
|
||||
// RynthCore's server list (ServerStateClient.Revision) last applied to the server identity.
|
||||
private int _seenServerStateRevision = -1;
|
||||
private bool _noUiLogged;
|
||||
private string? _catalogTag; // the server tag the catalog and server data were loaded for
|
||||
private bool _conquestLoginRead;
|
||||
private long _lastDepositBlock = -1;
|
||||
private int _titleCount = -2;
|
||||
private uint _titleCurrent;
|
||||
|
||||
|
|
@ -63,6 +66,11 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
_c.ReloadQuestList = ReloadQuestList;
|
||||
_c.Send = cmd => _c.InWorld && Host.InvokeChatParser(cmd);
|
||||
_c.RunCommand = cmd => _c.InWorld && Host.InvokeChatParser(cmd);
|
||||
_c.ToggleCharm = ToggleCharm;
|
||||
_c.BreedingCommand = BreedingCommand;
|
||||
_c.GuardianCommand = GuardianCommand;
|
||||
_c.UbGiveAvailable = UbGiveAvailable;
|
||||
_c.SendNav = line => Host.HasSendPluginCommand && Host.SendPluginCommand("RynthNav", "rnav", line);
|
||||
_ui.Log = msg => Host.Log(msg);
|
||||
|
||||
_mainView = new OracleView(_c);
|
||||
|
|
@ -118,13 +126,15 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
_c.Flags.Clear();
|
||||
_c.Void.Clear();
|
||||
_c.Server.Reset();
|
||||
_c.Ilt.Clear();
|
||||
_c.Ilt.Poll(Host, Environment.TickCount64);
|
||||
_c.ServerState.Clear();
|
||||
_c.ServerState.Poll(Host, Environment.TickCount64, force: true);
|
||||
_seenServerStateRevision = _c.ServerState.Revision;
|
||||
_c.Server.Refresh(Host, Host.GetPlayerId(), _c.ServerState.State);
|
||||
_c.VoidDotScale = VoidScaleFrom(_c.ServerState.ProfileJson);
|
||||
_c.Server.Refresh(Host, Host.GetPlayerId(), _c.Ilt.Profile.Ilt, _c.ServerState.State);
|
||||
_catalogTag = null;
|
||||
ApplyServer();
|
||||
_conquestLoginRead = false;
|
||||
_titleCount = -2;
|
||||
_c.TitlesKnown = false;
|
||||
_c.EarnedTitles.Clear();
|
||||
|
|
@ -159,26 +169,47 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
_c.Timers.Reset();
|
||||
_c.Flags.Clear();
|
||||
_c.Void.Clear();
|
||||
_c.Conquest.Clear();
|
||||
_c.Boards.Clear();
|
||||
_c.Server.Reset();
|
||||
_c.VoidDotScale = 1.0;
|
||||
_c.Ilt.Clear();
|
||||
_c.ServerState.Clear();
|
||||
_c.TitlesKnown = false;
|
||||
_c.EarnedTitles.Clear();
|
||||
ClearCharacterExtras();
|
||||
}
|
||||
|
||||
/// <summary>Forgets the Character tab's session (login, logout): the next character's comes fresh.</summary>
|
||||
/// <summary>Forgets the Character tab's charms and session and the ILT readers' data (login, logout): the next character's come fresh.</summary>
|
||||
private void ClearCharacterExtras()
|
||||
{
|
||||
_c.Charms = Shared.IltCharmsView.None;
|
||||
_charmsJson = "";
|
||||
_c.CharmMessage = "";
|
||||
_c.Breeding = Shared.IltBreedingView.None;
|
||||
_breedingJson = "";
|
||||
_c.BreedingMessage = "";
|
||||
_c.Guardian = Shared.IltGuardianView.None;
|
||||
_guardianJson = "";
|
||||
_c.GuardianRevision++;
|
||||
_c.GuardianMessage = "";
|
||||
_c.UbGiveMissing = false;
|
||||
_c.Session = default;
|
||||
_c.SessionKnown = false;
|
||||
_c.AiSession.Reset();
|
||||
}
|
||||
|
||||
/// <summary>The Character tab's Toggle: RynthILT checks the id is one of the player's charms and uses it.</summary>
|
||||
private bool ToggleCharm(uint id)
|
||||
{
|
||||
bool ok = _c.InWorld && _c.IltData.ToggleCharm(Host, Environment.TickCount64, id);
|
||||
_c.CharmMessage = ok ? "Toggled; the status updates in a moment." : "RynthILT didn't take that (not carried any more, or RynthILT isn't loaded).";
|
||||
_nextCharacterExtrasMs = Environment.TickCount64 + 1000; // re-read soon so the new state shows
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
return ok;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// While the Character tab is on screen: RynthAi's session, every <see cref="CharacterExtrasReadMs"/>.
|
||||
/// Nothing is read with the window closed or on another tab.
|
||||
/// While the Character tab is on screen: RynthILT's charms JSON and RynthAi's session, every
|
||||
/// <see cref="CharacterExtrasReadMs"/>. Nothing is read with the window closed or on another tab.
|
||||
/// </summary>
|
||||
private void ReadCharacterExtras(long now)
|
||||
{
|
||||
|
|
@ -186,6 +217,13 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
if (now < _nextCharacterExtrasMs) return;
|
||||
_nextCharacterExtrasMs = now + CharacterExtrasReadMs;
|
||||
|
||||
string json = _c.IltData.ReadCharms(Host, now);
|
||||
if (!string.Equals(json, _charmsJson, StringComparison.Ordinal))
|
||||
{
|
||||
_charmsJson = json;
|
||||
_c.Charms = Shared.IltCharmsView.Parse(json);
|
||||
_main.NeedsPass = true;
|
||||
}
|
||||
bool known = _c.AiSession.TryGet(Host, now, out Shared.SessionStatsV1 s);
|
||||
if (known != _c.SessionKnown || known && (s.Xp != _c.Session.Xp || s.Lum != _c.Session.Lum || s.Kills != _c.Session.Kills))
|
||||
_main.NeedsPass = true;
|
||||
|
|
@ -193,12 +231,86 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
_c.Session = known ? s : default;
|
||||
}
|
||||
|
||||
/// <summary>The Pet Breeding tab's buttons: a verb for RynthILT's tracker, then a quick re-read.</summary>
|
||||
private bool BreedingCommand(string verb)
|
||||
{
|
||||
long now = Environment.TickCount64;
|
||||
bool ok = _c.InWorld && _c.IltData.PetBreedingCommand(Host, now, verb);
|
||||
_c.BreedingMessage = ok ? "Sent to RynthILT; the tab updates in a moment." : "RynthILT didn't take that (not loaded, or older than 0.3.1).";
|
||||
_nextBreedingMs = now + 800;
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
return ok;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// While the Pet Breeding tab is on screen: RynthILT's breeding JSON every <see cref="CharacterExtrasReadMs"/>
|
||||
/// (reading it keeps RynthILT's tracker scanning). Nothing is read with the window closed or on another tab.
|
||||
/// </summary>
|
||||
private void ReadBreeding(long now)
|
||||
{
|
||||
if (_main == null || _mainView == null || !_main.Visible || _mainView.Tab != OracleView.TabBreeding) return;
|
||||
if (now < _nextBreedingMs) return;
|
||||
_nextBreedingMs = now + CharacterExtrasReadMs;
|
||||
string json = _c.IltData.ReadPetBreeding(Host, now);
|
||||
if (string.Equals(json, _breedingJson, StringComparison.Ordinal)) return;
|
||||
_breedingJson = json;
|
||||
_c.Breeding = Shared.IltBreedingView.Parse(json);
|
||||
_main.NeedsPass = true;
|
||||
}
|
||||
|
||||
/// <summary>The Quests tab's guardian controls: a verb for RynthILT's guardians, then a quick re-read.</summary>
|
||||
private bool GuardianCommand(string verb)
|
||||
{
|
||||
long now = Environment.TickCount64;
|
||||
bool ok = _c.InWorld && _c.IltData.GuardianCommand(Host, now, verb);
|
||||
_c.GuardianMessage = ok ? "" : "RynthILT didn't take that (not loaded, or older than 0.3.3).";
|
||||
_nextGuardianMs = now + 400;
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
return ok;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// While the Quests tab is on screen on Infinite Leaftide: RynthILT's Temple guardian JSON every
|
||||
/// <see cref="CharacterExtrasReadMs"/> (the guardian rows, switches and last answer). Nothing is
|
||||
/// read with the window closed, on another tab, or on another server.
|
||||
/// </summary>
|
||||
private void ReadGuardian(long now)
|
||||
{
|
||||
if (_main == null || _mainView == null || !_main.Visible || _mainView.Tab != OracleView.TabQuests) return;
|
||||
if (!_c.Server.Is(ServerTags.InfiniteLeaftide)) return;
|
||||
if (now < _nextGuardianMs) return;
|
||||
_nextGuardianMs = now + CharacterExtrasReadMs;
|
||||
string json = _c.IltData.ReadGuardian(Host, now);
|
||||
if (string.Equals(json, _guardianJson, StringComparison.Ordinal)) return;
|
||||
_guardianJson = json;
|
||||
_c.Guardian = Shared.IltGuardianView.Parse(json);
|
||||
_c.GuardianRevision++;
|
||||
_main.NeedsPass = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Give Parchment button's gate: the "/ub give" verb lives in RynthAi, so RynthAi must answer
|
||||
/// on its hub interface, and must not have rejected the verb already.
|
||||
/// </summary>
|
||||
private bool UbGiveAvailable()
|
||||
=> _c.InWorld && !_c.UbGiveMissing && Host.HasInvokeChatParser && _c.AiSession.IsLoaded(Host, Environment.TickCount64);
|
||||
|
||||
/// <summary>Opens the Quests tab on the trackers: one kind (/ro legendary, /ro dynamic ...) or all of them (null).</summary>
|
||||
private void ShowTrackers(QuestKind? kind)
|
||||
{
|
||||
_mainView?.ShowTrackers(kind);
|
||||
if (_main != null) { _main.Visible = true; _main.NeedsPass = true; }
|
||||
_nextGuardianMs = 0; // read at once
|
||||
}
|
||||
|
||||
/// <summary>Shows the main window on a tab (another plugin's link, or a /ro tab command).</summary>
|
||||
private void ShowTab(string tab)
|
||||
{
|
||||
if (_mainView != null) _mainView.Tab = tab;
|
||||
if (_main != null) { _main.Visible = true; _main.NeedsPass = true; }
|
||||
if (tab == OracleView.TabCharacter) _nextCharacterExtrasMs = 0; // read at once
|
||||
if (tab == OracleView.TabBreeding) _nextBreedingMs = 0;
|
||||
if (tab == OracleView.TabQuests) _nextGuardianMs = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -214,8 +326,6 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
try { _c.Catalog.Load(tag, msg => Host.Log(msg)); }
|
||||
catch (Exception ex) { Host.Log($"[RynthOracle] Couldn't load the quest list: {ex.Message}"); }
|
||||
_c.Catalog.SyncDiscoveries(_c.Flags);
|
||||
_c.Conquest.Clear();
|
||||
_c.Boards.Clear();
|
||||
string pack = _c.Catalog.PackServer.Length > 0 ? $" + {_c.Catalog.ServerCount} {_c.Catalog.PackServer}" : "";
|
||||
Host.Log($"[RynthOracle] Server: {(tag.Length > 0 ? tag : "no server-specific features")} ({_c.Server.Source}); {_c.Catalog.RetailCount} retail quests{pack}.");
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
|
|
@ -237,6 +347,9 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
long now = Environment.TickCount64;
|
||||
string line = text.TrimEnd('\r', '\n');
|
||||
|
||||
// RynthAi's reply to a "/ub give" it doesn't have: the Give Parchment button turns itself off.
|
||||
if (_c.NoteChatLineForGive(line, now) && _main != null) _main.NeedsPass = true;
|
||||
|
||||
MyQuestsLine kind = _c.Flags.OnChatLine(line, now);
|
||||
if (kind != MyQuestsLine.None)
|
||||
{
|
||||
|
|
@ -247,29 +360,24 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
}
|
||||
if (!_c.InWorld) return;
|
||||
|
||||
// Server-specific replies: each parser only runs on its own server.
|
||||
bool ours;
|
||||
if (_c.Server.Is(ServerTags.Conquest) && _c.Conquest.OnChatLine(line, now, out ours))
|
||||
{
|
||||
if (ours && _c.Settings.HideOwnQuestReplies) eat = 1;
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
return;
|
||||
}
|
||||
if (_c.Server.Is(ServerTags.Aelrynth) && _c.Boards.OnChatLine(line, now, out ours))
|
||||
{
|
||||
if (ours && _c.Settings.HideOwnQuestReplies) eat = 1;
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
return;
|
||||
}
|
||||
|
||||
double scale = _c.Server.Is(ServerTags.Conquest)
|
||||
? _c.Conquest.VoidDurationMultiplier(_c.Character.Int(Host, IntArchmagesEndurance))
|
||||
: 1.0;
|
||||
_c.Void.OnChatLine(line.Trim(), now, ResolveTarget, () => _c.Character.HasEnchantment(SpellIds.SurgeOfDestruction), scale);
|
||||
// A server's own command replies (Conquest's /b, Aelrynth's /top, ...) are its server plugin's.
|
||||
// A server's own Void DoT duration rule comes from its plugin's profile (RynthConquest's for
|
||||
// Conquest); 1 everywhere else (VoidScaleFrom).
|
||||
_c.Void.OnChatLine(line.Trim(), now, ResolveTarget, () => _c.Character.HasEnchantment(SpellIds.SurgeOfDestruction), _c.VoidDotScale);
|
||||
}
|
||||
|
||||
/// <summary>PropertyInt AugmentationIncreasedSpellDuration (Archmage's Endurance), sent at login.</summary>
|
||||
private const uint IntArchmagesEndurance = 238;
|
||||
/// <summary>The server profile value RynthOracle's Void timers apply ("RynthServer.Profile" values).</summary>
|
||||
internal const string VoidDotScaleKey = "voidDotDurationScale";
|
||||
|
||||
/// <summary>
|
||||
/// The active server's Void DoT duration multiplier, from its plugin's profile: a number from 1 to
|
||||
/// 10 (anything else, or none, is 1). Re-read whenever RynthCore's server state or the profile changes.
|
||||
/// </summary>
|
||||
internal static double VoidScaleFrom(string? profileJson)
|
||||
{
|
||||
double v = RynthCore.Plugin.Shared.ServerProfileView.Value(profileJson, VoidDotScaleKey, 1.0);
|
||||
return v >= 1.0 && v <= 10.0 ? v : 1.0;
|
||||
}
|
||||
|
||||
/// <summary>The selected target's id when its name matches (RynthCore has no spell-cast event for plugins).</summary>
|
||||
private uint ResolveTarget(string name)
|
||||
|
|
@ -320,11 +428,52 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
break;
|
||||
case "character":
|
||||
case "char":
|
||||
// The Character tab: the character overview and RynthAi's session (the generic part of
|
||||
// the Mini Remote's old Character tab; Infinite Leaftide's charms stay RynthILT's).
|
||||
case "charms":
|
||||
case "charm":
|
||||
// The Character tab: the character overview, RynthAi's session and, on Infinite Leaftide,
|
||||
// RynthILT's charms (the Mini Remote's Charms tab stays as well).
|
||||
// RynthAi, RynthILT and RynthCore's menus link here; it shows, never toggles off.
|
||||
ShowTab(OracleView.TabCharacter);
|
||||
break;
|
||||
case "legendary":
|
||||
case "legend":
|
||||
case "john":
|
||||
// John's 30 Legendary Key quests: the Quests tab's Legendary rows.
|
||||
ShowTrackers(QuestKind.Legendary);
|
||||
break;
|
||||
case "markers":
|
||||
case "marker":
|
||||
// The 100 exploration markers: the Quests tab's marker rows (the old Markers tab).
|
||||
ShowTrackers(QuestKind.Marker);
|
||||
break;
|
||||
case "trackers":
|
||||
// Every tracker this server has: Legendary, markers, and on Infinite Leaftide stamps and guardians.
|
||||
ShowTrackers(null);
|
||||
break;
|
||||
case "dynamic":
|
||||
case "dyn":
|
||||
case "dyno":
|
||||
case "stamps":
|
||||
case "guardian":
|
||||
case "guardians":
|
||||
// Infinite Leaftide's trackers: Dynamic Stamps and RynthILT's Temple guardians.
|
||||
bool guardians = arg is "guardian" or "guardians";
|
||||
if (!_c.Server.Is(ServerTags.InfiniteLeaftide))
|
||||
{
|
||||
_c.Print((guardians ? "The Temple guardians are" : "Dynamic stamps are")
|
||||
+ " an Infinite Leaftide quest line; this server isn't recognised as Infinite Leaftide.");
|
||||
ShowTrackers(null);
|
||||
}
|
||||
else ShowTrackers(guardians ? QuestKind.Guardian : QuestKind.Dynamic);
|
||||
break;
|
||||
case "breeding":
|
||||
case "breed":
|
||||
case "pets":
|
||||
// The Pet Breeding tab (Infinite Leaftide only; the Mini Remote's Pets > Breeding is the same tracker).
|
||||
if (!_c.Server.Is(ServerTags.InfiniteLeaftide))
|
||||
_c.Print("Pet breeding is an Infinite Leaftide feature; this server isn't recognised as Infinite Leaftide.");
|
||||
ShowTab(OracleView.TabBreeding);
|
||||
break;
|
||||
case "skills":
|
||||
case "skill":
|
||||
// The Skills tab: RynthCore's skills panel (raise and train) inside this window.
|
||||
|
|
@ -347,20 +496,25 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
+ $"{_c.Flags.Flags.Count} quest flags read, {_c.Catalog.RetailCount} retail quests{pack}, {_c.Void.Dots.Count} Void spells tracked{titles}.");
|
||||
break;
|
||||
case "about":
|
||||
// The About tab (settings, the server RynthCore says this is).
|
||||
case "features":
|
||||
// The About tab (settings, the server RynthCore says this is, RynthILT's server features).
|
||||
_c.Print("Based on Oracle of Dereth by Advis Eveldan - thank you! github.com/advis61/OracleOfDereth (MIT)");
|
||||
ShowTab(OracleView.TabAbout);
|
||||
break;
|
||||
default:
|
||||
_c.Print("Commands: /ro (window), /ro character (Character tab: status, session), "
|
||||
_c.Print("Commands: /ro (window), /ro character (Character tab: status, session, charms), "
|
||||
+ "/ro skills|attributes|progress (those tabs), /ro void (Void window), "
|
||||
+ "/ro timers (Quest Timers window), /ro fellowship (Fellowship tab), /ro quests (read quest flags), /ro status, "
|
||||
+ "/ro about (About tab: settings, server)");
|
||||
+ "/ro timers (Quest Timers window), /ro fellowship (Fellowship tab), /ro breeding (Pet Breeding tab, Infinite Leaftide), "
|
||||
+ "/ro trackers (Quests tab, trackers only), /ro legendary (John's 30 key quests), /ro markers, "
|
||||
+ "/ro dynamic and /ro guardians (Infinite Leaftide: NPC stamps, Temple guardians), "
|
||||
+ "/ro quests (read quest flags), /ro status, "
|
||||
+ "/ro about (About tab: settings, server features)");
|
||||
break;
|
||||
}
|
||||
if (arg is "" or "void" or "timers" or "timer" or "fellowship" or "fellow" or "fship" or "character" or "char"
|
||||
if (arg is "" or "void" or "timers" or "timer" or "fellowship" or "fellow" or "fship" or "character" or "char" or "charms" or "charm"
|
||||
or "skills" or "skill" or "attributes" or "attrs" or "attribute" or "vitals" or "progress" or "progression"
|
||||
or "about" && !Host.HasUi && !_noUiLogged)
|
||||
or "breeding" or "breed" or "pets" or "legendary" or "legend" or "john" or "markers" or "marker" or "trackers"
|
||||
or "dynamic" or "dyn" or "dyno" or "stamps" or "guardian" or "guardians" or "about" or "features" && !Host.HasUi && !_noUiLogged)
|
||||
{
|
||||
_noUiLogged = true;
|
||||
_c.Print("This RynthCore engine can't show plugin windows (it needs script windows, API v71, with ImGui on). /ro status still works.");
|
||||
|
|
@ -371,8 +525,15 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
private bool RequestQuests()
|
||||
{
|
||||
if (!_c.InWorld) return false;
|
||||
bool sent = _c.Flags.Request(cmd => Host.InvokeChatParser(cmd), Environment.TickCount64);
|
||||
if (!sent) Host.Log("[RynthOracle] /myquests was sent moments ago; waiting for that reply.");
|
||||
long now = Environment.TickCount64;
|
||||
bool sent = _c.Flags.Request(cmd => Host.InvokeChatParser(cmd), now);
|
||||
if (!sent)
|
||||
{
|
||||
int wait = _c.Flags.ThrottleSecondsLeft(now);
|
||||
Host.Log(wait > 0
|
||||
? $"[RynthOracle] The server answers one /myquests a minute; try again in {wait}s (the flags shown are kept)."
|
||||
: "[RynthOracle] /myquests was sent moments ago; waiting for that reply.");
|
||||
}
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
return sent;
|
||||
}
|
||||
|
|
@ -410,7 +571,9 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
long now = Environment.TickCount64;
|
||||
_c.ServerState.Poll(Host, now, force: true);
|
||||
_seenServerStateRevision = _c.ServerState.Revision;
|
||||
_c.Server.Refresh(Host, _c.Character.PlayerId != 0 ? _c.Character.PlayerId : Host.GetPlayerId(), _c.ServerState.State);
|
||||
_c.VoidDotScale = VoidScaleFrom(_c.ServerState.ProfileJson);
|
||||
_c.Ilt.Poll(Host, now);
|
||||
_c.Server.Refresh(Host, _c.Character.PlayerId != 0 ? _c.Character.PlayerId : Host.GetPlayerId(), _c.Ilt.Profile.Ilt, _c.ServerState.State);
|
||||
try { _c.Catalog.Load(_c.Server.Tag, msg => Host.Log(msg)); }
|
||||
catch (Exception ex) { Host.Log($"[RynthOracle] Couldn't load the quest list: {ex.Message}"); }
|
||||
_c.Catalog.SyncDiscoveries(_c.Flags);
|
||||
|
|
@ -456,6 +619,11 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
private void TickData(long now)
|
||||
{
|
||||
_c.Flags.Tick(now);
|
||||
if (_c.Flags.LastPartialReply is { } partial)
|
||||
{
|
||||
_c.Flags.LastPartialReply = null;
|
||||
Host.Log($"[RynthOracle] /myquests reply looked cut short ({partial.Got} lines, {partial.Had} flags held): merged it instead of replacing the list.");
|
||||
}
|
||||
if (_c.Flags.Revision != _seenFlagRevision)
|
||||
{
|
||||
_seenFlagRevision = _c.Flags.Revision;
|
||||
|
|
@ -491,14 +659,25 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
|
||||
if (!_c.InWorld) return;
|
||||
|
||||
// RynthILT's profile (every 2 s): which features the server has, the /qb list.
|
||||
_c.Ilt.Poll(Host, now);
|
||||
if (_c.Ilt.Revision != _seenIltRevision)
|
||||
{
|
||||
_seenIltRevision = _c.Ilt.Revision;
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
}
|
||||
|
||||
ReadCharacterExtras(now);
|
||||
ReadBreeding(now);
|
||||
ReadGuardian(now);
|
||||
|
||||
// RynthCore's server list (every 2 s): a new pick or override applies now, not at the next character read.
|
||||
_c.ServerState.Poll(Host, now);
|
||||
if (_c.ServerState.Revision != _seenServerStateRevision)
|
||||
{
|
||||
_seenServerStateRevision = _c.ServerState.Revision;
|
||||
_c.Server.Refresh(Host, _c.Character.PlayerId != 0 ? _c.Character.PlayerId : Host.GetPlayerId(), _c.ServerState.State);
|
||||
_c.VoidDotScale = VoidScaleFrom(_c.ServerState.ProfileJson);
|
||||
_c.Server.Refresh(Host, _c.Character.PlayerId != 0 ? _c.Character.PlayerId : Host.GetPlayerId(), _c.Ilt.Profile.Ilt, _c.ServerState.State);
|
||||
ApplyServer();
|
||||
if (_main != null) _main.NeedsPass = true;
|
||||
}
|
||||
|
|
@ -524,12 +703,11 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
_nextCharacterReadMs = now + CharacterReadMs;
|
||||
_c.Character.Read(Host);
|
||||
_c.Void.RemoveExpired(now);
|
||||
_c.Server.Refresh(Host, _c.Character.PlayerId, _c.ServerState.State);
|
||||
_c.Server.Refresh(Host, _c.Character.PlayerId, _c.Ilt.Profile.Ilt, _c.ServerState.State);
|
||||
ApplyServer();
|
||||
LoadQuestBook(now);
|
||||
AnnounceTimers();
|
||||
ReadTitles();
|
||||
TickConquest(now);
|
||||
if (!_voidAutoDecided && _c.Character.Valid)
|
||||
{
|
||||
_voidAutoDecided = true;
|
||||
|
|
@ -589,28 +767,6 @@ public sealed class RynthOraclePlugin : RynthPluginBase
|
|||
if (_main != null) _main.NeedsPass = true;
|
||||
}
|
||||
|
||||
/// <summary>ConquestAC only: read the advanced augs once after login (void DoT timing uses them), and the auto-deposit.</summary>
|
||||
private void TickConquest(long now)
|
||||
{
|
||||
if (!_c.Server.Is(ServerTags.Conquest)) return;
|
||||
if (!_conquestLoginRead && now - _loginMs > QuestReadDelayMs + 4000)
|
||||
{
|
||||
_conquestLoginRead = true;
|
||||
Host.InvokeChatParser(_c.Conquest.RequestAugs(now));
|
||||
}
|
||||
if (_c.Settings.ConquestAutoDeposit)
|
||||
{
|
||||
DateTime local = DateTime.Now;
|
||||
long block = local.Ticks / TimeSpan.TicksPerMinute / 10;
|
||||
if (local.Minute % 10 == 0 && block != _lastDepositBlock)
|
||||
{
|
||||
_lastDepositBlock = block;
|
||||
Host.InvokeChatParser(_c.Conquest.AutoDeposit(now));
|
||||
_c.Print("Auto-deposited to the bank.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RecordWindows(long now)
|
||||
{
|
||||
if (_main != null && _mainView != null)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ What came from upstream:
|
|||
|
||||
- The quest, augmentation, aug-gem quest, society quest, title and exploration marker lists
|
||||
in `Resources\` (`quests.csv`, `augmentations.csv`, `augquests.csv`, `society.csv`,
|
||||
`titles.csv`, `markers.csv`, `customquests.csv`), copied unchanged, except that the
|
||||
`titles.csv`, `markers.csv`), copied unchanged, except that the
|
||||
master quest list is split by its own Server column into `quests.csv` (every retail
|
||||
quest), `quests.conquest.csv` and `quests.levistras.csv` (each server's own rows, loaded
|
||||
only on that server); the lines themselves are untouched. `quests.csv` is Oracle of Dereth's curator-maintained master quest list;
|
||||
|
|
@ -27,9 +27,11 @@ What came from upstream:
|
|||
file carries no licence of its own, so it is treated as part of the MIT-licensed repository.
|
||||
- The logic of the ported features (quest flag parsing and status rules, luminance costs,
|
||||
society ranks and ribbon limits, the status summary, exploration markers, Void
|
||||
damage-over-time timers, and the ConquestAC features: bank, advanced and enlightenment
|
||||
augmentations, XP bonuses and levels past 275, the fellowship list, the /top boards),
|
||||
rewritten for RynthCore. Ported files say so in their header.
|
||||
damage-over-time timers), rewritten for RynthCore. Ported files say so in their header.
|
||||
- Upstream's ConquestAC features (bank and auto-deposit, advanced and enlightenment
|
||||
augmentations, XP bonuses and levels past 275, the fellowship list, the /top boards,
|
||||
`customquests.csv`) were part of RynthOracle until 2026-10-20 and are now in RynthConquest,
|
||||
the Conquest server plugin (its own THIRD_PARTY_NOTICES.md).
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ internal sealed partial class OracleView
|
|||
w.Checkbox("Read quest flags when you log in", "o.readlogin", s.ReadQuestsAtLogin, v => { s.ReadQuestsAtLogin = v; s.Save(); });
|
||||
w.Tooltip("Sends /myquests once after login so the quest pages have data.");
|
||||
w.Checkbox("Hide the replies to RynthOracle's own requests", "o.hide", s.HideOwnQuestReplies, v => { s.HideOwnQuestReplies = v; s.Save(); });
|
||||
w.Tooltip("/myquests, and on their servers /b, /augs, /top and the like. A command you type yourself always shows its reply.");
|
||||
w.Tooltip("/myquests. A command you type yourself always shows its reply.");
|
||||
w.Checkbox("Show the Void window for characters with Void Magic", "o.void", s.AutoShowVoidWindow, v => { s.AutoShowVoidWindow = v; s.Save(); });
|
||||
w.Checkbox("Say in chat when a quest timer comes up", "o.alert", s.AlertTimers, v => { s.AlertTimers = v; s.Save(); });
|
||||
w.Tooltip("Watches the quests you track (the * on the Quests tab) and prints a line the moment a cooldown ends.");
|
||||
|
|
@ -29,7 +29,9 @@ internal sealed partial class OracleView
|
|||
|
||||
w.SeparatorText("Server");
|
||||
ServerIdentity sv = _c.Server;
|
||||
w.Text(sv.Tag.Length > 0 ? $"{sv.Tag}: its own pages and quest pack are on." : "No server-specific pages here (retail features only).");
|
||||
w.Text(sv.Tag.Length == 0 ? "No server-specific pages here (retail features only)."
|
||||
: sv.Is(ServerTags.InfiniteLeaftide) ? $"{sv.Tag}: its own pages are on (stamps and guardians on the Quests tab, Pet Breeding)."
|
||||
: $"{sv.Tag}: its own pages and quest pack are on.");
|
||||
w.TextDisabled($"How it was decided: {sv.Source}");
|
||||
// RynthCore's server list (API v86) and the active server's settings from the plugin that owns it.
|
||||
RynthCore.Plugin.Shared.ServerStateClient st = _c.ServerState;
|
||||
|
|
@ -48,6 +50,8 @@ internal sealed partial class OracleView
|
|||
w.TextDisabled($"This engine is API v{_c.Host.Version}; v86 lets RynthOracle follow RynthCore's server pick and overrides.");
|
||||
if (_c.Host.Version < 75) w.TextDisabled($"This engine is API v{_c.Host.Version}; v75 adds a surer server check and the titles you hold.");
|
||||
|
||||
DrawServerFeatures(w);
|
||||
|
||||
w.SeparatorText("Quest list");
|
||||
QuestCatalog cat = _c.Catalog;
|
||||
w.Text($"{cat.RetailCount} retail quests from the {cat.Source}" +
|
||||
|
|
@ -66,17 +70,79 @@ internal sealed partial class OracleView
|
|||
|
||||
w.SeparatorText("Commands");
|
||||
w.BulletText("/ro open or close this window");
|
||||
w.BulletText("/ro character the Character tab (status, session)");
|
||||
w.BulletText("/ro character the Character tab (status, session, charms)");
|
||||
w.BulletText("/ro skills the Skills tab (raise and train); /ro attributes, /ro progress likewise");
|
||||
w.BulletText("/ro timers open or close the Quest Timers window");
|
||||
w.BulletText("/ro fellowship the Fellowship tab");
|
||||
w.BulletText("/ro about this tab (settings, server)");
|
||||
w.BulletText("/ro trackers the Quests tab, trackers only (Legendary, markers, and on ILT stamps and guardians)");
|
||||
w.BulletText("/ro legendary John's Legendary Key quests: have, missing, repeat timers");
|
||||
w.BulletText("/ro markers the 100 exploration markers: found and still to find");
|
||||
if (_c.Server.Is(Data.ServerTags.InfiniteLeaftide))
|
||||
{
|
||||
w.BulletText("/ro dynamic Infinite Leaftide Dynamic Stamps: NPC stamps you have and are missing");
|
||||
w.BulletText("/ro guardians the Temple guardians: riddle answers, auto hand-in, buy if missing, turn-ins");
|
||||
w.BulletText("/ro breeding the Pet Breeding tab (when the server has pet breeding)");
|
||||
}
|
||||
w.BulletText("/ro about this tab (settings, server, server features)");
|
||||
w.BulletText("/ro void open or close the Void window");
|
||||
w.BulletText("/ro quests read your quest flags now");
|
||||
w.BulletText("/ro help list the commands in chat");
|
||||
w.TextDisabled("A server quest pack can be replaced without a rebuild: put quests.<server>.csv in %APPDATA%\\RynthCore\\RynthOracle\\packs.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// "Server features": the Leaftide feature list RynthILT keeps (sent in its "RynthILT.Server"
|
||||
/// profile), drawn group by group in RynthILT's order with each feature's state and where it
|
||||
/// lives. Nothing here is hard-coded: a newer RynthILT adds features without an Oracle update.
|
||||
/// </summary>
|
||||
private void DrawServerFeatures(UiWindow w)
|
||||
{
|
||||
IltServerProfile p = _c.Ilt.Profile;
|
||||
if (!p.Available)
|
||||
{
|
||||
if (_c.Server.Is(ServerTags.InfiniteLeaftide))
|
||||
{
|
||||
w.SeparatorText("Server features");
|
||||
w.TextDisabled("Load RynthILT to list the Infinite Leaftide features here.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (p.Features.Count == 0) return;
|
||||
|
||||
w.SeparatorText("Server features");
|
||||
string checkedText = p.CheckedUtc == DateTime.MinValue ? "not checked yet" : $"checked {p.CheckedUtc.ToLocalTime():yyyy-MM-dd HH:mm}";
|
||||
w.TextDisabled(p.Ilt
|
||||
? $"From RynthILT ({(p.World.Length > 0 ? p.World : "this world")}, {checkedText}{(p.Forced ? ", forced on" : "")})."
|
||||
: "From RynthILT: this isn't an Infinite Leaftide world, so no Leaftide feature is claimed.");
|
||||
|
||||
// Groups in the order RynthILT lists them; one table per group.
|
||||
var groups = new System.Collections.Generic.List<string>();
|
||||
foreach (IltFeature f in p.Features)
|
||||
if (!groups.Exists(g => string.Equals(g, f.Group, StringComparison.OrdinalIgnoreCase))) groups.Add(f.Group);
|
||||
|
||||
int on = 0;
|
||||
foreach (IltFeature f in p.Features) if (f.State == RynthCore.Plugin.Shared.RynthIltServer.StateOn) on++;
|
||||
w.TextDisabled($"{on} of {p.Features.Count} on.");
|
||||
|
||||
foreach (string group in groups)
|
||||
{
|
||||
if (!w.CollapsingHeader(group.Length > 0 ? group : "Other", "o.feat.h." + group)) continue;
|
||||
foreach (IltFeature f in p.InGroup(group))
|
||||
{
|
||||
uint color = f.State switch
|
||||
{
|
||||
RynthCore.Plugin.Shared.RynthIltServer.StateOn => UiColors.Green,
|
||||
RynthCore.Plugin.Shared.RynthIltServer.StateOff => UiColors.Red,
|
||||
_ => UiColors.Yellow,
|
||||
};
|
||||
w.TextColored(color, $"[{IltServerProfile.StateText(f.State)}]");
|
||||
w.SameLine();
|
||||
w.Text(f.Label);
|
||||
if (f.Where.Length > 0) w.Tooltip("Where: " + f.Where);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void StartQuestListCheck()
|
||||
{
|
||||
_c.Settings.LastQuestListCheckUtc = DateTime.UtcNow;
|
||||
|
|
|
|||
|
|
@ -1,152 +0,0 @@
|
|||
// Ported from Oracle of Dereth by Advis Eveldan (advis61), MIT (the ConquestAC part). See THIRD_PARTY_NOTICES.md.
|
||||
using System;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
/// <summary>
|
||||
/// Leaderboards, server-specific: ConquestAC's /top boards (upstream's Top Players tab), or
|
||||
/// Aelrynth's /top boards and /trial dungeon records. Each server's view only exists on that
|
||||
/// server (tab tags in OracleView), since both servers answer /top in different shapes.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
private int _conquestBoard;
|
||||
private int _aelrynthView; // 0 boards, 1 me, 2 trials
|
||||
private string _aelrynthBoardArg = "";
|
||||
private string _trialArg = "";
|
||||
|
||||
private void DrawBoards(UiWindow w)
|
||||
{
|
||||
if (_c.Server.Is(ServerTags.Conquest)) DrawConquestBoards(w);
|
||||
else if (_c.Server.Is(ServerTags.Aelrynth)) DrawAelrynthBoards(w);
|
||||
}
|
||||
|
||||
private void DrawConquestBoards(UiWindow w)
|
||||
{
|
||||
ConquestData cq = _c.Conquest;
|
||||
_conquestBoard = Math.Clamp(_conquestBoard, 0, cq.Boards.Count - 1);
|
||||
for (int i = 0; i < cq.Boards.Count; i++)
|
||||
{
|
||||
int index = i;
|
||||
if (i > 0) w.SameLine();
|
||||
w.ToggleButton(cq.Boards[i].Label, "cb.tab." + i, i == _conquestBoard, () => _conquestBoard = index, small: true);
|
||||
}
|
||||
ConquestBoard b = cq.Boards[_conquestBoard];
|
||||
w.TextDisabled(b.UpdatedUtc == DateTime.MinValue ? "not read yet" : $"read at {b.UpdatedUtc.ToLocalTime():HH:mm}");
|
||||
if (b.You != null) w.Text($"You: #{b.You.Rank} with {b.You.Value}");
|
||||
DrawRows(w, "cb.rows", b.Rows);
|
||||
}
|
||||
|
||||
private static void DrawRows(UiWindow w, string id, System.Collections.Generic.List<BoardRow> rows)
|
||||
{
|
||||
w.BeginChild(id, 0f, 0f, border: true);
|
||||
w.TextDisabled("Rank");
|
||||
w.SameLine(60f);
|
||||
w.TextDisabled("Name");
|
||||
w.SameLine(280f);
|
||||
w.TextDisabled("Value");
|
||||
foreach (BoardRow r in rows)
|
||||
{
|
||||
w.Text(r.Rank.ToString());
|
||||
w.SameLine(60f);
|
||||
if (r.IsYou) w.TextColored(UiColors.Gold, Cut(r.Name, 30));
|
||||
else w.Text(Cut(r.Name, 30));
|
||||
w.SameLine(280f);
|
||||
w.Text(r.Value);
|
||||
if (r.Extra.Length > 0) { w.SameLine(420f); w.TextDisabled(Cut(r.Extra, 40)); }
|
||||
}
|
||||
if (rows.Count == 0) w.TextDisabled("Nothing read yet. Press Refresh.");
|
||||
w.EndChild();
|
||||
}
|
||||
|
||||
private void DrawAelrynthBoards(UiWindow w)
|
||||
{
|
||||
AelrynthBoards a = _c.Boards;
|
||||
w.ToggleButton("Boards", "ab.v0", _aelrynthView == 0, () => _aelrynthView = 0, small: true);
|
||||
w.SameLine();
|
||||
w.ToggleButton("Me", "ab.v1", _aelrynthView == 1, () => _aelrynthView = 1, small: true);
|
||||
w.SameLine();
|
||||
w.ToggleButton("Trials", "ab.v2", _aelrynthView == 2, () => _aelrynthView = 2, small: true);
|
||||
if (a.LastError.Length > 0) w.TextColored(UiColors.Red, a.LastError);
|
||||
|
||||
if (_aelrynthView == 1)
|
||||
{
|
||||
w.BeginChild("ab.melist", 0f, 0f, border: true);
|
||||
foreach (AelrynthStanding s in a.Standings)
|
||||
{
|
||||
w.Text(Cut(s.Title, 34));
|
||||
w.SameLine(260f);
|
||||
w.Text(s.Rank > 0 ? $"#{s.Rank} of {s.Of}" : "-");
|
||||
if (s.Value.Length > 0) { w.SameLine(380f); w.Text(s.Value); }
|
||||
}
|
||||
if (a.Standings.Count == 0) w.TextDisabled("Nothing read yet. Press Refresh.");
|
||||
w.EndChild();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_aelrynthView == 2)
|
||||
{
|
||||
w.InputText("Dungeon", "ab.trialarg", _trialArg, 48, s => _trialArg = s);
|
||||
w.SameLine();
|
||||
w.Button("Top 10", "ab.trialtop", () => { if (_trialArg.Trim().Length > 0) _c.Send(a.RequestTrial(_trialArg, _c.NowMs)); });
|
||||
w.BeginChild("ab.triallist", 0f, 0f, border: true);
|
||||
foreach (TrialDungeon d in a.Trials)
|
||||
{
|
||||
TrialDungeon row = d;
|
||||
w.Selectable($"{d.Name} ({d.Landblock})", "ab.t." + d.Landblock, false,
|
||||
() => { _trialArg = row.Name; _c.Send(a.RequestTrial(row.Name, _c.NowMs)); });
|
||||
w.Tooltip("Click for this dungeon's top 10.");
|
||||
w.TextDisabled(" record:"); w.SameLine(90f); w.TextWrapped(d.Record);
|
||||
w.TextDisabled(" you:"); w.SameLine(90f); w.Text(d.You);
|
||||
w.TextDisabled(" this week:"); w.SameLine(90f); w.Text(d.Week);
|
||||
}
|
||||
foreach (string line in a.TrialLines) if (!line.StartsWith("Trials - ", StringComparison.Ordinal)) w.TextWrapped(line);
|
||||
if (a.TrialBoardTitle.Length > 0)
|
||||
{
|
||||
w.SeparatorText(a.TrialBoardTitle);
|
||||
foreach (BoardRow r in a.TrialRows)
|
||||
{
|
||||
w.Text($"{r.Rank,2}. {r.Value}");
|
||||
w.SameLine(90f);
|
||||
w.Text(Cut(r.Name, 28));
|
||||
w.SameLine(300f);
|
||||
w.TextDisabled(Cut(r.Extra, 40));
|
||||
}
|
||||
foreach (string n in a.TrialNotes) w.TextWrapped(n);
|
||||
}
|
||||
if (a.Trials.Count == 0 && a.TrialBoardTitle.Length == 0) w.TextDisabled("Nothing read yet. Press Refresh.");
|
||||
w.EndChild();
|
||||
return;
|
||||
}
|
||||
|
||||
w.Button("All boards", "ab.all", () => _c.Send(a.RequestTop("", _c.NowMs)));
|
||||
w.Tooltip("Sends /top: every board's leader.");
|
||||
w.SameLine();
|
||||
w.InputText("Board", "ab.arg", _aelrynthBoardArg, 32, s => _aelrynthBoardArg = s);
|
||||
w.SameLine();
|
||||
w.Button("Top 10", "ab.board", () => { if (_aelrynthBoardArg.Trim().Length > 0) _c.Send(a.RequestTop(_aelrynthBoardArg, _c.NowMs)); });
|
||||
if (a.OverviewNote.Length > 0) w.TextDisabled(a.OverviewNote);
|
||||
|
||||
if (a.BoardTitle.Length > 0)
|
||||
{
|
||||
w.SeparatorText($"{a.BoardTitle} ({a.BoardNote})");
|
||||
if (a.BoardYou.Length > 0) w.TextColored(UiColors.Gold, a.BoardYou);
|
||||
DrawRows(w, "ab.rows", a.BoardRows);
|
||||
return;
|
||||
}
|
||||
w.BeginChild("ab.overview", 0f, 0f, border: true);
|
||||
foreach (AelrynthBoardSummary s in a.Overview)
|
||||
{
|
||||
AelrynthBoardSummary row = s;
|
||||
w.Selectable(Cut(s.Title, 30), "ab.o." + s.Key, false, () => { _aelrynthBoardArg = row.Key; _c.Send(a.RequestTop(row.Key, _c.NowMs)); }, 230f);
|
||||
w.Tooltip($"/top {s.Key}");
|
||||
w.SameLine(240f);
|
||||
w.Text(Cut(s.Leader, 24));
|
||||
if (s.Value.Length > 0) { w.SameLine(430f); w.Text(s.Value); }
|
||||
}
|
||||
if (a.Overview.Count == 0) w.TextDisabled("Nothing read yet. Press All boards.");
|
||||
w.EndChild();
|
||||
}
|
||||
}
|
||||
|
|
@ -9,8 +9,8 @@ namespace RynthCore.Plugin.RynthOracle.Views;
|
|||
/// <summary>
|
||||
/// Character: level and experience, luminance, the status summary (upstream's Status HUD: buff,
|
||||
/// house, beer, page and rare timers, key skills, aetheria surges), RynthAi's session (the generic
|
||||
/// part of the Mini Remote's old Character tab, moved here 2026-10-13) and the full buff list.
|
||||
/// Infinite Leaftide's charms stay RynthILT's (its Charms tab in the Mini Remote).
|
||||
/// part of the Mini Remote's old Character tab, moved here 2026-10-13), on Infinite Leaftide RynthILT's
|
||||
/// charms (a second place for them: the Mini Remote's Charms tab stays) and the full buff list.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
|
|
@ -57,6 +57,7 @@ internal sealed partial class OracleView
|
|||
Field(w, "Summoning", SkillText(c.Summoning), 300f, 400f);
|
||||
|
||||
DrawSession(w);
|
||||
DrawCharms(w);
|
||||
|
||||
var list = new List<ActiveEnchantment>(c.Enchantments);
|
||||
list.Sort((a, b) => a.Remaining.CompareTo(b.Remaining));
|
||||
|
|
@ -105,6 +106,97 @@ internal sealed partial class OracleView
|
|||
|
||||
private static string RateText(double perHour) => perHour > 0 ? TimeText.Number((long)Math.Round(perHour)) : "0";
|
||||
|
||||
/// <summary>
|
||||
/// "Charms": RynthILT's Infinite Leaftide charm list (the Mini Remote's Charms tab shows the same
|
||||
/// one), with a Toggle for each carried charm and Guardian Hand. Nothing is listed here: RynthILT
|
||||
/// sends the list, so a charm it learns about shows up without an Oracle update.
|
||||
/// </summary>
|
||||
private void DrawCharms(UiWindow w)
|
||||
{
|
||||
Shared.IltCharmsView v = _c.Charms;
|
||||
if (!v.Loaded)
|
||||
{
|
||||
if (_c.Server.Is(ServerTags.InfiniteLeaftide))
|
||||
{
|
||||
w.SeparatorText("Charms");
|
||||
w.TextDisabled("Load RynthILT to list your Infinite Leaftide charms here.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!v.Available) return; // not an ILT world: no charms
|
||||
|
||||
w.SeparatorText("Charms");
|
||||
w.TextDisabled($"{v.Acquired} acquired, {v.Active} on (from RynthILT{(v.World.Length > 0 ? ", " + v.World : "")}).");
|
||||
if (_c.CharmMessage.Length > 0) w.TextDisabled(_c.CharmMessage);
|
||||
|
||||
if (w.CollapsingHeader($"Charms ({v.Charms.Count})", "c.charms", defaultOpen: true))
|
||||
{
|
||||
if (v.Charms.Count == 0) w.TextDisabled("RynthILT hasn't listed any charms yet.");
|
||||
for (int i = 0; i < v.Charms.Count; i++)
|
||||
{
|
||||
Shared.IltCharmRow r = v.Charms[i];
|
||||
CharmState(w, r.Active);
|
||||
w.SameLine(50f);
|
||||
if (r.Carried) w.Text(Cut(r.Name, 30));
|
||||
else w.TextDisabled(Cut(r.Name, 30));
|
||||
if (r.Effect.Length > 0) w.Tooltip(r.Effect);
|
||||
w.SameLine(270f);
|
||||
w.TextDisabled(r.MaxTier > 0 ? $"T{r.Tier}/{r.MaxTier}" : r.Tier > 0 ? $"T{r.Tier}" : "-");
|
||||
w.SameLine(330f);
|
||||
w.TextDisabled(AcquiredText(r));
|
||||
if (r.Server == "off")
|
||||
{
|
||||
w.SameLine(430f);
|
||||
w.TextColored(UiColors.Red, "server off");
|
||||
}
|
||||
if (r.Carried && r.ToggleId != 0)
|
||||
{
|
||||
w.SameLine(510f);
|
||||
uint id = r.ToggleId;
|
||||
w.SmallButton("Toggle", "c.charm." + i, () => _c.ToggleCharm(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (v.Hands.Count > 0 && w.CollapsingHeader($"Guardian Hands ({v.Hands.Count})", "c.hands", defaultOpen: true))
|
||||
{
|
||||
for (int i = 0; i < v.Hands.Count; i++)
|
||||
{
|
||||
Shared.IltHandRow h = v.Hands[i];
|
||||
CharmState(w, h.Active);
|
||||
w.SameLine(50f);
|
||||
w.Text(Cut(h.Name, 30));
|
||||
if (h.Server == "off")
|
||||
{
|
||||
w.SameLine(430f);
|
||||
w.TextColored(UiColors.Red, "server off");
|
||||
}
|
||||
w.SameLine(510f);
|
||||
uint id = h.Id;
|
||||
w.SmallButton("Toggle", "c.hand." + i, () => _c.ToggleCharm(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>ON in green, OFF in red, "?" in grey (status not read yet).</summary>
|
||||
private static void CharmState(UiWindow w, string active)
|
||||
{
|
||||
switch (active)
|
||||
{
|
||||
case "on": w.TextColored(UiColors.Green, "ON"); break;
|
||||
case "off": w.TextColored(UiColors.Red, "OFF"); break;
|
||||
default: w.TextColored(UiColors.Grey, "?"); break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Carried (with the count), stored (seen on this character before) or not acquired.</summary>
|
||||
internal static string AcquiredText(Shared.IltCharmRow r) => r.Acquired switch
|
||||
{
|
||||
"carried" => r.Count > 1 ? $"carried x{r.Count}" : "carried",
|
||||
"seen" => r.LastSeen.Length > 0 ? "seen " + r.LastSeen : "seen",
|
||||
_ => "not acquired",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The buff timer: the soonest-ending long (over 15 minutes) buff that isn't a beer, a debuff
|
||||
/// or one of the not-really-buffs, with how many there are (upstream's rule).
|
||||
|
|
|
|||
|
|
@ -1,204 +0,0 @@
|
|||
// Ported from Oracle of Dereth by Advis Eveldan (advis61), MIT. See THIRD_PARTY_NOTICES.md.
|
||||
using System;
|
||||
using System.Linq;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
/// <summary>
|
||||
/// ConquestAC (tag Conquest; the tab only exists there): bank balances and bank commands, advanced
|
||||
/// and enlightenment augmentations, levels past 275 and the XP bonus breakdown, fellowships looking
|
||||
/// for members, and the server's custom quest worklist. Upstream's Bank, Conquest Augs, Conquest XP,
|
||||
/// Fship and Custom tabs.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
private static readonly string[] ConquestViews = { "Bank", "Augs", "Enlightenment", "Experience", "Fellowships", "Custom quests" };
|
||||
private int _conquestView;
|
||||
private int _withdrawIndex = ConquestData.DefaultWithdraw, _transferIndex = ConquestData.DefaultTransfer;
|
||||
private string _withdrawAmount = "", _transferAmount = "", _transferTarget = "";
|
||||
private int _fshipSort;
|
||||
|
||||
private void DrawConquest(UiWindow w)
|
||||
{
|
||||
for (int i = 0; i < ConquestViews.Length; i++)
|
||||
{
|
||||
int index = i;
|
||||
if (i > 0) w.SameLine();
|
||||
w.ToggleButton(ConquestViews[i], "cq.v." + i, i == _conquestView, () => _conquestView = index, small: true);
|
||||
}
|
||||
switch (_conquestView)
|
||||
{
|
||||
case 0: DrawConquestBank(w); break;
|
||||
case 1: DrawConquestAugs(w); break;
|
||||
case 2: DrawConquestEnl(w); break;
|
||||
case 3: DrawConquestXp(w); break;
|
||||
case 4: DrawConquestFships(w); break;
|
||||
default: DrawConquestCustom(w); break;
|
||||
}
|
||||
}
|
||||
|
||||
private static string ReadAt(DateTime utc) => utc == DateTime.MinValue ? "not read yet" : $"read at {utc.ToLocalTime():HH:mm}";
|
||||
|
||||
private void DrawConquestBank(UiWindow w)
|
||||
{
|
||||
ConquestData cq = _c.Conquest;
|
||||
w.TextDisabled(ReadAt(cq.BankUtc));
|
||||
foreach (NamedValue b in cq.Bank.OrderBy(b => b.Name, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
w.TextDisabled(Cut(b.Name, 34));
|
||||
w.SameLine(260f);
|
||||
w.Text(b.Value);
|
||||
}
|
||||
if (cq.Bank.Count == 0) w.TextDisabled("No balances read yet.");
|
||||
|
||||
w.SeparatorText("Deposit");
|
||||
w.Button("Deposit everything", "cq.bank.deposit", () => _c.Send("/bank deposit"));
|
||||
w.Tooltip("Sends /bank deposit.");
|
||||
w.Checkbox("Deposit by itself every ten minutes", "cq.bank.auto", _c.Settings.ConquestAutoDeposit,
|
||||
v => { _c.Settings.ConquestAutoDeposit = v; _c.Settings.Save(); });
|
||||
w.Tooltip("At :00, :10, :20 ... while you're logged in on ConquestAC. Its reply is hidden.");
|
||||
|
||||
w.SeparatorText("Withdraw");
|
||||
string[] wl = ConquestData.Withdrawable.Select(c => c.Label).ToArray();
|
||||
w.Combo("Currency", "cq.bank.wcur", _withdrawIndex, wl, i => _withdrawIndex = Math.Clamp(i, 0, wl.Length - 1));
|
||||
w.InputText("Amount", "cq.bank.wamt", _withdrawAmount, 16, s => _withdrawAmount = s);
|
||||
w.Button("Withdraw", "cq.bank.withdraw", () =>
|
||||
{
|
||||
string? cmd = ConquestData.WithdrawCommand(ConquestData.Withdrawable[_withdrawIndex], _withdrawAmount);
|
||||
if (cmd == null) _c.Print("Withdraw: type a whole number above 0.");
|
||||
else _c.Send(cmd);
|
||||
});
|
||||
|
||||
w.SeparatorText("Transfer to a character");
|
||||
string[] tl = ConquestData.Transferable.Select(c => c.Label).ToArray();
|
||||
w.Combo("Currency##t", "cq.bank.tcur", _transferIndex, tl, i => _transferIndex = Math.Clamp(i, 0, tl.Length - 1));
|
||||
w.InputText("Amount##t", "cq.bank.tamt", _transferAmount, 16, s => _transferAmount = s);
|
||||
w.InputText("Character", "cq.bank.tgt", _transferTarget, 40, s => _transferTarget = s);
|
||||
w.Button("Transfer", "cq.bank.transfer", () =>
|
||||
{
|
||||
string? cmd = ConquestData.TransferCommand(ConquestData.Transferable[_transferIndex], _transferAmount, _transferTarget);
|
||||
if (cmd == null) _c.Print("Transfer: type a whole number above 0 (MMD notes: at most 1,000) and a character name.");
|
||||
else _c.Send(cmd);
|
||||
});
|
||||
}
|
||||
|
||||
private void DrawConquestAugs(UiWindow w)
|
||||
{
|
||||
ConquestData cq = _c.Conquest;
|
||||
w.TextDisabled($"{ReadAt(cq.AugsUtc)}, {cq.AugTotal} in total");
|
||||
w.TextDisabled("Aug"); w.SameLine(120f); w.TextDisabled("Have"); w.SameLine(170f); w.TextDisabled("Next costs"); w.SameLine(330f); w.TextDisabled("Effect now");
|
||||
foreach (ConquestAug a in cq.Augs)
|
||||
{
|
||||
w.Text(a.Name);
|
||||
w.SameLine(120f);
|
||||
w.Text(a.Count.ToString());
|
||||
w.SameLine(170f);
|
||||
w.Text(a.NextCostText());
|
||||
w.SameLine(330f);
|
||||
w.TextDisabled(Cut(a.Effect(), 48));
|
||||
w.Tooltip(a.Effect());
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawConquestEnl(UiWindow w)
|
||||
{
|
||||
ConquestData cq = _c.Conquest;
|
||||
w.TextDisabled(ReadAt(cq.EnlUtc));
|
||||
foreach (NamedValue a in cq.EnlAugs)
|
||||
{
|
||||
w.Text(Cut(a.Name, 26));
|
||||
w.SameLine(200f);
|
||||
w.Text(a.Value);
|
||||
w.SameLine(360f);
|
||||
w.TextDisabled(ConquestData.EnlCost(a.Name));
|
||||
}
|
||||
if (cq.EnlAugs.Count == 0) w.TextDisabled("Nothing read yet. Press Refresh.");
|
||||
}
|
||||
|
||||
private void DrawConquestXp(UiWindow w)
|
||||
{
|
||||
ConquestData cq = _c.Conquest;
|
||||
CharacterSnapshot ch = _c.Character;
|
||||
int level = ch.Level;
|
||||
w.SeparatorText($"Level {level}");
|
||||
if (level >= ConquestData.MaxLevel) w.Text("Maximum level.");
|
||||
else
|
||||
{
|
||||
long start = level >= 276 ? ConquestData.XpForLevel(level) : 0;
|
||||
long next = level >= 275 ? ConquestData.XpForLevel(level + 1) : 0;
|
||||
if (next > 0)
|
||||
{
|
||||
long toNext = Math.Max(0, next - ch.TotalXp);
|
||||
long begin = level == 275 ? 191_226_310_247 : start;
|
||||
float frac = next > begin ? (float)Math.Clamp((double)(ch.TotalXp - begin) / (next - begin), 0, 1) : 1f;
|
||||
w.ProgressBar(frac, -1f, 0f, $"{TimeText.Number(toNext)} to level {level + 1}");
|
||||
}
|
||||
else
|
||||
{
|
||||
(long toNext, float frac) = ch.LevelProgress();
|
||||
w.ProgressBar(frac, -1f, 0f, $"{TimeText.Number(toNext)} to level {level + 1}");
|
||||
}
|
||||
long toMax = Math.Max(0, ConquestData.XpForLevel(ConquestData.MaxLevel) - ch.TotalXp);
|
||||
w.TextDisabled($"{TimeText.Number(toMax)} to level {ConquestData.MaxLevel}");
|
||||
}
|
||||
int target = ch.Enlightenment + 1;
|
||||
w.SeparatorText($"Enlightenment {ch.Enlightenment}");
|
||||
w.Text($"Next costs {TimeText.Number(ConquestData.EnlCoinCost(target))} coins and {(ConquestData.EnlLuminanceCost(target) / 1_000_000.0):0.##}M luminance");
|
||||
|
||||
w.SeparatorText("Experience bonuses");
|
||||
w.TextDisabled(ReadAt(cq.BonusUtc));
|
||||
foreach (NamedValue b in cq.Bonuses)
|
||||
{
|
||||
w.TextDisabled(b.Name);
|
||||
w.SameLine(200f);
|
||||
w.Text(b.Value.Length > 0 ? b.Value : "-");
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawConquestFships(UiWindow w)
|
||||
{
|
||||
ConquestData cq = _c.Conquest;
|
||||
w.TextDisabled($"{ReadAt(cq.FshipUtc)}, {cq.Fellowships.Count} looking for members");
|
||||
w.Combo("Sort", "cq.fship.sort", _fshipSort, new[] { "Name", "Leader", "Most members", "Location" }, i => _fshipSort = i);
|
||||
var list = _fshipSort switch
|
||||
{
|
||||
1 => cq.Fellowships.OrderBy(f => f.Leader, StringComparer.OrdinalIgnoreCase),
|
||||
2 => cq.Fellowships.OrderByDescending(f => f.MemberCount),
|
||||
3 => cq.Fellowships.OrderBy(f => f.Location, StringComparer.OrdinalIgnoreCase),
|
||||
_ => cq.Fellowships.OrderBy(f => f.Name, StringComparer.OrdinalIgnoreCase),
|
||||
};
|
||||
w.BeginChild("cq.fship.list", 0f, 0f, border: true);
|
||||
foreach (ConquestFellowship f in list)
|
||||
{
|
||||
w.Text(Cut(f.Name, 26));
|
||||
w.SameLine(200f);
|
||||
w.Text(Cut(f.Leader, 20));
|
||||
w.SameLine(350f);
|
||||
w.Text(f.Members);
|
||||
if (f.Location.Length > 0) { w.SameLine(410f); w.TextDisabled(Cut(f.Location, 26)); }
|
||||
}
|
||||
if (cq.Fellowships.Count == 0) w.TextDisabled("None read yet. Press Refresh.");
|
||||
w.EndChild();
|
||||
}
|
||||
|
||||
private void DrawConquestCustom(UiWindow w)
|
||||
{
|
||||
DateTime now = _c.UtcNow;
|
||||
bool any = false;
|
||||
foreach (CustomQuest q in CustomQuestList.For(_c.Server))
|
||||
{
|
||||
any = true;
|
||||
DoneMark(w, q.IsComplete(_c.Flags, now));
|
||||
w.SameLine(50f);
|
||||
CustomQuest row = q;
|
||||
string status = q.Status(_c.Flags, now);
|
||||
w.Selectable(Cut(q.Name, 34), "cq.cust." + q.Flag, false, () => PrintEntry(row.Name, row.Flag, status, row.Hint, row.Url), 280f);
|
||||
w.SameLine(340f);
|
||||
w.Text(status);
|
||||
}
|
||||
if (!any) w.TextDisabled("No custom quests listed for this server.");
|
||||
if (_c.Flags.LastReadUtc == DateTime.MinValue) w.TextDisabled("Read your quest flags (Quests tab) for their status.");
|
||||
}
|
||||
}
|
||||
214
Plugins/RynthCore.Plugin.RynthOracle/Views/DynamicStampsTab.cs
Normal file
214
Plugins/RynthCore.Plugin.RynthOracle/Views/DynamicStampsTab.cs
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
/// <summary>
|
||||
/// Dynamic Stamps (Infinite Leaftide only): the NPC hand-ins that put a "Dynamic_N_..." flag on
|
||||
/// the character, read from /myquests. They are rows of the Quests tab's merged list (QuestsTab.cs:
|
||||
/// DYN rows, the Show filter's area picker). What is here is the opened stamp's box (RynthNav, the
|
||||
/// Parchment hand-in, chat), the read after a hand-in, and the RynthNav sender every row kind
|
||||
/// shares. The list follows the players' "ExtraDyn" sheet (dynstamps.csv).
|
||||
///
|
||||
/// Give Parchment sends RynthAi's "/ub give 1 <parchment> to <npc>". That verb belongs to
|
||||
/// RynthAi, so the button is disabled (with a tooltip saying why) when RynthAi isn't loaded or has
|
||||
/// answered "Unrecognized /ub command" to it.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
// The stamp clicked last: the box below the list offers RynthNav's auto nav to it.
|
||||
private DynamicStamp? _dynNav;
|
||||
private bool _dynNavDone;
|
||||
private string _dynNavStatus = "";
|
||||
// The Parchment waiting for Yes: handing it over is the one thing here that can't be taken back.
|
||||
private string _giveConfirm = "";
|
||||
|
||||
/// <summary>
|
||||
/// The destination box (the click's pop-up): the stamp, where RynthNav will take you, and Go (plan
|
||||
/// and walk the route: portals, recalls and dungeon entrances included), Arrow, Chat and Close.
|
||||
/// </summary>
|
||||
private void DrawDynamicNavBox(UiWindow w)
|
||||
{
|
||||
DynamicStamp? s = _dynNav;
|
||||
if (s == null) return;
|
||||
List<string> targets = s.NavCandidates();
|
||||
w.SeparatorText("Navigate to " + Cut(s.Label, 40));
|
||||
w.TextDisabled(targets.Count == 0
|
||||
? "No place, coordinates or area to go to for this stamp."
|
||||
: "Where: " + Cut(string.Join(" or ", targets), 90));
|
||||
if (targets.Count > 0)
|
||||
{
|
||||
w.Button("Go (auto nav)", "dy.nav.go", () => SendNav("go", s));
|
||||
w.Tooltip("RynthNav plans the route (walking, portals, recalls, the dungeon's entrance) and walks it.");
|
||||
w.SameLine();
|
||||
w.Button("Arrow", "dy.nav.arrow", () => SendNav("arrow", s));
|
||||
w.Tooltip("Only point RynthNav's arrow at it.");
|
||||
w.SameLine();
|
||||
}
|
||||
w.Button("Chat", "dy.nav.chat", () => PrintStamp(s, _dynNavDone));
|
||||
w.SameLine();
|
||||
w.Button("Close", "dy.nav.close", () => { _dynNav = null; _dynNavStatus = ""; _selKey = ""; _giveConfirm = ""; });
|
||||
|
||||
// The hand-in: a Parchment from your packs to the stamp's NPC (RynthAi's /ub give).
|
||||
if (s.Npc.Length > 0)
|
||||
{
|
||||
string? parchment = CarriedParchment();
|
||||
if (parchment != null)
|
||||
{
|
||||
string? why = GiveUnavailableReason();
|
||||
if (why == null && _giveConfirm == parchment)
|
||||
{
|
||||
// Asked first: the Parchment leaves the pack and doesn't come back.
|
||||
w.TextColored(UiColors.Red, $"Give one {Cut(parchment, 30)} to {Cut(s.Npc, 30)}? It leaves your pack for good.");
|
||||
w.SmallButton("Yes, give it", "dy.nav.give.yes", () => { _giveConfirm = ""; GiveParchment(s, parchment); });
|
||||
w.SameLine();
|
||||
w.SmallButton("Cancel", "dy.nav.give.no", () => _giveConfirm = "");
|
||||
}
|
||||
else if (why == null)
|
||||
{
|
||||
w.Button("Give " + Cut(parchment, 24), "dy.nav.give", () => _giveConfirm = parchment);
|
||||
w.Tooltip($"Hands one {parchment} to {s.Npc} (it asks first). Stand near them (or Go first): AC walks you the last bit.");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Greyed text in place of the button, so it can't be clicked into a command nobody answers.
|
||||
w.TextDisabled("[Give " + Cut(parchment, 24) + "]");
|
||||
w.Tooltip(why);
|
||||
}
|
||||
}
|
||||
else
|
||||
w.TextDisabled("No Parchment in your packs to give " + Cut(s.Npc, 30) + ".");
|
||||
}
|
||||
if (_dynNavStatus.Length > 0) w.TextDisabled(_dynNavStatus);
|
||||
}
|
||||
|
||||
// A /myquests read this long after a Parchment hand-in (the walk there and the NPC's answer), so
|
||||
// the new stamp shows as had; 0 = none due.
|
||||
private const long HandInRefreshMs = 8000;
|
||||
private long _dynRefreshAt;
|
||||
|
||||
/// <summary>The read after a hand-in, when it is due: now, or when the server's once-a-minute wait ends.</summary>
|
||||
private void RefreshAfterHandIn(QuestFlagStore flags)
|
||||
{
|
||||
if (_dynRefreshAt == 0 || _c.NowMs < _dynRefreshAt) return;
|
||||
if (flags.Loading) return;
|
||||
int wait = flags.ThrottleSecondsLeft(_c.NowMs);
|
||||
if (wait > 0) { _dynRefreshAt = _c.NowMs + wait * 1000L; return; }
|
||||
_dynRefreshAt = 0;
|
||||
_c.RequestQuests();
|
||||
}
|
||||
|
||||
// Packs scanned for a Parchment at most this often (the box draws every frame).
|
||||
private const long ParchmentScanMs = 1500;
|
||||
private long _parchmentScanAt;
|
||||
private string? _parchmentName;
|
||||
|
||||
/// <summary>
|
||||
/// The name of a Parchment you carry (the main pack and its side packs), or null. Any item
|
||||
/// whose name has "Parchment" in it; read again every <see cref="ParchmentScanMs"/>.
|
||||
/// </summary>
|
||||
private string? CarriedParchment()
|
||||
{
|
||||
if (_c.ParchmentFinder != null) return _c.ParchmentFinder();
|
||||
if (_c.NowMs - _parchmentScanAt < ParchmentScanMs && _parchmentScanAt != 0) return _parchmentName;
|
||||
_parchmentScanAt = _c.NowMs == 0 ? 1 : _c.NowMs;
|
||||
_parchmentName = null;
|
||||
RynthCore.PluginSdk.RynthCoreHost host = _c.Host; // a struct: an empty one (the offline tests) reports nothing carried
|
||||
uint me = _c.Character.PlayerId;
|
||||
if (!_c.InWorld || me == 0 || !host.HasGetContainerContents) return null;
|
||||
var buf = new uint[512];
|
||||
var packs = new List<uint> { me };
|
||||
for (int p = 0; p < packs.Count && p < 16; p++)
|
||||
{
|
||||
int n = Math.Min(host.GetContainerContents(packs[p], buf), buf.Length);
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
uint id = buf[i];
|
||||
if (!host.TryGetObjectName(id, out string name)) continue;
|
||||
if (name.IndexOf("Parchment", StringComparison.OrdinalIgnoreCase) >= 0) { _parchmentName = name; return name; }
|
||||
// A side pack in the main pack: look inside it too (only one level deep, as AC packs go).
|
||||
if (p == 0) packs.Add(id);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>Why Give Parchment can't be used now (for its tooltip); null when it can.</summary>
|
||||
private string? GiveUnavailableReason()
|
||||
{
|
||||
if (_c.UbGiveMissing)
|
||||
return "The loaded RynthAi has no \"/ub give\" (it answered \"Unrecognized /ub command\"). Update RynthAi, or hand the Parchment over yourself.";
|
||||
if (!_c.UbGiveAvailable())
|
||||
return "Needs RynthAi: the hand-in is RynthAi's \"/ub give\". It isn't loaded (or you aren't logged in), so give the Parchment to the NPC yourself.";
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>A name made safe to put inside a chat command: no control characters.</summary>
|
||||
private static string ForCommand(string name)
|
||||
{
|
||||
var sb = new System.Text.StringBuilder(name.Length);
|
||||
foreach (char ch in name) if (ch >= ' ' && ch != '\u007f') sb.Append(ch);
|
||||
return sb.ToString().Trim();
|
||||
}
|
||||
|
||||
/// <summary>"/ub give 1 <parchment> to <npc>": RynthAi finds the NPC by name and hands it over.</summary>
|
||||
private void GiveParchment(DynamicStamp s, string parchment)
|
||||
{
|
||||
if (!_c.InWorld) { _dynNavStatus = "Log in first."; return; }
|
||||
string? why = GiveUnavailableReason();
|
||||
if (why != null) { _dynNavStatus = why; return; }
|
||||
_c.UbGiveSentMs = _c.NowMs; // a "Unrecognized /ub command" in the next moments turns the button off
|
||||
bool sent = _c.RunCommand($"/ub give 1 {ForCommand(parchment)} to {ForCommand(s.Npc)}");
|
||||
_parchmentScanAt = 0; // read the packs again after the give
|
||||
// The stamp is a quest flag: read /myquests again once the NPC has had time to answer.
|
||||
if (sent) _dynRefreshAt = _c.NowMs + HandInRefreshMs;
|
||||
_dynNavStatus = sent
|
||||
? $"Giving {parchment} to {s.Npc} (RynthAi does the give; it says so in chat if {s.Npc} isn't in sight)."
|
||||
: "Could not send the give.";
|
||||
}
|
||||
|
||||
/// <summary>Clicking a row: select it and ask RynthNav for the route (shown in chat and its overlay).</summary>
|
||||
private void SelectDynamicStamp(DynamicStamp s, bool done)
|
||||
{
|
||||
_dynNav = s;
|
||||
_dynNavDone = done;
|
||||
_dynNavStatus = "";
|
||||
_giveConfirm = "";
|
||||
if (s.NavCandidates().Count > 0) SendNav("route", s);
|
||||
}
|
||||
|
||||
/// <summary>"/rnav <verb> a || b || c" to RynthNav (it takes the first candidate on its map).</summary>
|
||||
private void SendNav(string verb, DynamicStamp s)
|
||||
{
|
||||
List<string> targets = s.NavCandidates();
|
||||
if (targets.Count == 0) return;
|
||||
_dynNavStatus = SendRynthNav(verb, targets);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// "/rnav <verb> a || b || c" to RynthNav (go walks the route, route plans it in chat, arrow
|
||||
/// points at it; RynthNav takes the first candidate on its map). What to tell the player.
|
||||
/// Shared by every row kind of the Quests tab.
|
||||
/// </summary>
|
||||
private string SendRynthNav(string verb, IReadOnlyList<string> targets)
|
||||
{
|
||||
if (targets.Count == 0) return "";
|
||||
if (!_c.InWorld) return "Log in first.";
|
||||
bool sent = _c.SendNav(verb + " " + string.Join(" || ", targets));
|
||||
return !sent ? "RynthNav isn't loaded (it plans and walks the route)."
|
||||
: verb == "go" ? "RynthNav is planning the route and walking it (its chat lines say how)."
|
||||
: verb == "arrow" ? "RynthNav's arrow points at it."
|
||||
: "RynthNav's route is in chat. Go walks it.";
|
||||
}
|
||||
|
||||
/// <summary>Chat: the NPC, its stamp and whether this character has it, where, the reward and
|
||||
/// any coordinates (RynthChat makes those a RynthNav arrow link).</summary>
|
||||
private void PrintStamp(DynamicStamp s, bool done)
|
||||
{
|
||||
string where = s.Place.Length > 0 ? $"{s.Area}, {s.Place}" : s.Area;
|
||||
string details = $"{where}" + (s.Reward.Length > 0 ? $" - gives {s.Reward}" : "") + (s.Note.Length > 0 ? $" - {s.Note}" : "");
|
||||
PrintEntry(s.Label, s.Stamp, done ? "have" : "missing", details, "");
|
||||
}
|
||||
}
|
||||
18
Plugins/RynthCore.Plugin.RynthOracle/Views/LegendaryTab.cs
Normal file
18
Plugins/RynthCore.Plugin.RynthOracle/Views/LegendaryTab.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
/// <summary>
|
||||
/// Legendary Key quests (John in Arwic counts 30 for his reward): rows of the Quests tab's merged
|
||||
/// list since 2026-10-18 (QuestsTab.cs: LEG rows, John's counter in the trackers' status). The list
|
||||
/// and notes follow the "Arwic John Route" sheet (legendary.csv). What is left here is the chat print.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
/// <summary>Chat: the quest, its flags and status, the sheet's notes, wiki and video links.</summary>
|
||||
private void PrintLegendary(LegendaryQuest q, string status)
|
||||
{
|
||||
PrintEntry(q.Label, string.Join(", ", q.Flags), status, q.Note, q.Url);
|
||||
if (q.Video.Length > 0) _c.Print("Video: " + q.Video);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,61 +1,15 @@
|
|||
// Ported from Oracle of Dereth by Advis Eveldan (advis61), MIT. See THIRD_PARTY_NOTICES.md.
|
||||
using System;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
/// <summary>Markers: which of the 100 exploration markers you've found, and the next one to run to.</summary>
|
||||
/// <summary>
|
||||
/// The 100 exploration markers: rows of the Quests tab's merged list (QuestsTab.cs: MRK rows, the
|
||||
/// markers found and the next one in the trackers' status, "Not done" for the ones still to find).
|
||||
/// What is left here is the chat print a click on a marker row (or its Print button) gives.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
private const int MarkerPageSize = 50;
|
||||
private bool _markersMissingOnly;
|
||||
private int _markerPage;
|
||||
|
||||
private void DrawMarkers(UiWindow w)
|
||||
{
|
||||
QuestFlagStore flags = _c.Flags;
|
||||
if (flags.LastReadUtc == DateTime.MinValue)
|
||||
w.TextDisabled("Quest flags not read yet (Quests tab, Refresh).");
|
||||
|
||||
int found = 0;
|
||||
Marker? next = null;
|
||||
foreach (Marker m in MarkerList.All)
|
||||
{
|
||||
if (m.IsFound(flags)) found++;
|
||||
else next ??= m;
|
||||
}
|
||||
w.ProgressBar(MarkerList.All.Count > 0 ? (float)found / MarkerList.All.Count : 0f, -1f, 0f, $"{found} / {MarkerList.All.Count} markers found");
|
||||
if (next != null)
|
||||
{
|
||||
Marker n = next;
|
||||
w.TextDisabled("Next:");
|
||||
w.SameLine();
|
||||
w.Selectable($"#{next.Number} {next.Name} ({next.Location})", "m.next", false, () => PrintMarker(n));
|
||||
w.Tooltip("Prints the directions in chat.");
|
||||
}
|
||||
w.Checkbox("Only the ones still to find", "m.missing", _markersMissingOnly, v => { _markersMissingOnly = v; _markerPage = 0; });
|
||||
|
||||
var rows = new System.Collections.Generic.List<Marker>();
|
||||
foreach (Marker m in MarkerList.All)
|
||||
if (!_markersMissingOnly || !m.IsFound(flags)) rows.Add(m);
|
||||
_markerPage = Pager(w, "m.page", _markerPage, rows.Count, MarkerPageSize, p => _markerPage = p);
|
||||
|
||||
w.BeginChild("m.list", 0f, 0f, border: true);
|
||||
int start = _markerPage * MarkerPageSize;
|
||||
for (int i = start; i < rows.Count && i < start + MarkerPageSize; i++)
|
||||
{
|
||||
Marker m = rows[i];
|
||||
DoneMark(w, m.IsFound(flags));
|
||||
w.SameLine(50f);
|
||||
Marker row = m;
|
||||
w.Selectable(Cut($"#{m.Number} {m.Name}", 38), "m.r." + m.Number, false, () => PrintMarker(row), 300f);
|
||||
w.SameLine(360f);
|
||||
w.TextDisabled(Cut(m.Location, 24));
|
||||
}
|
||||
w.EndChild();
|
||||
}
|
||||
|
||||
private void PrintMarker(Marker m) =>
|
||||
PrintEntry($"Marker {m.Number}: {m.Name}", "", m.IsFound(_c.Flags) ? "found" : "", m.Hint, m.Url);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,11 @@ internal sealed partial class OracleView
|
|||
public const string TabQuests = "Quests", TabCharacter = "Character",
|
||||
TabSkills = "Skills", TabAttributes = "Attributes", TabProgress = "Progress",
|
||||
TabAugs = "Augs", TabSociety = "Society",
|
||||
TabMarkers = "Markers", TabTitles = "Titles", TabVoid = "Void", TabFellowship = "Fellowship",
|
||||
TabBoards = "Leaderboards", TabConquest = "Conquest", TabAbout = "About";
|
||||
TabTitles = "Titles", TabVoid = "Void", TabFellowship = "Fellowship",
|
||||
TabBreeding = "Pet Breeding", TabAbout = "About";
|
||||
// The Markers tab (and the Legendary and Dynamic Stamps trackers and RynthILT's Temple guardians)
|
||||
// are rows of the Quests tab: QuestsTab.cs, ShowTrackers, /ro markers. A saved tab name of the old
|
||||
// Markers tab falls back to Quests (see Tab).
|
||||
|
||||
/// <summary>
|
||||
/// A tab: shown where any of its server tags matches the server; no tags = everywhere (retail).
|
||||
|
|
@ -51,17 +54,17 @@ internal sealed partial class OracleView
|
|||
() => "Re-reads your character from the game and sends /myquests for the gem timers."),
|
||||
new(TabSociety, any, DrawSociety, true, RefreshCharacterAndQuests,
|
||||
() => "Re-reads your society standing from the game and sends /myquests for today's ribbons and quest timers."),
|
||||
new(TabMarkers, any, DrawMarkers, false, () => RefreshQuests(),
|
||||
() => "Sends /myquests: the markers you found are in your quest flags."),
|
||||
new(TabTitles, any, DrawTitles, false, RefreshTitles,
|
||||
() => "Re-reads the titles you hold from the game."),
|
||||
new(TabVoid, any, DrawVoid, true, RefreshVoid,
|
||||
() => "Re-reads your buffs from the game and drops the spell timers that ran out."),
|
||||
new(TabFellowship, any, DrawFellowship, false, RefreshFellowship,
|
||||
() => "Re-reads the fellowship and its members from the game."),
|
||||
// Server-specific: each parser and its commands only exist on its own server.
|
||||
new(TabBoards, new[] { Data.ServerTags.Conquest, Data.ServerTags.Aelrynth }, DrawBoards, false, RefreshBoards, BoardsHelp),
|
||||
new(TabConquest, new[] { Data.ServerTags.Conquest }, DrawConquest, true, RefreshConquest, ConquestHelp),
|
||||
// A server's own pages are its server plugin's since 2026-10-20: Conquest's (bank, augs,
|
||||
// boards, ...) RynthConquest's, Aelrynth's leaderboards and Trials RynthAelrynth's.
|
||||
// Infinite Leaftide only, and only while the server has pet breeding (BreedingOffered).
|
||||
new(TabBreeding, new[] { Data.ServerTags.InfiniteLeaftide }, DrawBreeding, false, RefreshBreeding,
|
||||
() => "Asks RynthILT to appraise every essence again (charges, rest timers, bond, growth)."),
|
||||
new(TabAbout, any, DrawAbout, false, RefreshAbout,
|
||||
() => "Loads the quest list and server pack from their files again and asks RynthCore which server this is."),
|
||||
};
|
||||
|
|
@ -69,11 +72,24 @@ internal sealed partial class OracleView
|
|||
|
||||
private bool Visible(TabDef t)
|
||||
{
|
||||
if (t.Name == TabBreeding && !BreedingOffered()) return false;
|
||||
if (t.Servers.Length == 0) return true;
|
||||
foreach (string s in t.Servers) if (_c.Server.Is(s)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Pet Breeding tab is offered on an Infinite Leaftide world unless RynthILT's profile says
|
||||
/// the server has pet breeding switched off (a feature it doesn't know yet counts as on).
|
||||
/// </summary>
|
||||
internal bool BreedingOffered()
|
||||
{
|
||||
if (!_c.Server.Is(Data.ServerTags.InfiniteLeaftide)) return false;
|
||||
foreach (Data.IltFeature f in _c.Ilt.Profile.Features)
|
||||
if (f.Key == "pet_breeding") return f.State != RynthCore.Plugin.Shared.RynthIltServer.StateOff;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>The selected tab's name; a tab not available on this server falls back to Quests.</summary>
|
||||
public string Tab
|
||||
{
|
||||
|
|
|
|||
202
Plugins/RynthCore.Plugin.RynthOracle/Views/PetBreedingTab.cs
Normal file
202
Plugins/RynthCore.Plugin.RynthOracle/Views/PetBreedingTab.cs
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
using RynthCore.Plugin.Shared;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
/// <summary>
|
||||
/// "Pet Breeding" (Infinite Leaftide, and only where the server has pet breeding on): RynthILT's
|
||||
/// breeding tracker, the same one as RynthAi's Mini Remote Pets > Breeding tab (which stays). RynthILT
|
||||
/// reads the essences, learns the server's rules and runs the actions; this tab draws its JSON
|
||||
/// ("RynthILT.Data" GetPetBreedingJson) and sends its verbs back. Dance and supply uses ask here
|
||||
/// first (RynthILT doesn't ask again). The page's Refresh button is the Refresh row every page has.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
/// <summary>Essence rows drawn at most (each is about eight ops; the window's op budget is shared).</summary>
|
||||
private const int BreedingMaxRows = 40;
|
||||
|
||||
/// <summary>The breeding verb waiting for Yes / No, with its question ("" = none).</summary>
|
||||
private string _breedConfirmVerb = "", _breedConfirmText = "";
|
||||
/// <summary>The essence the supplies are used on (index into the essence list).</summary>
|
||||
private int _breedTarget;
|
||||
|
||||
private void DrawBreeding(UiWindow w)
|
||||
{
|
||||
IltBreedingView v = _c.Breeding;
|
||||
w.SeparatorText("Pet Breeding");
|
||||
if (!v.Loaded)
|
||||
{
|
||||
w.TextDisabled(_c.IltData.Connected && !_c.IltData.PetBreedingSupported
|
||||
? "This RynthILT is older than 0.3.1 and has no breeding tracker; update RynthILT."
|
||||
: "Load RynthILT (0.3.1 or later) to track pet breeding here. Reading...");
|
||||
return;
|
||||
}
|
||||
|
||||
uint col = v.Enabled == "off" ? UiColors.Red : v.Enabled == "on" ? UiColors.Green : UiColors.Yellow;
|
||||
w.TextColored(col, v.Enabled switch
|
||||
{
|
||||
"off" => "Pet breeding is off on this server.",
|
||||
"on" => $"Pet breeding: on. Breeding room: {v.Room}.",
|
||||
_ => "Pet breeding: not confirmed yet (Diagnostics in the breeding room checks).",
|
||||
});
|
||||
if (v.Bond == "off") w.TextColored(UiColors.Yellow, "Pet bond is off here, so bond can't reach the breeding minimum.");
|
||||
|
||||
w.SmallButton("Diagnostics", "br.debug", () => _c.BreedingCommand(IltBreedingView.DebugVerb()));
|
||||
w.Tooltip("@breed-debug: whether you're in the breeding room, your pet, partners nearby.");
|
||||
w.SameLine();
|
||||
w.SmallButton("Dance", "br.dance", () => AskBreeding(IltBreedingView.DanceVerb(),
|
||||
"Dance now? If your partner dances in time with both pets summoned in the same room, the breed happens."));
|
||||
w.Tooltip("@dance: both owners must dance within a few seconds.");
|
||||
w.SameLine();
|
||||
w.SmallButton("Mini Remote", "br.remote", () => _c.RunCommand("/ra hub open breeding"));
|
||||
w.Tooltip("RynthAi's Mini Remote, Pets > Breeding (the same tracker, with the pair planner).");
|
||||
|
||||
if (_breedConfirmVerb.Length > 0)
|
||||
{
|
||||
w.TextColored(UiColors.Gold, _breedConfirmText);
|
||||
string verb = _breedConfirmVerb;
|
||||
w.SmallButton("Yes", "br.yes", () => { _breedConfirmVerb = ""; _c.BreedingCommand(verb); });
|
||||
w.SameLine();
|
||||
w.SmallButton("No", "br.no", () => _breedConfirmVerb = "");
|
||||
}
|
||||
if (v.Message.Length > 0) w.TextDisabled(v.Message);
|
||||
else if (_c.BreedingMessage.Length > 0) w.TextDisabled(_c.BreedingMessage);
|
||||
if (v.FreeSlots == 0) w.TextColored(UiColors.Yellow, "Your main pack is full: as the dam's owner you couldn't receive the baby.");
|
||||
|
||||
DrawBreedEssences(w, v);
|
||||
DrawBreedPairs(w, v);
|
||||
DrawBreedSupplies(w, v);
|
||||
DrawBreedRules(w, v);
|
||||
DrawBreedEvents(w, v);
|
||||
}
|
||||
|
||||
/// <summary>Holds a verb until the player clicks Yes.</summary>
|
||||
private void AskBreeding(string verb, string question)
|
||||
{
|
||||
_breedConfirmVerb = verb;
|
||||
_breedConfirmText = question;
|
||||
}
|
||||
|
||||
private void DrawBreedEssences(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
int ready = 0;
|
||||
foreach (IltBreedEssenceRow e in v.Essences) if (e.Ready) ready++;
|
||||
if (!w.CollapsingHeader($"Essences ({ready} ready of {v.Essences.Count})", "br.ess", defaultOpen: true)) return;
|
||||
if (v.Essences.Count == 0) { w.TextDisabled("No combat pet essences in your pack."); return; }
|
||||
for (int i = 0; i < v.Essences.Count && i < BreedingMaxRows; i++)
|
||||
{
|
||||
IltBreedEssenceRow e = v.Essences[i];
|
||||
w.TextColored(e.Ready ? UiColors.Green : e.Problems.Count > 0 && e.ReadyIn > 0 ? UiColors.Yellow : UiColors.Grey, Cut(e.Status, 22));
|
||||
w.SameLine(170f);
|
||||
w.Text(Cut(e.Name, 32));
|
||||
w.Tooltip(BreedTooltip(e));
|
||||
w.SameLine(410f);
|
||||
w.TextDisabled($"{(e.Male ? "M" : "F")} T{(e.Tier > 0 ? e.Tier.ToString(CultureInfo.InvariantCulture) : "?")} B{e.Bond} "
|
||||
+ $"Mut {e.Mutations}{(e.PotencyMutations > 0 ? "+" + e.PotencyMutations + "p" : "")}");
|
||||
}
|
||||
if (v.Essences.Count > BreedingMaxRows) w.TextDisabled($"... and {v.Essences.Count - BreedingMaxRows} more (see the Mini Remote).");
|
||||
}
|
||||
|
||||
private static string BreedTooltip(IltBreedEssenceRow e)
|
||||
{
|
||||
var lines = new List<string> { $"{e.Name}: {(e.Male ? "stud" : "dam")}, tier {e.Tier}, bond {e.Bond}" };
|
||||
if (e.Male) lines.Add($"Charges {e.Charges}/{e.ChargesMax}");
|
||||
if (e.Juvenile) lines.Add($"Growing: {e.Stage}, {Math.Max(0, e.KillsRequired - e.Kills)} kills to Adult");
|
||||
if (e.Boosters.Count > 0) lines.Add("Boosters: " + string.Join(", ", e.Boosters));
|
||||
foreach (string p in e.Problems) lines.Add("- " + p);
|
||||
return string.Join("\n", lines);
|
||||
}
|
||||
|
||||
private static void DrawBreedPairs(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
if (v.Pairs.Count == 0) return;
|
||||
if (!w.CollapsingHeader($"Ready pairs ({v.Pairs.Count})", "br.pairs", defaultOpen: true)) return;
|
||||
w.TextDisabled("Stat mutation odds; fewer inherited mutations keep the odds up. Each owner dances with their own pet.");
|
||||
for (int i = 0; i < v.Pairs.Count; i++)
|
||||
{
|
||||
IltBreedPairRow p = v.Pairs[i];
|
||||
w.Text($"{Cut(p.Stud, 26)} x {Cut(p.Dam, 26)}");
|
||||
w.SameLine(400f);
|
||||
w.TextDisabled($"{Pct(p.ChanceWorst)}-{Pct(p.ChanceBest)}, inherits {p.InheritMin}-{p.InheritMax}");
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawBreedSupplies(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
long carried = 0;
|
||||
foreach (IltBreedSupplyRow s in v.Supplies) carried += s.Count;
|
||||
if (!w.CollapsingHeader($"Supplies ({carried} carried)", "br.sup", defaultOpen: false)) return;
|
||||
w.TextDisabled("Ivo sells these at the Seedy Motel. Boosters are spent by the essence's next breed.");
|
||||
|
||||
IltBreedEssenceRow? target = null;
|
||||
if (v.Essences.Count > 0)
|
||||
{
|
||||
var names = new List<string>(v.Essences.Count);
|
||||
foreach (IltBreedEssenceRow e in v.Essences) names.Add(Cut(e.Name, 34));
|
||||
int index = Math.Clamp(_breedTarget, 0, v.Essences.Count - 1);
|
||||
w.Combo("Use on", "br.target", index, names, i => _breedTarget = i);
|
||||
target = v.Essences[index];
|
||||
}
|
||||
|
||||
for (int i = 0; i < v.Supplies.Count; i++)
|
||||
{
|
||||
IltBreedSupplyRow s = v.Supplies[i];
|
||||
w.TextColored(s.Count > 0 ? UiColors.Green : UiColors.Grey, $"{s.Count,3} {s.Name}");
|
||||
w.Tooltip(s.Price > 0 ? $"{s.Effect}\nIvo's price: {Price(s.Price)} pyreals" : s.Effect);
|
||||
if (!s.Apply || s.Count <= 0 || target == null) continue;
|
||||
w.SameLine(330f);
|
||||
if (System.Linq.Enumerable.Contains(s.Targets, target.Id))
|
||||
{
|
||||
string verb = IltBreedingView.ApplyVerb(s.Key, target.Id);
|
||||
string q = $"Use {s.Name} on {target.Name}? {s.Effect}";
|
||||
w.SmallButton("Use", "br.use." + i, () => AskBreeding(verb, q));
|
||||
}
|
||||
else w.TextDisabled("-");
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawBreedRules(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
if (!w.CollapsingHeader("Server rules", "br.rules", defaultOpen: false)) return;
|
||||
w.TextDisabled("Values this server showed win over the ILT profile, which wins over ACE's defaults.");
|
||||
foreach (IltBreedRuleRow r in v.Rules)
|
||||
{
|
||||
w.Text(r.Label);
|
||||
if (r.Help.Length > 0) w.Tooltip(r.Help);
|
||||
w.SameLine(230f);
|
||||
w.Text(r.Value);
|
||||
w.SameLine(310f);
|
||||
w.TextColored(r.Source == "seen on server" ? UiColors.Green : UiColors.Grey, r.Source);
|
||||
}
|
||||
if (v.Debug is { } d)
|
||||
{
|
||||
w.Separator();
|
||||
w.TextDisabled($"Last diagnostics ({d.When} UTC):");
|
||||
if (d.Location.Length > 0) w.BulletText("You: " + d.Location);
|
||||
if (d.Match.Length > 0) w.BulletText(d.Match == "valid" ? "In the breeding room" : "Not in the breeding room");
|
||||
if (d.Pet.Length > 0) w.BulletText("Pet: " + d.Pet + (d.Sex.Length > 0 ? " (" + d.Sex + ")" : ""));
|
||||
if (d.Partners >= 0) w.BulletText($"Partners nearby: {d.Partners}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawBreedEvents(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
if (!w.CollapsingHeader($"Recent events ({v.Events.Count})", "br.events", defaultOpen: false)) return;
|
||||
if (v.Events.Count == 0) w.TextDisabled("Nothing yet: rituals, births, growth and charges land here.");
|
||||
foreach (IltBreedEventRow e in v.Events)
|
||||
{
|
||||
w.TextDisabled(e.When);
|
||||
w.SameLine(130f);
|
||||
w.TextWrapped(e.Text);
|
||||
}
|
||||
}
|
||||
|
||||
private static string Pct(double v) => (v * 100).ToString("0.#", CultureInfo.InvariantCulture) + "%";
|
||||
|
||||
private static string Price(long p) => p >= 1_000_000
|
||||
? (p / 1_000_000.0).ToString("0.##", CultureInfo.InvariantCulture) + "M"
|
||||
: p.ToString("N0", CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
|
@ -1,25 +1,42 @@
|
|||
// Ported from Oracle of Dereth by Advis Eveldan (advis61), MIT. See THIRD_PARTY_NOTICES.md.
|
||||
// Tracking, kill tasks and rewards merged in from RynthAi's Mini Remote Quests tab and
|
||||
// UtilityBelt ILT's quest tracker (2026-10-13). Infinite Leaftide's quest bonus list (/qb) stays
|
||||
// RynthILT's (the Quests section it draws in the Mini Remote).
|
||||
// Tracking, kill tasks, rewards and the quest bonus list merged in from RynthAi's Mini Remote
|
||||
// Quests tab and UtilityBelt ILT's quest tracker (2026-10-13). The Legendary, Markers and Dynamic
|
||||
// Stamps tabs and RynthILT's Temple guardians merged in as tracker rows (SilentKelpie's PR 12,
|
||||
// RynthOracle 0.6.0, ported by hand onto this lineage).
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RynthCore.Plugin.RynthOracle.Data;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
using RynthCore.Plugin.Shared;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
/// <summary>
|
||||
/// Quests: every flag the character holds, cross-referenced with the master quest list, in one
|
||||
/// searchable, sortable, paged list (upstream's Quest Flags tab). The * column tracks a quest in
|
||||
/// the Quest Timers window; clicking a quest opens it below the list, with its notes and the
|
||||
/// rewards editor (UtilityBelt ILT's).
|
||||
/// What a row of the merged Quests list is. Every kind but Quest is a tracker: Legendary Key quests
|
||||
/// and exploration markers everywhere, Dynamic Stamps and the Temple guardians on Infinite Leaftide.
|
||||
/// </summary>
|
||||
internal enum QuestKind { Quest, Legendary, Marker, Dynamic, Guardian }
|
||||
|
||||
/// <summary>
|
||||
/// Quests: every flag the character holds, cross-referenced with the master quest list, plus the
|
||||
/// trackers (Legendary Key quests, exploration markers, Dynamic Stamps, Temple guardians), in one
|
||||
/// searchable, sortable, paged list. Each kind shows only on the servers it belongs to, and
|
||||
/// "Trackers only" narrows the list to the trackers with their status above it. The * column tracks
|
||||
/// a quest in the Quest Timers window (a favourite); clicking a row opens it below the list: a
|
||||
/// quest's notes and rewards editor, a tracker's details, and RynthNav's Go / Route / Arrow for any
|
||||
/// coordinates in its notes. A click on a quest or a marker also prints its texts in chat. On
|
||||
/// Infinite Leaftide the quest bonus list (/qb, read by RynthILT) follows.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
private const int QuestPageSize = 40;
|
||||
private const int QbShownMax = 150; // per /qb list on one pass (the rest: narrow with Search)
|
||||
private const float QuestListHeightWithPanel = 300f;
|
||||
private static readonly string[] QuestSorts = { "Flag", "Name", "Done first", "Not done first", "Ready soonest", "Most solves" };
|
||||
/// <summary>The kinds' names in <see cref="QuestKind"/> order (the Show filter).</summary>
|
||||
private static readonly string[] KindNames = { "Quests", "Legendary", "Markers", "Dynamic Stamps", "Guardians" };
|
||||
/// <summary>The guardians' last answer is offered for this long (RynthILT's Mini Remote line does the same).</summary>
|
||||
private const long GuardianAnswerShownSec = 600;
|
||||
|
||||
// The reward editor's fields, in QuestReward order (two percentages, then counts).
|
||||
private static readonly string[] RewardLabels =
|
||||
|
|
@ -27,21 +44,79 @@ internal sealed partial class OracleView
|
|||
|
||||
private string _questSearch = "";
|
||||
private bool _qDone, _qNotDone, _qRepeatable, _qOneTime, _qNew, _qServer, _qTracked, _qKill;
|
||||
// Trackers only: the list keeps only tracker rows, with the trackers' status above it.
|
||||
private bool _qTrackers;
|
||||
// The Show filter: one kind, or null for every kind this server has.
|
||||
private QuestKind? _qKind;
|
||||
private int _questSort;
|
||||
private int _questPage;
|
||||
private int _dynArea; // 0 = all areas, else DynamicStampList.Areas[n - 1] (Show: Dynamic Stamps)
|
||||
|
||||
private readonly List<Quest> _questRows = new();
|
||||
private readonly List<QuestRow> _questRows = new();
|
||||
private string _questKey = "";
|
||||
private long _questBuiltMs;
|
||||
|
||||
// The quest opened below the list, and its reward editor's text (kept while typing).
|
||||
// The row opened below the list: a quest (_questSel), a Dynamic Stamp (_dynNav) or another tracker (_selKey).
|
||||
private QuestKind _selKind;
|
||||
private string _selKey = "";
|
||||
private string _questSel = "";
|
||||
private readonly string[] _rewardEdit = new string[RewardLabels.Length];
|
||||
private string _rewardMsg = "";
|
||||
|
||||
/// <summary>One row of the merged list: its kind, a unique key, and the entry it shows.</summary>
|
||||
private sealed class QuestRow
|
||||
{
|
||||
public QuestKind Kind;
|
||||
/// <summary>Unique across kinds: the quest flag, or "lg:", "mk:", "dy:", "gd:" and the tracker's own key.</summary>
|
||||
public string Key = "";
|
||||
public string Label = "";
|
||||
/// <summary>The tracker's group: a Legendary area, a marker's location, a stamp's area, a guardian's NPC.</summary>
|
||||
public string Group = "";
|
||||
/// <summary>Its place in its own list (the default order of tracker rows).</summary>
|
||||
public int Order;
|
||||
public bool Done;
|
||||
public Quest? Q;
|
||||
public LegendaryQuest? L;
|
||||
public Marker? M;
|
||||
public DynamicStamp? D;
|
||||
public IltGuardianRow? G;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The kinds this server shows: quests, Legendary quests and markers everywhere; Dynamic Stamps
|
||||
/// and the Temple guardians only on Infinite Leaftide. Internal for the tests.
|
||||
/// </summary>
|
||||
internal List<QuestKind> AvailableKinds()
|
||||
{
|
||||
var kinds = new List<QuestKind> { QuestKind.Quest, QuestKind.Legendary, QuestKind.Marker };
|
||||
if (_c.Server.Is(ServerTags.InfiniteLeaftide))
|
||||
{
|
||||
kinds.Add(QuestKind.Dynamic);
|
||||
kinds.Add(QuestKind.Guardian);
|
||||
}
|
||||
return kinds;
|
||||
}
|
||||
|
||||
/// <summary>A kind is listed: this server has it, the Show filter allows it, and Trackers only doesn't hide it.</summary>
|
||||
private bool KindListed(QuestKind k, List<QuestKind> kinds)
|
||||
=> kinds.Contains(k) && (_qKind == null || _qKind == k) && !(_qTrackers && k == QuestKind.Quest);
|
||||
|
||||
/// <summary>
|
||||
/// Opens the Quests tab on the trackers: one kind (/ro legendary, /ro dynamic, /ro markers,
|
||||
/// /ro guardians) or all of them (null). The old tabs' commands land here.
|
||||
/// </summary>
|
||||
public void ShowTrackers(QuestKind? kind)
|
||||
{
|
||||
_qTrackers = kind != QuestKind.Quest;
|
||||
_qKind = kind;
|
||||
_questPage = 0;
|
||||
Tab = TabQuests;
|
||||
}
|
||||
|
||||
private void DrawQuests(UiWindow w)
|
||||
{
|
||||
QuestFlagStore flags = _c.Flags;
|
||||
RefreshAfterHandIn(flags);
|
||||
if (flags.ServerDisabled)
|
||||
w.TextColored(UiColors.Red, "This server has /myquests turned off, so quest flags can't be read.");
|
||||
else if (flags.Loading)
|
||||
|
|
@ -50,6 +125,9 @@ internal sealed partial class OracleView
|
|||
w.TextDisabled("Quest flags not read yet. Press Refresh, or type /myquests.");
|
||||
else
|
||||
w.Text($"{flags.Flags.Count} quest flags on this character, read at {flags.LastReadUtc.ToLocalTime():HH:mm}.");
|
||||
int throttleLeft = flags.ThrottleSecondsLeft(_c.NowMs);
|
||||
if (throttleLeft > 0 && !flags.Loading)
|
||||
w.TextDisabled($"The server answers one /myquests a minute: Refresh works again in {throttleLeft}s.");
|
||||
|
||||
bool timersShown = _c.QuestTimersWindowVisible();
|
||||
w.Button(timersShown ? "Hide quest timers" : "Show quest timers", "q.timers", () => _c.SetQuestTimersWindow(!timersShown));
|
||||
|
|
@ -60,9 +138,15 @@ internal sealed partial class OracleView
|
|||
? $"{cat.RetailCount} retail quests + {cat.ServerCount} {cat.PackServer} quests"
|
||||
: $"{cat.RetailCount} retail quests");
|
||||
|
||||
// A Show filter left on a kind this server doesn't have (another server's character): all kinds.
|
||||
List<QuestKind> kinds = AvailableKinds();
|
||||
if (_qKind is QuestKind chosen && !kinds.Contains(chosen)) _qKind = null;
|
||||
bool ilt = kinds.Contains(QuestKind.Dynamic);
|
||||
|
||||
w.InputText("Search", "q.search", _questSearch, 64, s => { _questSearch = s; _questPage = 0; });
|
||||
w.Tooltip("Words to find in the quest's flag or name, e.g. \"kill task\". ");
|
||||
w.Tooltip("Words to find in a row: a quest's flag or name; a tracker's NPC, place, area, reward or notes. Also filters the quest bonus list.");
|
||||
w.Checkbox("Done", "q.done", _qDone, v => { _qDone = v; _questPage = 0; });
|
||||
w.Tooltip("Done quests; Legendary quests and stamps you have, markers found, guardians on cooldown.");
|
||||
w.SameLine();
|
||||
w.Checkbox("Not done", "q.notdone", _qNotDone, v => { _qNotDone = v; _questPage = 0; });
|
||||
w.SameLine();
|
||||
|
|
@ -83,18 +167,49 @@ internal sealed partial class OracleView
|
|||
w.Checkbox(_c.Catalog.PackServer + " only", "q.server", _qServer, v => { _qServer = v; _questPage = 0; });
|
||||
w.Tooltip($"Quests only {_c.Catalog.PackServer} has.");
|
||||
}
|
||||
|
||||
w.Checkbox("Trackers only", "q.trackers", _qTrackers, v =>
|
||||
{
|
||||
_qTrackers = v;
|
||||
if (v && _qKind == QuestKind.Quest) _qKind = null;
|
||||
_questPage = 0;
|
||||
});
|
||||
w.Tooltip("Only the trackers, with their status above the list: Legendary Key quests, exploration markers"
|
||||
+ (ilt ? ", Dynamic Stamps and the Temple guardians." : ".")
|
||||
+ (ilt ? "" : "\nDynamic Stamps and the Temple guardians show on Infinite Leaftide."));
|
||||
w.SameLine();
|
||||
var kindItems = new List<string>(kinds.Count + 1) { "Everything" };
|
||||
foreach (QuestKind k in kinds) kindItems.Add(KindNames[(int)k]);
|
||||
int kindIndex = _qKind is QuestKind sel ? kinds.IndexOf(sel) + 1 : 0;
|
||||
w.Combo("Show", "q.kind", kindIndex, kindItems, i =>
|
||||
{
|
||||
_qKind = i <= 0 || i > kinds.Count ? null : kinds[i - 1];
|
||||
if (_qKind == QuestKind.Quest) _qTrackers = false;
|
||||
_questPage = 0;
|
||||
});
|
||||
w.Tooltip("One kind of row, or everything this server has.");
|
||||
if (_qKind == QuestKind.Dynamic)
|
||||
{
|
||||
w.SameLine();
|
||||
var areaItems = new List<string>(DynamicStampList.Areas.Count + 1) { "All areas" };
|
||||
areaItems.AddRange(DynamicStampList.Areas);
|
||||
w.Combo("##dyarea", "dy.area", Math.Clamp(_dynArea, 0, areaItems.Count - 1), areaItems, v => { _dynArea = v; _questPage = 0; });
|
||||
}
|
||||
w.Combo("Sort", "q.sort", _questSort, QuestSorts, i => { _questSort = Math.Clamp(i, 0, QuestSorts.Length - 1); _questPage = 0; });
|
||||
|
||||
List<Quest> rows = QuestRows();
|
||||
if (_qTrackers || _qKind is QuestKind k2 && k2 != QuestKind.Quest) DrawTrackerSummary(w, kinds);
|
||||
|
||||
List<QuestRow> rows = QuestRows(kinds);
|
||||
w.Text($"{rows.Count} shown");
|
||||
w.SameLine(160f);
|
||||
_questPage = Pager(w, "q.page", _questPage, rows.Count, QuestPageSize, p => _questPage = p);
|
||||
|
||||
// A fixed-height list when the opened quest follows it; else it fills the page.
|
||||
bool selected = _questSel.Length > 0;
|
||||
w.BeginChild("q.list", 0f, selected ? QuestListHeightWithPanel : 0f, border: true);
|
||||
// A fixed-height list when something follows it (the opened row, the /qb list); else it fills the page.
|
||||
IltQuestBonusList? qb = ilt && !_qTrackers ? _c.Ilt.Profile.QuestBonus : null;
|
||||
bool selected = HasSelection();
|
||||
w.BeginChild("q.list", 0f, selected || qb != null ? QuestListHeightWithPanel : 0f, border: true);
|
||||
w.TextDisabled("*");
|
||||
w.Tooltip("Track: list the quest in the Quest Timers window.");
|
||||
w.Tooltip("Track: list the quest in the Quest Timers window. Trackers show their kind here instead (LEG, MRK, DYN, GRD).");
|
||||
w.SameLine(28f);
|
||||
w.TextDisabled("Done");
|
||||
w.SameLine(72f);
|
||||
|
|
@ -105,26 +220,38 @@ internal sealed partial class OracleView
|
|||
w.TextDisabled("Solves");
|
||||
w.SameLine(530f);
|
||||
w.TextDisabled("Rewards");
|
||||
w.Tooltip("What you recorded for the quest (click it to edit): %XP, %Lum, Coins, Trinkets, Medallions, Yellow/Red/Blue powder, MMDs (D), at Level.");
|
||||
w.Tooltip("What you recorded for a quest (click it to edit): %XP, %Lum, Coins, Trinkets, Medallions, Yellow/Red/Blue powder, MMDs (D), at Level.\n"
|
||||
+ "Trackers: a Legendary quest's luminance, a marker's location, a stamp's area, a guardian's next turn-in.");
|
||||
|
||||
DateTime now = _c.UtcNow;
|
||||
bool canTrack = _c.Book.Loaded;
|
||||
int start = _questPage * QuestPageSize;
|
||||
for (int i = start; i < rows.Count && i < start + QuestPageSize; i++)
|
||||
DrawQuestRow(w, rows[i], flags, now, canTrack);
|
||||
if (rows.Count == 0)
|
||||
w.TextDisabled(_qTracked ? "No tracked quests match. Tick * on a quest to track it." : "No rows match.");
|
||||
w.EndChild();
|
||||
|
||||
if (selected) DrawSelection(w);
|
||||
if (qb != null) DrawQuestBonus(w, qb);
|
||||
}
|
||||
|
||||
/// <summary>One list row: a quest (track, done, timer, solves, rewards) or a tracker (kind, status, its own columns).</summary>
|
||||
private void DrawQuestRow(UiWindow w, QuestRow r, QuestFlagStore flags, DateTime now, bool canTrack)
|
||||
{
|
||||
if (r.Kind == QuestKind.Quest)
|
||||
{
|
||||
Quest q = rows[i];
|
||||
Quest q = r.Q!;
|
||||
string flag = q.Flag;
|
||||
bool tracked = _c.Book.IsTracked(flag);
|
||||
w.ToggleButton("*", "q.t." + flag, tracked, () => { if (canTrack) _c.Book.ToggleTracked(flag); }, small: true);
|
||||
w.SameLine(28f);
|
||||
bool done = q.IsComplete(flags);
|
||||
DoneMark(w, done);
|
||||
DoneMark(w, r.Done);
|
||||
w.SameLine(72f);
|
||||
Quest row = q;
|
||||
w.Selectable(Cut(q.Label, 44), "q.r." + flag, flag == _questSel, () => SelectQuest(row), 290f);
|
||||
w.Selectable(Cut(q.Label, 44), "q.r." + flag, IsSelected(r), () => SelectRow(r), 290f);
|
||||
w.Tooltip(flag + "\nClick: opens it below and prints its texts in chat.");
|
||||
w.SameLine(370f);
|
||||
TimerText(w, q, flags, now, done);
|
||||
TimerText(w, q, flags, now, r.Done);
|
||||
string solves = q.SolvesText(flags);
|
||||
if (solves.Length > 0)
|
||||
{
|
||||
|
|
@ -138,11 +265,99 @@ internal sealed partial class OracleView
|
|||
w.Text(Cut(reward, 18));
|
||||
if (reward.Length > 18) w.Tooltip(reward);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (rows.Count == 0) w.TextDisabled(_qTracked ? "No tracked quests match. Tick * on a quest to track it." : "No quests match.");
|
||||
w.EndChild();
|
||||
|
||||
if (selected) DrawSelectedQuest(w);
|
||||
// A tracker: its kind tag where the * is, then its mark, label and columns.
|
||||
w.TextColored(UiColors.Gold, r.Kind switch
|
||||
{
|
||||
QuestKind.Legendary => "LEG",
|
||||
QuestKind.Marker => "MRK",
|
||||
QuestKind.Dynamic => "DYN",
|
||||
_ => "GRD",
|
||||
});
|
||||
w.SameLine(28f);
|
||||
TrackerMark(w, r);
|
||||
w.SameLine(72f);
|
||||
w.Selectable(Cut(r.Label, 44), "q.r." + r.Key, IsSelected(r), () => SelectRow(r), 290f);
|
||||
string tip = TrackerTooltip(r);
|
||||
if (tip.Length > 0) w.Tooltip(Cut(tip, 300));
|
||||
switch (r.Kind)
|
||||
{
|
||||
case QuestKind.Legendary:
|
||||
{
|
||||
LegendaryQuest l = r.L!;
|
||||
TimeSpan? left = l.TimeLeft(flags, now);
|
||||
w.SameLine(370f);
|
||||
if (left == null) w.TextColored(UiColors.Grey, "not done");
|
||||
else if (left.Value <= TimeSpan.Zero) w.TextColored(UiColors.Green, "ready");
|
||||
else w.TextColored(UiColors.Yellow, TimeText.Friendly(left.Value));
|
||||
if (l.Luminance > 0)
|
||||
{
|
||||
w.SameLine(530f);
|
||||
w.TextDisabled(TimeText.Number(l.Luminance) + " lum");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QuestKind.Guardian:
|
||||
{
|
||||
IltGuardianRow g = r.G!;
|
||||
w.SameLine(370f);
|
||||
w.TextColored(g.Ready ? UiColors.Green : g.Status == "Unknown" ? UiColors.Grey : UiColors.Yellow, Cut(g.Status, 14));
|
||||
w.SameLine(470f);
|
||||
w.Text("#" + g.Count);
|
||||
if (g.Eta.Length > 0)
|
||||
{
|
||||
w.SameLine(530f);
|
||||
w.TextDisabled(Cut(g.Eta, 18));
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// Markers and stamps: where they are.
|
||||
if (r.Group.Length > 0)
|
||||
{
|
||||
w.SameLine(530f);
|
||||
w.TextDisabled(Cut(r.Group, 18));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A tracker's done column: have / need, found / --, or a guardian's ready / wait.</summary>
|
||||
private static void TrackerMark(UiWindow w, QuestRow r)
|
||||
{
|
||||
switch (r.Kind)
|
||||
{
|
||||
case QuestKind.Marker:
|
||||
DoneMark(w, r.Done);
|
||||
break;
|
||||
case QuestKind.Guardian:
|
||||
// Done = turned in and on cooldown; not done = a turn-in is ready (or unknown).
|
||||
w.TextColored(r.Done ? UiColors.Yellow : UiColors.Green, r.Done ? "wait" : "ready");
|
||||
break;
|
||||
default:
|
||||
w.TextColored(r.Done ? UiColors.Green : UiColors.Red, r.Done ? "have" : "need");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A tracker row's hover text: its notes, hint or where it comes from.</summary>
|
||||
private static string TrackerTooltip(QuestRow r) => r.Kind switch
|
||||
{
|
||||
QuestKind.Legendary => r.L!.Note.Length > 0 ? $"{r.Group}: {r.L.Note}" : r.Group,
|
||||
QuestKind.Marker => r.M!.Hint,
|
||||
QuestKind.Dynamic => string.Join(" - ", Parts(r.D!.Area, r.D.Place, r.D.Reward.Length > 0 ? "gives " + r.D.Reward : "", r.D.Note)),
|
||||
QuestKind.Guardian => $"{r.G!.Npc}: {(r.G.Exact ? "from /myquests (exact)" : "from /qb wait stamps (count and timer are estimates)")}",
|
||||
_ => "",
|
||||
};
|
||||
|
||||
/// <summary>The non-empty strings, in order.</summary>
|
||||
private static List<string> Parts(params string[] items)
|
||||
{
|
||||
var list = new List<string>(items.Length);
|
||||
foreach (string s in items) if (!string.IsNullOrWhiteSpace(s)) list.Add(s);
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>The timer column: "ready" (green once done), a countdown, "N left" (yellow) or done (grey).</summary>
|
||||
|
|
@ -158,21 +373,341 @@ internal sealed partial class OracleView
|
|||
}
|
||||
}
|
||||
|
||||
// ── The opened quest and its rewards ──────────────────────────────────
|
||||
// ── Tracker status (above the list in Trackers only / one tracker kind) ──
|
||||
|
||||
/// <summary>
|
||||
/// A click opens the quest below the list (a second click closes it) and, as upstream's list
|
||||
/// does, prints its texts in chat: the info and hint, the wiki link and the flag's history.
|
||||
/// The trackers' status (what each old tab showed at its top), for the kinds the Show filter
|
||||
/// lists: John's Legendary counter, markers found and the next one, stamps had, and the Temple
|
||||
/// guardians' switches, last answer and hand-in.
|
||||
/// </summary>
|
||||
private void SelectQuest(Quest q)
|
||||
private void DrawTrackerSummary(UiWindow w, List<QuestKind> kinds)
|
||||
{
|
||||
QuestFlagStore flags = _c.Flags;
|
||||
bool Shows(QuestKind k) => kinds.Contains(k) && (_qKind == null || _qKind == k);
|
||||
|
||||
if (Shows(QuestKind.Legendary))
|
||||
{
|
||||
DateTime now = _c.UtcNow;
|
||||
int have = 0, ready = 0;
|
||||
foreach (LegendaryQuest q in LegendaryList.All)
|
||||
{
|
||||
TimeSpan? left = q.TimeLeft(flags, now);
|
||||
if (left == null) continue;
|
||||
have++;
|
||||
if (left.Value <= TimeSpan.Zero) ready++;
|
||||
}
|
||||
// John's own counter when the server has it; it counts every key quest, not just these.
|
||||
int? john = LegendaryList.JohnCount(flags);
|
||||
int shown = john ?? have;
|
||||
w.ProgressBar(Math.Min(1f, (float)shown / LegendaryList.JohnTarget), -1f, 0f,
|
||||
john != null
|
||||
? $"John: {john} / {LegendaryList.JohnTarget} legendary quests ({ready} ready to run again)"
|
||||
: $"{have} / {LegendaryList.JohnTarget} toward John, {ready} ready to run again");
|
||||
w.Tooltip("John in Arwic (33.6N 56.7E) rewards 30 different Legendary Key quests: 500,000 luminance and a 25-use Legendary Key.\n"
|
||||
+ "Bar: his counter (legendaryquestcounter_0913) when /myquests has it, else the Legendary quests you've done.");
|
||||
}
|
||||
|
||||
if (Shows(QuestKind.Marker))
|
||||
{
|
||||
int found = 0;
|
||||
Marker? next = null;
|
||||
foreach (Marker m in MarkerList.All)
|
||||
{
|
||||
if (m.IsFound(flags)) found++;
|
||||
else next ??= m;
|
||||
}
|
||||
w.ProgressBar(MarkerList.All.Count > 0 ? (float)found / MarkerList.All.Count : 0f, -1f, 0f, $"{found} / {MarkerList.All.Count} markers found");
|
||||
if (next != null)
|
||||
{
|
||||
Marker n = next;
|
||||
w.TextDisabled("Next marker:");
|
||||
w.SameLine();
|
||||
w.Selectable($"#{next.Number} {next.Name} ({next.Location})", "m.next", false, () => SelectRow(MarkerRow(n, flags, 0)));
|
||||
w.Tooltip("Opens it below the list (directions, RynthNav) and prints the directions in chat.");
|
||||
}
|
||||
}
|
||||
|
||||
if (Shows(QuestKind.Dynamic))
|
||||
{
|
||||
List<DynamicStamp> all = DynamicStampList.All;
|
||||
int have = 0;
|
||||
foreach (DynamicStamp s in all) if (s.Have(flags)) have++;
|
||||
int unlisted = DynamicStampList.Unlisted(flags).Count;
|
||||
w.ProgressBar(all.Count == 0 ? 0f : (float)have / all.Count, -1f, 0f,
|
||||
$"{have} / {all.Count} listed Dynamic stamps" + (unlisted > 0 ? $" (+{unlisted} not in the list)" : ""));
|
||||
w.Tooltip("Dynamic stamps are one-time quest flags (Dynamic_1_...) from handing items to NPCs on Infinite Leaftide.\n"
|
||||
+ "List: the players' ExtraDyn sheet. Click a stamp for RynthNav's route to it and the Parchment hand-in."
|
||||
+ (unlisted > 0 ? "\nStamps not in the sheet show as quests with Not in list." : ""));
|
||||
}
|
||||
|
||||
if (Shows(QuestKind.Guardian)) DrawGuardianControls(w);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Temple guardians' controls (RynthILT's Guardian window): chat detection, auto hand-in and
|
||||
/// buy-if-missing, which run inside RynthILT; the last answer with Hand in / Stop; and a refresh.
|
||||
/// </summary>
|
||||
private void DrawGuardianControls(UiWindow w)
|
||||
{
|
||||
IltGuardianView g = _c.Guardian;
|
||||
if (!g.Loaded)
|
||||
{
|
||||
w.TextDisabled(_c.IltData.Connected
|
||||
? "Temple guardians: this RynthILT is older than 0.3.3 (no guardian data for Oracle)."
|
||||
: "Temple guardians: RynthILT isn't loaded (it runs the riddles, hand-ins and turn-in tracker).");
|
||||
return;
|
||||
}
|
||||
int ready = 0;
|
||||
foreach (IltGuardianRow r in g.Rows) if (r.Ready) ready++;
|
||||
w.TextColored(UiColors.Gold, "Temple guardians");
|
||||
w.SameLine();
|
||||
w.TextDisabled($"{ready} of {g.Rows.Count} attribute turn-ins ready"
|
||||
+ (g.SyncedUtc == DateTime.MinValue ? ", /qb not read this session" : $", /qb read {g.SyncedUtc.ToLocalTime():HH:mm}"));
|
||||
w.SameLine();
|
||||
w.SmallButton("Refresh", "gd.refresh", () => _c.GuardianCommand(IltGuardianView.RefreshVerb()));
|
||||
w.Tooltip("RynthILT re-reads /myquests and /qb list for the turn-ins (the server allows each once a minute).");
|
||||
|
||||
w.Checkbox("Detect from chat", "gd.chat", g.Chat, v => _c.GuardianCommand(IltGuardianView.SwitchVerb("chat", v)));
|
||||
w.Tooltip("Translate the guardians' tells as they arrive and show the answer here.");
|
||||
w.SameLine();
|
||||
w.Checkbox("Auto hand-in", "gd.auto", g.Auto, v => _c.GuardianCommand(IltGuardianView.SwitchVerb("auto", v)));
|
||||
w.Tooltip("After a chat answer, RynthILT gives one of the item to the guardian automatically.");
|
||||
w.SameLine();
|
||||
w.Checkbox("Buy if missing", "gd.buy", g.Buy, v => _c.GuardianCommand(IltGuardianView.SwitchVerb("buy", v)));
|
||||
w.Tooltip("Temple guardian: when you carry none, RynthILT buys one from the open or nearest vendor first.");
|
||||
|
||||
bool recent = g.Answer.Length > 0 && g.AnswerAgeSec >= 0 && g.AnswerAgeSec < GuardianAnswerShownSec;
|
||||
if (recent || g.Running)
|
||||
{
|
||||
w.TextColored(UiColors.Green, g.Answer);
|
||||
if (g.Heard.Length > 0) w.Tooltip("Heard: " + Cut(g.Heard, 300));
|
||||
w.SameLine();
|
||||
w.TextDisabled("-> " + g.Npc);
|
||||
w.SameLine();
|
||||
if (g.Running) w.SmallButton("Stop", "gd.stop", () => _c.GuardianCommand(IltGuardianView.StopVerb()));
|
||||
else w.SmallButton("Hand in", "gd.handin", () => _c.GuardianCommand(IltGuardianView.HandInVerb()));
|
||||
}
|
||||
else w.TextDisabled("No guardian answer yet.");
|
||||
w.TextDisabled("Hand-in: " + g.Status + (_c.GuardianMessage.Length > 0 ? " - " + _c.GuardianMessage : ""));
|
||||
}
|
||||
|
||||
// ── The opened row ──────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Something is opened below the list.</summary>
|
||||
private bool HasSelection() => _selKind switch
|
||||
{
|
||||
QuestKind.Quest => _questSel.Length > 0,
|
||||
QuestKind.Dynamic => _dynNav != null,
|
||||
_ => _selKey.Length > 0,
|
||||
};
|
||||
|
||||
private bool IsSelected(QuestRow r) => r.Kind switch
|
||||
{
|
||||
QuestKind.Quest => _selKind == QuestKind.Quest && r.Q!.Flag == _questSel,
|
||||
QuestKind.Dynamic => _selKind == QuestKind.Dynamic && ReferenceEquals(r.D, _dynNav),
|
||||
_ => _selKind == r.Kind && _selKey == r.Key,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Clicking a row opens it below the list (a second click closes it). As before, a click on a
|
||||
/// quest prints its texts in chat (the info and hint, the wiki link and the flag's history) and
|
||||
/// a click on a marker prints its directions. A Dynamic Stamp also asks RynthNav for the route
|
||||
/// at once, as its tab did.
|
||||
/// </summary>
|
||||
private void SelectRow(QuestRow r)
|
||||
{
|
||||
if (r.Kind == QuestKind.Quest) _c.PrintQuest(r.Q!);
|
||||
else if (r.Kind == QuestKind.Marker) PrintMarker(r.M!);
|
||||
|
||||
bool same = IsSelected(r);
|
||||
_questSel = "";
|
||||
_dynNav = null;
|
||||
_selKey = "";
|
||||
_questStopIdx = 0;
|
||||
_questNavStatus = "";
|
||||
if (same) return;
|
||||
_selKind = r.Kind;
|
||||
switch (r.Kind)
|
||||
{
|
||||
case QuestKind.Quest:
|
||||
OpenQuest(r.Q!);
|
||||
break;
|
||||
case QuestKind.Dynamic:
|
||||
_selKey = r.Key;
|
||||
SelectDynamicStamp(r.D!, r.Done);
|
||||
break;
|
||||
default:
|
||||
_selKey = r.Key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Opens a quest below the list with its reward editor.</summary>
|
||||
private void OpenQuest(Quest q)
|
||||
{
|
||||
_c.PrintQuest(q);
|
||||
if (_questSel == q.Flag) { _questSel = ""; return; }
|
||||
_questSel = q.Flag;
|
||||
_rewardMsg = "";
|
||||
LoadRewardEdit(q.Flag);
|
||||
}
|
||||
|
||||
/// <summary>The opened row's panel: a quest, a Dynamic Stamp's nav box, a Legendary quest, a marker or a guardian.</summary>
|
||||
private void DrawSelection(UiWindow w)
|
||||
{
|
||||
switch (_selKind)
|
||||
{
|
||||
case QuestKind.Quest:
|
||||
DrawSelectedQuest(w);
|
||||
break;
|
||||
case QuestKind.Dynamic:
|
||||
DrawDynamicNavBox(w);
|
||||
break;
|
||||
case QuestKind.Legendary:
|
||||
LegendaryQuest? l = LegendaryList.All.Find(x => "lg:" + x.Name == _selKey);
|
||||
if (l != null) DrawSelectedLegendary(w, l);
|
||||
break;
|
||||
case QuestKind.Marker:
|
||||
Marker? m = MarkerList.All.Find(x => "mk:" + x.Number == _selKey);
|
||||
if (m != null) DrawSelectedMarker(w, m);
|
||||
break;
|
||||
case QuestKind.Guardian:
|
||||
IltGuardianRow? g = null;
|
||||
foreach (IltGuardianRow r in _c.Guardian.Rows)
|
||||
if ("gd:" + r.Attribute == _selKey) { g = r; break; }
|
||||
DrawSelectedGuardian(w, g);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSelectedLegendary(UiWindow w, LegendaryQuest l)
|
||||
{
|
||||
QuestFlagStore flags = _c.Flags;
|
||||
string status = l.Status(flags, _c.UtcNow);
|
||||
w.SeparatorText(Cut(l.Label, 60));
|
||||
w.TextDisabled("Area");
|
||||
w.SameLine(90f);
|
||||
w.Text(l.Group);
|
||||
w.TextDisabled("Flags");
|
||||
w.SameLine(90f);
|
||||
w.Text(Cut(string.Join(", ", l.Flags), 70));
|
||||
w.TextDisabled("Status");
|
||||
w.SameLine(90f);
|
||||
w.TextColored(status == "missing" ? UiColors.Red : status == "ready" ? UiColors.Green : UiColors.Yellow, status);
|
||||
if (l.Luminance > 0)
|
||||
{
|
||||
w.SameLine(260f);
|
||||
w.TextDisabled(TimeText.Number(l.Luminance) + " luminance");
|
||||
}
|
||||
if (l.Note.Length > 0) w.TextWrapped(Cut(l.Note, 600));
|
||||
DrawGoTo(w, StopsFor("lg:" + l.Name, () => NavTargets.Stops(l.Note)));
|
||||
w.Button("Print in chat", "lg.sel.print", () => PrintLegendary(l, status));
|
||||
w.Tooltip("The quest, its flags and status, the notes, wiki and video links.");
|
||||
w.SameLine();
|
||||
w.Button("Close", "lg.sel.close", () => _selKey = "");
|
||||
}
|
||||
|
||||
private void DrawSelectedMarker(UiWindow w, Marker m)
|
||||
{
|
||||
bool found = m.IsFound(_c.Flags);
|
||||
w.SeparatorText(Cut($"Marker {m.Number}: {m.Name}", 60));
|
||||
w.TextDisabled("Location");
|
||||
w.SameLine(90f);
|
||||
w.Text(m.Location);
|
||||
w.TextDisabled("Status");
|
||||
w.SameLine(90f);
|
||||
w.TextColored(found ? UiColors.Green : UiColors.Grey, found ? "found" : "not found yet");
|
||||
if (m.Hint.Length > 0) w.TextWrapped(Cut(m.Hint, 600));
|
||||
// Coordinates in the directions, else the location's name for RynthNav's Atlas.
|
||||
DrawGoTo(w, StopsFor("mk:" + m.Number, () =>
|
||||
{
|
||||
List<NavTargets.Stop> stops = NavTargets.Stops(m.Hint);
|
||||
if (stops.Count == 0 && m.Location.Length > 0) stops.Add(NavTargets.Place(m.Location));
|
||||
return stops;
|
||||
}));
|
||||
w.Button("Print in chat", "m.sel.print", () => PrintMarker(m));
|
||||
w.SameLine();
|
||||
w.Button("Close", "m.sel.close", () => _selKey = "");
|
||||
}
|
||||
|
||||
private void DrawSelectedGuardian(UiWindow w, IltGuardianRow? g)
|
||||
{
|
||||
if (g != null)
|
||||
{
|
||||
w.SeparatorText("Temple guardian: " + g.Attribute);
|
||||
w.TextDisabled("NPC");
|
||||
w.SameLine(90f);
|
||||
w.Text(g.Npc);
|
||||
w.TextDisabled("Turn-ins");
|
||||
w.SameLine(90f);
|
||||
w.Text(g.Count.ToString());
|
||||
w.TextDisabled("Status");
|
||||
w.SameLine(90f);
|
||||
w.TextColored(g.Ready ? UiColors.Green : g.Status == "Unknown" ? UiColors.Grey : UiColors.Yellow, g.Status);
|
||||
if (g.Eta.Length > 0)
|
||||
{
|
||||
w.SameLine(260f);
|
||||
w.TextDisabled("Next: " + g.Eta);
|
||||
}
|
||||
w.TextDisabled(g.Exact ? "From /myquests (exact)." : $"From /qb wait stamps: the count and timer are estimates (cooldown taken as {_c.Guardian.CooldownHours} h).");
|
||||
}
|
||||
else w.SeparatorText("Temple guardians");
|
||||
DrawGuardianControls(w);
|
||||
w.Button("Close", "gd.sel.close", () => _selKey = "");
|
||||
}
|
||||
|
||||
// ── Go to: the coordinates in the opened row's text, through RynthNav ──
|
||||
|
||||
private string _questStopsFor = "";
|
||||
private List<NavTargets.Stop> _questStops = new();
|
||||
private int _questStopIdx;
|
||||
private string _questNavStatus = "";
|
||||
|
||||
/// <summary>The opened row's stops, worked out once per row (<paramref name="key"/>).</summary>
|
||||
private List<NavTargets.Stop> StopsFor(string key, Func<List<NavTargets.Stop>> build)
|
||||
{
|
||||
if (_questStopsFor != key)
|
||||
{
|
||||
_questStopsFor = key;
|
||||
_questStops = build();
|
||||
}
|
||||
return _questStops;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Go to: one place is shown with Go / Route / Arrow; several get a picker first (picking one
|
||||
/// plans its route, as clicking a Dynamic Stamp does). Nothing without any.
|
||||
/// </summary>
|
||||
private void DrawGoTo(UiWindow w, List<NavTargets.Stop> stops)
|
||||
{
|
||||
if (stops.Count == 0) return;
|
||||
_questStopIdx = Math.Clamp(_questStopIdx, 0, stops.Count - 1);
|
||||
w.SeparatorText(stops.Count == 1 ? "Go to" : $"Go to ({stops.Count} places in these notes)");
|
||||
if (stops.Count == 1)
|
||||
w.Text(Cut(stops[0].Display, 80));
|
||||
else
|
||||
{
|
||||
var items = new List<string>(stops.Count);
|
||||
for (int i = 0; i < stops.Count; i++) items.Add($"{i + 1}. {Cut(stops[i].Display, 70)}");
|
||||
w.Combo("##q.nav.pick", "q.nav.pick", _questStopIdx, items, i =>
|
||||
{
|
||||
_questStopIdx = Math.Clamp(i, 0, stops.Count - 1);
|
||||
_questNavStatus = SendRynthNav("route", new[] { stops[_questStopIdx].Target });
|
||||
});
|
||||
w.Tooltip("The places the notes give coordinates for, in their order. Picking one plans RynthNav's route to it.");
|
||||
}
|
||||
NavTargets.Stop stop = stops[_questStopIdx];
|
||||
w.Button("Go (auto nav)", "q.nav.go", () => _questNavStatus = SendRynthNav("go", new[] { stop.Target }));
|
||||
w.Tooltip("RynthNav plans the route (walking, portals, recalls, a dungeon's entrance) and walks it.");
|
||||
w.SameLine();
|
||||
w.Button("Route", "q.nav.route", () => _questNavStatus = SendRynthNav("route", new[] { stop.Target }));
|
||||
w.Tooltip("Only plan it: RynthNav prints the steps in chat.");
|
||||
w.SameLine();
|
||||
w.Button("Arrow", "q.nav.arrow", () => _questNavStatus = SendRynthNav("arrow", new[] { stop.Target }));
|
||||
w.Tooltip("Only point RynthNav's arrow at it.");
|
||||
if (_questNavStatus.Length > 0) w.TextDisabled(_questNavStatus);
|
||||
}
|
||||
|
||||
// ── The opened quest and its rewards ──────────────────────────────────
|
||||
|
||||
/// <summary>Fills the editor from what is recorded (blank fields for zero).</summary>
|
||||
private void LoadRewardEdit(string flag)
|
||||
{
|
||||
|
|
@ -202,6 +737,7 @@ internal sealed partial class OracleView
|
|||
}
|
||||
string details = q.Details();
|
||||
if (details.Length > 0) w.TextWrapped(Cut(details, 600));
|
||||
DrawGoTo(w, StopsFor("q:" + q.Flag, () => NavTargets.Stops(q.Info + " - " + q.Hint)));
|
||||
|
||||
bool loaded = _c.Book.Loaded;
|
||||
bool tracked = _c.Book.IsTracked(q.Flag);
|
||||
|
|
@ -274,13 +810,61 @@ internal sealed partial class OracleView
|
|||
_rewardMsg = r.IsEmpty ? "Cleared." : "Saved: " + r.ShortSummary();
|
||||
}
|
||||
|
||||
// ── Quest bonus (/qb, Infinite Leaftide through RynthILT) ──────────────
|
||||
|
||||
private void DrawQuestBonus(UiWindow w, IltQuestBonusList qb)
|
||||
{
|
||||
string count = qb.Count >= 0 ? $" - count {TimeText.Number(qb.Count)}" : "";
|
||||
if (!w.CollapsingHeader($"Quest bonus (/qb){count}", "q.qb")) return;
|
||||
if (qb.Disabled)
|
||||
{
|
||||
w.TextDisabled("/qb is turned off on this server.");
|
||||
return;
|
||||
}
|
||||
w.Button("Load /qb list", "q.qb.load", () =>
|
||||
{
|
||||
if (!_c.Send("/ilt qb")) _c.Print("Log in first.");
|
||||
});
|
||||
w.Tooltip("RynthILT asks the server for your quest bonus list (the server allows once a minute).");
|
||||
w.SameLine();
|
||||
w.TextDisabled(qb.Generation == 0 && qb.Status == "not loaded" ? "Not loaded yet this session." : qb.Status);
|
||||
|
||||
string[] terms = _questSearch.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
QbList(w, "Incomplete", "q.qb.todo", qb.Incomplete, terms, UiColors.Yellow);
|
||||
QbList(w, "Completed", "q.qb.done", qb.Completed, terms, UiColors.Green);
|
||||
}
|
||||
|
||||
private static void QbList(UiWindow w, string label, string id, IReadOnlyList<string> items, string[] terms, uint color)
|
||||
{
|
||||
var shown = new List<string>();
|
||||
foreach (string s in items)
|
||||
if (MatchesAll(s, terms)) shown.Add(s);
|
||||
string counts = terms.Length > 0 ? $"{shown.Count} of {items.Count}" : items.Count.ToString();
|
||||
if (!w.CollapsingHeader($"{label} ({counts})", id)) return;
|
||||
for (int i = 0; i < shown.Count && i < QbShownMax; i++) w.TextColored(color, shown[i]);
|
||||
if (shown.Count > QbShownMax) w.TextDisabled($"... and {shown.Count - QbShownMax} more. Narrow them with Search.");
|
||||
if (shown.Count == 0) w.TextDisabled(items.Count == 0 ? "None." : "None match the search.");
|
||||
}
|
||||
|
||||
/// <summary>Every search word is in <paramref name="hay"/> (any case); no words = everything matches.</summary>
|
||||
private static bool MatchesAll(string hay, string[] terms)
|
||||
{
|
||||
foreach (string t in terms)
|
||||
if (hay.IndexOf(t, StringComparison.OrdinalIgnoreCase) < 0) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ── Rows ──────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>The filtered, sorted rows; rebuilt when the filter or data changed (or every 5 s for timers).</summary>
|
||||
private List<Quest> QuestRows()
|
||||
/// <summary>
|
||||
/// The filtered, sorted rows of every listed kind; rebuilt when the filter or data changed (or
|
||||
/// every 5 s for the timer sort).
|
||||
/// </summary>
|
||||
private List<QuestRow> QuestRows(List<QuestKind> kinds)
|
||||
{
|
||||
string key = $"{_questSearch}|{_qDone}{_qNotDone}{_qRepeatable}{_qOneTime}{_qNew}{_qServer}{_qTracked}{_qKill}|{_questSort}"
|
||||
+ $"|{_c.Flags.Revision}|{_c.Catalog.Revision}|{(_qTracked ? _c.Book.Revision : 0)}";
|
||||
+ $"|{_qTrackers}|{_qKind}|{_dynArea}|{string.Join(",", kinds)}"
|
||||
+ $"|{_c.Flags.Revision}|{_c.Catalog.Revision}|{(_qTracked ? _c.Book.Revision : 0)}|{_c.GuardianRevision}";
|
||||
bool timeSorted = _questSort == 4;
|
||||
if (key == _questKey && (!timeSorted || _c.NowMs - _questBuiltMs < 5000)) return _questRows;
|
||||
_questKey = key;
|
||||
|
|
@ -289,53 +873,138 @@ internal sealed partial class OracleView
|
|||
QuestFlagStore flags = _c.Flags;
|
||||
string[] terms = _questSearch.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
_questRows.Clear();
|
||||
foreach (Quest q in _c.Catalog.Quests)
|
||||
|
||||
// The Dynamic stamps the list matched: shown as stamp rows, not again as unknown quest flags.
|
||||
var stampFlags = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
if (kinds.Contains(QuestKind.Dynamic))
|
||||
foreach (DynamicStamp s in DynamicStampList.All)
|
||||
if (s.MatchedFlag(flags) is string f) stampFlags.Add(f);
|
||||
|
||||
if (KindListed(QuestKind.Quest, kinds))
|
||||
{
|
||||
if (_qNew && !q.IsNew) continue;
|
||||
if (_qServer && q.Server.Length == 0) continue;
|
||||
if (_qTracked && !_c.Book.IsTracked(q.Flag)) continue;
|
||||
if (_qKill && !(flags.TryGet(q.Flag, out QuestFlag kf) && QuestTimer.IsKillTask(kf))) continue;
|
||||
if (_qDone != _qNotDone && q.IsComplete(flags) != _qDone) continue;
|
||||
if (_qRepeatable != _qOneTime && q.IsRepeatable(flags) != _qRepeatable) continue;
|
||||
if (terms.Length > 0)
|
||||
foreach (Quest q in _c.Catalog.Quests)
|
||||
{
|
||||
string hay = q.Flag + " " + q.DisplayName;
|
||||
bool all = true;
|
||||
foreach (string t in terms)
|
||||
if (hay.IndexOf(t, StringComparison.OrdinalIgnoreCase) < 0) { all = false; break; }
|
||||
if (!all) continue;
|
||||
if (q.IsNew && stampFlags.Contains(q.Flag)) continue;
|
||||
if (_qNew && !q.IsNew) continue;
|
||||
if (_qServer && q.Server.Length == 0) continue;
|
||||
if (_qTracked && !_c.Book.IsTracked(q.Flag)) continue;
|
||||
if (_qKill && !(flags.TryGet(q.Flag, out QuestFlag kf) && QuestTimer.IsKillTask(kf))) continue;
|
||||
bool done = q.IsComplete(flags);
|
||||
if (_qDone != _qNotDone && done != _qDone) continue;
|
||||
if (_qRepeatable != _qOneTime && q.IsRepeatable(flags) != _qRepeatable) continue;
|
||||
if (!MatchesAll(q.Flag + " " + q.DisplayName, terms)) continue;
|
||||
_questRows.Add(new QuestRow { Kind = QuestKind.Quest, Key = q.Flag, Label = q.DisplayName, Done = done, Q = q });
|
||||
}
|
||||
_questRows.Add(q);
|
||||
}
|
||||
|
||||
// The quest-only filters (not in the list, server pack, kill tasks) leave the trackers out.
|
||||
if (!_qNew && !_qServer && !_qKill)
|
||||
{
|
||||
if (KindListed(QuestKind.Legendary, kinds))
|
||||
for (int i = 0; i < LegendaryList.All.Count; i++)
|
||||
{
|
||||
LegendaryQuest l = LegendaryList.All[i];
|
||||
var r = new QuestRow { Kind = QuestKind.Legendary, Key = "lg:" + l.Name, Label = l.Label, Group = l.Group, Order = i, Done = l.Have(flags), L = l };
|
||||
bool tracked = l.Flags.Length > 0 && _c.Book.IsTracked(l.Flags[0]);
|
||||
if (KeepTracker(r, repeatable: true, tracked, $"{l.Label} {l.Group} {l.Note} {string.Join(" ", l.Flags)}", terms)) _questRows.Add(r);
|
||||
}
|
||||
|
||||
if (KindListed(QuestKind.Marker, kinds))
|
||||
for (int i = 0; i < MarkerList.All.Count; i++)
|
||||
{
|
||||
QuestRow r = MarkerRow(MarkerList.All[i], flags, i);
|
||||
if (KeepTracker(r, repeatable: false, tracked: false, $"{r.Label} {r.M!.Location} {r.M.Hint}", terms)) _questRows.Add(r);
|
||||
}
|
||||
|
||||
if (KindListed(QuestKind.Dynamic, kinds))
|
||||
for (int i = 0; i < DynamicStampList.All.Count; i++)
|
||||
{
|
||||
DynamicStamp s = DynamicStampList.All[i];
|
||||
if (_dynArea > 0 && (_dynArea > DynamicStampList.Areas.Count || DynamicStampList.Areas[_dynArea - 1] != s.Area)) continue;
|
||||
var r = new QuestRow { Kind = QuestKind.Dynamic, Key = "dy:" + s.Stamp, Label = s.Label, Group = s.Area, Order = i, Done = s.Have(flags), D = s };
|
||||
if (KeepTracker(r, repeatable: false, tracked: false, $"{s.Npc} {s.Place} {s.Reward} {s.Area} {s.Stamp} {s.Note}", terms)) _questRows.Add(r);
|
||||
}
|
||||
|
||||
if (KindListed(QuestKind.Guardian, kinds))
|
||||
for (int i = 0; i < _c.Guardian.Rows.Count; i++)
|
||||
{
|
||||
IltGuardianRow g = _c.Guardian.Rows[i];
|
||||
var r = new QuestRow { Kind = QuestKind.Guardian, Key = "gd:" + g.Attribute, Label = g.Attribute + " (" + g.Npc + ")", Group = g.Npc, Order = i, Done = !g.Ready, G = g };
|
||||
if (KeepTracker(r, repeatable: true, tracked: false, $"{g.Attribute} {g.Npc} {g.Status}", terms)) _questRows.Add(r);
|
||||
}
|
||||
}
|
||||
|
||||
DateTime now = _c.UtcNow;
|
||||
Comparison<Quest> byFlag = (a, b) => string.CompareOrdinal(a.Flag, b.Flag);
|
||||
switch (_questSort)
|
||||
{
|
||||
case 1:
|
||||
_questRows.Sort((a, b) => Then(string.Compare(a.DisplayName, b.DisplayName, StringComparison.OrdinalIgnoreCase), a, b));
|
||||
_questRows.Sort((a, b) => Then(string.Compare(a.Label, b.Label, StringComparison.OrdinalIgnoreCase), a, b));
|
||||
break;
|
||||
case 2:
|
||||
_questRows.Sort((a, b) => Then(b.IsComplete(flags).CompareTo(a.IsComplete(flags)), a, b));
|
||||
_questRows.Sort((a, b) => Then(b.Done.CompareTo(a.Done), a, b));
|
||||
break;
|
||||
case 3:
|
||||
_questRows.Sort((a, b) => Then(a.IsComplete(flags).CompareTo(b.IsComplete(flags)), a, b));
|
||||
_questRows.Sort((a, b) => Then(a.Done.CompareTo(b.Done), a, b));
|
||||
break;
|
||||
case 4:
|
||||
_questRows.Sort((a, b) => Then(ReadyKey(a, flags, now).CompareTo(ReadyKey(b, flags, now)), a, b));
|
||||
_questRows.Sort((a, b) => Then(RowReadyKey(a, flags, now).CompareTo(RowReadyKey(b, flags, now)), a, b));
|
||||
break;
|
||||
case 5:
|
||||
_questRows.Sort((a, b) => Then(Solves(b, flags).CompareTo(Solves(a, flags)), a, b));
|
||||
_questRows.Sort((a, b) => Then(RowSolves(b, flags).CompareTo(RowSolves(a, flags)), a, b));
|
||||
break;
|
||||
default:
|
||||
_questRows.Sort(byFlag);
|
||||
_questRows.Sort((a, b) => Then(0, a, b));
|
||||
break;
|
||||
}
|
||||
return _questRows;
|
||||
|
||||
static int Then(int c, Quest a, Quest b) => c != 0 ? c : string.CompareOrdinal(a.Flag, b.Flag);
|
||||
// Ties: by kind (quests first), then quests by flag and trackers in their own list's order.
|
||||
static int Then(int c, QuestRow a, QuestRow b)
|
||||
{
|
||||
if (c != 0) return c;
|
||||
if (a.Kind != b.Kind) return a.Kind.CompareTo(b.Kind);
|
||||
return a.Kind == QuestKind.Quest ? string.CompareOrdinal(a.Key, b.Key) : a.Order.CompareTo(b.Order);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A marker's row (the list, and the summary's "Next marker").</summary>
|
||||
private static QuestRow MarkerRow(Marker m, QuestFlagStore flags, int order)
|
||||
=> new() { Kind = QuestKind.Marker, Key = "mk:" + m.Number, Label = $"#{m.Number} {m.Name}", Group = m.Location, Order = order, Done = m.IsFound(flags), M = m };
|
||||
|
||||
/// <summary>The filters a tracker row answers to: Tracked, Done / Not done, Repeatable / One-time and Search.</summary>
|
||||
private bool KeepTracker(QuestRow r, bool repeatable, bool tracked, string hay, string[] terms)
|
||||
{
|
||||
if (_qTracked && !tracked) return false;
|
||||
if (_qDone != _qNotDone && r.Done != _qDone) return false;
|
||||
if (_qRepeatable != _qOneTime && repeatable != _qRepeatable) return false;
|
||||
return MatchesAll(hay, terms);
|
||||
}
|
||||
|
||||
/// <summary>Ready soonest: held repeatable quests and Legendary quests by time left, ready guardians first; the rest after.</summary>
|
||||
private static double RowReadyKey(QuestRow r, QuestFlagStore flags, DateTime now)
|
||||
{
|
||||
switch (r.Kind)
|
||||
{
|
||||
case QuestKind.Quest:
|
||||
return ReadyKey(r.Q!, flags, now);
|
||||
case QuestKind.Legendary:
|
||||
TimeSpan? left = r.L!.TimeLeft(flags, now);
|
||||
return left == null ? double.MaxValue : Math.Max(0, left.Value.TotalSeconds);
|
||||
case QuestKind.Guardian:
|
||||
return r.G!.Ready ? 0 : double.MaxValue;
|
||||
default:
|
||||
return double.MaxValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Most solves: a repeatable quest's solves, a guardian's turn-ins.</summary>
|
||||
private static int RowSolves(QuestRow r, QuestFlagStore flags) => r.Kind switch
|
||||
{
|
||||
QuestKind.Quest => Solves(r.Q!, flags),
|
||||
QuestKind.Guardian => r.G!.Count,
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
/// <summary>Held repeatables by time left (ready ones first); everything else after them.</summary>
|
||||
private static double ReadyKey(Quest q, QuestFlagStore flags, DateTime now) =>
|
||||
flags.TryGet(q.Flag, out _) && (q.IsRepeatable(flags) || flags.TryGet(q.Flag, out QuestFlag f) && QuestTimer.IsKillTask(f))
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace RynthCore.Plugin.RynthOracle.Views;
|
|||
/// <summary>
|
||||
/// The Refresh button every page of the Oracle window starts with, and the status line beside it.
|
||||
/// What "refresh" means depends on where a page's data comes from:
|
||||
/// - data the server owns (quest flags, ConquestAC's bank and boards, Aelrynth's /top and /trial)
|
||||
/// - data the server owns (the quest flags)
|
||||
/// is asked for again with the same command the page always used, and the line waits for the
|
||||
/// reply;
|
||||
/// - data read from the game client (level, buffs, titles, fellowship) is re-read at once instead
|
||||
|
|
@ -33,13 +33,8 @@ internal sealed partial class OracleView
|
|||
private DateTime _refreshAtUtc, _refreshDoneUtc;
|
||||
private readonly Dictionary<string, long> _refreshSent = new();
|
||||
|
||||
/// <summary>The tab, plus the sub-page a tab has (Conquest's views, the boards), so a status line stays with its own page.</summary>
|
||||
private string RefreshScope(string tab) => tab switch
|
||||
{
|
||||
TabConquest => tab + _conquestView,
|
||||
TabBoards => tab + _aelrynthView + _conquestBoard,
|
||||
_ => tab,
|
||||
};
|
||||
/// <summary>The page a status line belongs to (each tab is one page).</summary>
|
||||
private static string RefreshScope(string tab) => tab;
|
||||
|
||||
private void DrawRefreshRow(UiWindow w, TabDef def)
|
||||
{
|
||||
|
|
@ -90,16 +85,6 @@ internal sealed partial class OracleView
|
|||
|
||||
private const string TooSoon = "That was just asked for; wait a few seconds before asking again.";
|
||||
|
||||
/// <summary>Sends one chat command (the page's own) and waits for <paramref name="state"/> to change.</summary>
|
||||
private RefreshResult Ask(string key, Func<long> state, Func<string> command)
|
||||
{
|
||||
if (CoolingDown(key)) return new RefreshResult(TooSoon);
|
||||
long before = state();
|
||||
string cmd = command();
|
||||
if (!_c.Send(cmd)) return new RefreshResult($"Couldn't send {cmd} (not in the world).");
|
||||
return new RefreshResult($"Sent {cmd}.", () => state() != before);
|
||||
}
|
||||
|
||||
/// <summary>/myquests (refused for 5 s after the last one); the line waits for the new flags.</summary>
|
||||
private RefreshResult RefreshQuests(string before = "")
|
||||
{
|
||||
|
|
@ -107,6 +92,8 @@ internal sealed partial class OracleView
|
|||
int rev = f.Revision;
|
||||
if (_c.RequestQuests()) return new RefreshResult(before + "Asked the server for your quest flags (/myquests).", () => f.Revision != rev);
|
||||
if (f.Loading) return new RefreshResult(before + "Your quest flags are already being read.", () => f.Revision != rev);
|
||||
int wait = f.ThrottleSecondsLeft(_c.NowMs);
|
||||
if (wait > 0) return new RefreshResult(before + $"The server answers one /myquests a minute; try again in {wait}s (the flags shown are kept).");
|
||||
return new RefreshResult(before + "Your quest flags were asked for a moment ago; wait a few seconds before asking again.");
|
||||
}
|
||||
|
||||
|
|
@ -137,6 +124,16 @@ internal sealed partial class OracleView
|
|||
return new RefreshResult("Re-read your buffs and dropped the spell timers that ran out. Timers on targets are learned from your casts.");
|
||||
}
|
||||
|
||||
/// <summary>The Pet Breeding tab: RynthILT appraises every essence again; the line waits for the new snapshot.</summary>
|
||||
private RefreshResult RefreshBreeding()
|
||||
{
|
||||
if (CoolingDown("breeding")) return new RefreshResult(TooSoon);
|
||||
object before = _c.Breeding;
|
||||
if (!_c.BreedingCommand(RynthCore.Plugin.Shared.IltBreedingView.RefreshVerb()))
|
||||
return new RefreshResult("RynthILT didn't take that (not loaded, or older than 0.3.1).");
|
||||
return new RefreshResult("Asked RynthILT to appraise your essences again.", () => !ReferenceEquals(_c.Breeding, before));
|
||||
}
|
||||
|
||||
private RefreshResult RefreshFellowship()
|
||||
{
|
||||
_c.Fellowship.Invalidate();
|
||||
|
|
@ -151,63 +148,4 @@ internal sealed partial class OracleView
|
|||
string pack = cat.PackServer.Length > 0 ? $" + {cat.ServerCount} {cat.PackServer}" : "";
|
||||
return new RefreshResult($"Reloaded the quest list ({cat.RetailCount} retail{pack}) and asked RynthCore which server this is.");
|
||||
}
|
||||
|
||||
private RefreshResult RefreshBoards()
|
||||
{
|
||||
if (_c.Server.Is(ServerTags.Conquest))
|
||||
{
|
||||
ConquestData cq = _c.Conquest;
|
||||
ConquestBoard b = cq.Boards[Math.Clamp(_conquestBoard, 0, cq.Boards.Count - 1)];
|
||||
return Ask("board" + b.Key, () => b.UpdatedUtc.Ticks, () => cq.RequestBoard(b, _c.NowMs));
|
||||
}
|
||||
AelrynthBoards a = _c.Boards;
|
||||
return _aelrynthView switch
|
||||
{
|
||||
1 => Ask("top me", () => a.Revision, () => a.RequestTop("me", _c.NowMs)),
|
||||
2 => Ask("trial", () => a.Revision, () => a.RequestTrial("", _c.NowMs)),
|
||||
_ => Ask("top " + _aelrynthBoardArg, () => a.Revision,
|
||||
() => a.RequestTop(a.BoardTitle.Length > 0 ? _aelrynthBoardArg : "", _c.NowMs)),
|
||||
};
|
||||
}
|
||||
|
||||
private string BoardsHelp()
|
||||
{
|
||||
if (_c.Server.Is(ServerTags.Conquest))
|
||||
{
|
||||
ConquestBoard b = _c.Conquest.Boards[Math.Clamp(_conquestBoard, 0, _c.Conquest.Boards.Count - 1)];
|
||||
return $"Sends {b.Command} and reads the reply.";
|
||||
}
|
||||
return _aelrynthView switch
|
||||
{
|
||||
1 => "Sends /top me and reads the reply.",
|
||||
2 => "Sends /trial and reads the dungeon list.",
|
||||
_ => "Sends /top (every board's leader), or asks again for the board that is open.",
|
||||
};
|
||||
}
|
||||
|
||||
private RefreshResult RefreshConquest()
|
||||
{
|
||||
ConquestData cq = _c.Conquest;
|
||||
switch (_conquestView)
|
||||
{
|
||||
case 0: return Ask("bank", () => cq.BankUtc.Ticks, () => cq.RequestBank(_c.NowMs));
|
||||
case 1: return Ask("augs", () => cq.AugsUtc.Ticks, () => cq.RequestAugs(_c.NowMs));
|
||||
case 2: return Ask("enl", () => cq.EnlUtc.Ticks, () => cq.RequestEnl(_c.NowMs));
|
||||
case 3:
|
||||
_c.RereadCharacter();
|
||||
return Ask("bonus", () => cq.BonusUtc.Ticks, () => cq.RequestBonus(_c.NowMs));
|
||||
case 4: return Ask("fship", () => cq.FshipUtc.Ticks, () => cq.RequestFships(_c.NowMs));
|
||||
default: return RefreshQuests();
|
||||
}
|
||||
}
|
||||
|
||||
private string ConquestHelp() => _conquestView switch
|
||||
{
|
||||
0 => "Sends /b and reads your balances.",
|
||||
1 => "Sends /augs and reads your advanced augmentations.",
|
||||
2 => "Sends /enl augs and reads your enlightenment augmentations.",
|
||||
3 => "Re-reads your level, and sends /bonus for the experience bonuses.",
|
||||
4 => "Sends /fship list and reads the fellowships looking for members.",
|
||||
_ => "Sends /myquests: the custom quests' status comes from your quest flags.",
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue