Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // BoneSpiritPlugin by HaKache
- // Draw a line on minimap & world screen and a label showing the distance between Bosses and Bone Spirit Necromancer.
- using SharpDX.DirectInput;
- using System.Linq;
- using System;
- using System.Collections.Generic;
- using Turbo.Plugins.Default;
- using System.Text;
- namespace Turbo.Plugins.Extended.Widgets
- {
- public class BoneSpiritPlugin : BasePlugin, IInGameWorldPainter
- {
- public WorldDecoratorCollection YardIndicator { get; set; }
- public WorldDecoratorCollection LineIndicator { get; set; }
- private IBrush OrangeLineDrawing { get; set; }
- public bool OnlyGR { get; set; }
- public BoneSpiritPlugin()
- {
- Enabled = true;
- OnlyGR = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- YardIndicator = new WorldDecoratorCollection(
- new GroundLabelDecorator(Hud) {
- BackgroundBrush = Hud.Render.CreateBrush(200, 0, 0, 0, 0),
- BorderBrush = Hud.Render.CreateBrush(128, 90, 75, 60, 2),
- TextFont = Hud.Render.CreateFont("tahoma", 8f, 255, 255, 50, 50, true, false, false),
- });
- LineIndicator = new WorldDecoratorCollection(
- new MapShapeDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(192, 255, 50, 50, -1),
- ShapePainter = new LineFromMeShapePainter(Hud),
- });
- OrangeLineDrawing = Hud.Render.CreateBrush(225, 242, 40, 40, 4, SharpDX.Direct2D1.DashStyle.Dash);
- }
- public void PaintWorld(WorldLayer layer)
- {
- if ((OnlyGR) && (Hud.Game.Me.InGreaterRiftRank == 0)) return;
- // Yards Indicator if there is a necromancer w/ Stricken Gem and Bone Spirit Skill equipped
- var SpiritNecroIG = Hud.Game.Players.FirstOrDefault(p => (p.HasValidActor && p.Powers.BuffIsActive(428348, 0) && p.Powers.UsedSkills.Any(s => s.SnoPower.Sno == Hud.Sno.SnoPowers.Necromancer_BoneSpirit.Sno)));
- if (SpiritNecroIG != null && SpiritNecroIG == Hud.Game.Me) {
- var markers = Hud.Game.Markers.OrderBy(i => Hud.Game.Me.FloorCoordinate.XYDistanceTo(i.FloorCoordinate));
- if (markers != null)
- {
- foreach (var marker in markers)
- {
- if (marker.SnoActor != null && marker.SnoActor.Code.Contains("_Boss_")) {
- var DistYards = (int)(marker.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate));
- if (DistYards > 40) {
- YardIndicator.Paint(layer, null, Hud.Game.Me.FloorCoordinate.Offset(0, 0, 10f), DistYards.ToString()); // We draw a label w/ the yards on us
- LineIndicator.Paint(layer, null, marker.FloorCoordinate, null); // We draw a minimap line to the boss
- OrangeLineDrawing.DrawLineWorld(Hud.Game.Me.FloorCoordinate, marker.FloorCoordinate.Offset(0, 0, -8f)); // We draw a world line to the boss
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement