A friend of mine has recently switched to zDPS monk and after many hours of grind he started having trouble keeping track of where his teammates are.
So here are some hot pink lines drawn between you and your teammates.
Code:
using System;
using System.Linq;
using Turbo.Plugins;
using Turbo.Plugins.Default;
namespace Turbo.plugins.Roast
{
internal sealed class TeammateTrails : BasePlugin, IInGameWorldPainter
{
private const float DistanceThreshold = 50.0F;
private const bool Debug = false;
private const bool DistanceBased = true;
private IBrush LineDrawing { get; set; }
private WorldDecoratorCollection DebugDrawing { get; set; }
public TeammateTrails()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
LineDrawing = Hud.Render.CreateBrush(255, 255, 105, 180, 10);
DebugDrawing = new WorldDecoratorCollection(
new GroundLabelDecorator(Hud)
{
TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 105, 180, false, false, false)
});
}
public void PaintWorld(WorldLayer layer)
{
var self = Hud.Game.Me;
if(self.IsInTown)
return;
if (Hud.Game.NumberOfPlayersInGame <= 1)
return;
var otherPlayers = Hud.Game.Players.Where(p => !p.IsMe && p.CoordinateKnown);
var selfLocation = self.FloorCoordinate;
foreach(var otherPlayer in otherPlayers)
{
var otherLocation = otherPlayer.FloorCoordinate;
if (DistanceBased)
{
var distance = selfLocation.XYZDistanceTo(otherLocation);
if(Debug)
{
DebugDrawing.Paint(layer, otherPlayer, otherLocation, $"Distance: {distance}");
}
if(distance >= DistanceThreshold)
continue;
}
LineDrawing.DrawLineWorld(otherLocation, selfLocation);
}
}
}
}