Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using Turbo.Plugins;
- using Turbo.Plugins.Default;
- namespace Turbo.plugins.Vigil
- {
- internal sealed class WhereAreMyBuddies : BasePlugin, IInGameWorldPainter
- {
- private IBrush Line { get; set; }
- private IBrush Circle {get; set;}
- public WhereAreMyBuddies()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- }
- public void PaintWorld(WorldLayer layer)
- {
- var self = Hud.Game.Me;
- //if(!self.InGreaterRift)
- // 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;
- var heroClassDefinitionCode = otherPlayer.HeroClassDefinition.Code;
- var distance = selfLocation.XYZDistanceTo(otherLocation);
- var moment = System.DateTime.Now;
- if(distance >= 140)
- continue;
- switch (otherPlayer.HeroClassDefinition.Code)
- {
- case "monk":
- Line = Hud.Render.CreateBrush(255, 255, 200, 0, 4);
- Circle = Hud.Render.CreateBrush(255, 255, 200, 0, 12);
- break;
- case "demonhunter":
- Line =Hud.Render.CreateBrush(255, 43, 173, 0, 4);
- Circle = Hud.Render.CreateBrush(255, 43, 173, 0, 4);
- break;
- case "wizard":
- Line = Hud.Render.CreateBrush(255, 0, 57, 173, 4);
- Circle = Hud.Render.CreateBrush(255, 0, 57, 173, 12);
- break;
- case "barbarian":
- Line = Hud.Render.CreateBrush(255, 173, 0, 0, 4);
- Circle = Hud.Render.CreateBrush(255, 173, 0, 0, 4);
- break;
- case "necromancer":
- Line = Hud.Render.CreateBrush(255, 0, 150, 127, 4);
- Circle = Hud.Render.CreateBrush(255, 0, 150, 127, 4);
- break;
- case "witchdoctor":
- Line = Hud.Render.CreateBrush(255, 255, 200, 0, 4);
- Circle = Hud.Render.CreateBrush(255, 255, 200, 0, 4);
- break;
- case "crusader":
- Line =Hud.Render.CreateBrush(255, 255, 255, 255, 4);
- Circle = Hud.Render.CreateBrush(255, 255, 255, 255, 4);
- break;
- default:
- Line = Hud.Render.CreateBrush(255, 255, 0, 100, 4);
- Circle = Hud.Render.CreateBrush(255, 255, 0, 100, 4);
- break;
- }
- if(distance >= 10 && distance < 25)
- {
- Line.StrokeWidth = 3;
- }
- if(distance >= 25 && distance < 35)
- {
- Line.StrokeWidth = 5;
- }
- if(distance >= 35 && distance < 45)
- {
- Line.StrokeWidth = 7;
- }
- if(distance >= 45)
- {
- Line.StrokeWidth = 9;
- }
- Line.DrawLineWorld(otherLocation, selfLocation);
- Circle.DrawWorldEllipse(4, 20, otherLocation);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement