mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-27 19:09:18 +01:00
Add YesSoliciting
I didn't test this lol
This commit is contained in:
parent
171c281cca
commit
175651ac88
2 changed files with 109 additions and 0 deletions
|
|
@ -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),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
100
Dalamud/Fools/Plugins/YesSolicitingPlugin.cs
Normal file
100
Dalamud/Fools/Plugins/YesSolicitingPlugin.cs
Normal file
|
|
@ -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<string> firstNames;
|
||||
private readonly List<string> lastNames;
|
||||
|
||||
private long nextUpdate;
|
||||
|
||||
public YesSolicitingPlugin()
|
||||
{
|
||||
this.framework = Service<Framework>.Get();
|
||||
this.framework.Update += this.OnUpdate;
|
||||
|
||||
this.chatGui = Service<ChatGui>.Get();
|
||||
|
||||
var dataManager = Service<DataManager>.Get();
|
||||
var charaMakeName = dataManager.GetExcelSheet<CharaMakeName>()!;
|
||||
|
||||
this.firstNames = new List<string>();
|
||||
this.lastNames = new List<string>();
|
||||
|
||||
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<string>
|
||||
{
|
||||
// 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 ~-!<L>@#",
|
||||
"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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue