diff --git a/Dalamud/Fools/FoolsManager.cs b/Dalamud/Fools/FoolsManager.cs index 14f202e94..9fa10b0e9 100644 --- a/Dalamud/Fools/FoolsManager.cs +++ b/Dalamud/Fools/FoolsManager.cs @@ -95,7 +95,7 @@ internal class FoolsManager : IDisposable, IServiceType Name = "Oops, Maybe Lalafells!", InternalName = "OopsMaybeLalafellsPlugin", Description = "Turn everyone into Lalafells? Maybe. We haven't quite tested it yet.", - Author = "Chrip", + Author = "Chirpopo Chirpo", RealAuthor = "Chirp", Type = typeof(OopsMaybeLalafells), }, @@ -126,6 +126,15 @@ internal class FoolsManager : IDisposable, IServiceType RealAuthor = "NotNite", Type = typeof(YesSolicitingPlugin), }, + new() + { + Name = "Good Vibes", + InternalName = "GoodVibesPlugin", + Description = "Shake things up with this vibe plugin!", + Author = "C h i r p", + RealAuthor = "Chirp", + Type = typeof(GoodVibesPlugin), + }, }; } diff --git a/Dalamud/Fools/Plugins/GoodVibesPlugin.cs b/Dalamud/Fools/Plugins/GoodVibesPlugin.cs new file mode 100644 index 000000000..aff2a0182 --- /dev/null +++ b/Dalamud/Fools/Plugins/GoodVibesPlugin.cs @@ -0,0 +1,46 @@ +using System; +using System.Numerics; + +using Dalamud.Game; +using Dalamud.Hooking; + +namespace Dalamud.Fools.Plugins +{ + public class GoodVibesPlugin : IFoolsPlugin + { + // Plugin + + public GoodVibesPlugin() + { + var addr = Service.Get().ScanText("48 83 EC 08 8B 02"); + OffsetModelHook = Hook.FromAddress(addr, OffsetModelDetour); + OffsetModelHook.Enable(); + } + + public void Dispose() + { + OffsetModelHook.Disable(); + OffsetModelHook.Dispose(); + } + + // brrrrrrrr + + private readonly Random Rng = new(); + + private Vector3 GenRandVec() + { + var Pos = new float[3]; + for (var i = 0; i < 3; i++) + Pos[i] = Rng.Next(-5, 5) / 1000f; + return new Vector3(Pos); + } + + private delegate nint OffsetModelDelegate(nint a1, nint a2); + private Hook OffsetModelHook = null!; + private unsafe nint OffsetModelDetour(nint a1, nint a2) + { + *(Vector3*)a2 += GenRandVec(); + return OffsetModelHook.Original(a1, a2); + } + } +}