diff --git a/Dalamud/Fools/FoolsManager.cs b/Dalamud/Fools/FoolsManager.cs index 9d76b4f06..14f202e94 100644 --- a/Dalamud/Fools/FoolsManager.cs +++ b/Dalamud/Fools/FoolsManager.cs @@ -117,6 +117,15 @@ internal class FoolsManager : IDisposable, IServiceType RealAuthor = "Chirp", Type = typeof(CatBubblesPlugin), }, + new() + { + Name = "YesSoliciting", + InternalName = "YesSolicitingPlugin", + Description = "Summon annoying shout messages from beyond the rift.", + Author = "Anna", + RealAuthor = "NotNite", + Type = typeof(YesSolicitingPlugin), + }, }; } diff --git a/Dalamud/Fools/Plugins/YesSolicitingPlugin.cs b/Dalamud/Fools/Plugins/YesSolicitingPlugin.cs new file mode 100644 index 000000000..8058e7d87 --- /dev/null +++ b/Dalamud/Fools/Plugins/YesSolicitingPlugin.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using Dalamud.Data; +using Dalamud.Game; +using Dalamud.Game.Gui; +using Dalamud.Game.Text; +using Dalamud.Utility; +using Lumina.Excel.GeneratedSheets; + +namespace Dalamud.Fools.Plugins; + +public class YesSolicitingPlugin : IFoolsPlugin +{ + private readonly Framework framework; + private readonly ChatGui chatGui; + + private readonly List firstNames; + private readonly List lastNames; + + private long nextUpdate; + + public YesSolicitingPlugin() + { + this.framework = Service.Get(); + this.framework.Update += this.OnUpdate; + + this.chatGui = Service.Get(); + + var dataManager = Service.Get(); + var charaMakeName = dataManager.GetExcelSheet()!; + + this.firstNames = new List(); + this.lastNames = new List(); + + for (uint i = 0; i < charaMakeName.RowCount; i++) + { + var row = charaMakeName.GetRow(i); + if (row == null) + { + break; + } + + // moon cats best cats, fight me + var firstName = row.MiqoteMoonFemale.ToDalamudString().TextValue; + var lastName = row.MiqoteMoonLastname.ToDalamudString().TextValue; + + if (firstName.Trim() == string.Empty || lastName.Trim() == string.Empty) + { + break; + } + + this.firstNames.Add(firstName); + this.lastNames.Add(lastName); + } + } + + public void Dispose() + { + this.framework.Update -= this.OnUpdate; + } + + private void Emit() + { + var firstName = this.firstNames[Random.Shared.Next(0, this.firstNames.Count)]; + var lastName = this.lastNames[Random.Shared.Next(0, this.lastNames.Count)]; + + var messages = new List + { + // legally required to put "april fools" in each of these so someone doesn't go outing themselves + "//**goat2023;PLUGIN SELLING FAST AND CHEAP;20 MINUTE WAIT TIME;APRIL FOOLS JOKE;https://goatcorp.github.io/;**//", + "(GOATCORP.GITHUB.IO) Buy April Fools Joke, Cheap FFXIV Plugins, Fast shipping ~-!@#", + "Need plugins?|[GOATCORP.GITHUB.IO]|10mins Delivery time|CheapFast100%|[CODE:APRILFOOLS,2023%OFF]", + "GOATCORP.GITHUB.IO - 10min Delivery time - Cheap - Fast - 100% - CODE:APRILFOOLS,2023%OFF", + + "Like to ERP? Join our Extraordinary Raid Party today!", + "Bored? Hungry? Visit the Alternate Reality Plugins section today!", + "Need to protect your eyes from stingy bugs? Get BeeShade! Now with 39% less malware.", + "Selling iTomestone 14 Pro - has 0.5x mechanic zoom camera, /tell if interested", + "buying gf 10k gil", + }; + + var message = messages[Random.Shared.Next(0, messages.Count)]; + + this.chatGui.PrintChat(new XivChatEntry + { + Message = $"[YesSoliciting] {firstName} {lastName}: {message}", + Type = XivChatType.Shout, + }); + } + + private void OnUpdate(Framework fr) + { + var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); + if (now >= this.nextUpdate) + { + this.Emit(); + this.nextUpdate = now + (60 * 10); + } + } +}