Advertisement
jarppaaja

TriunesWillPlugin

Sep 9th, 2019
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 11.42 KB | None | 0 0
  1. // https://www.ownedcore.com/forums/diablo-3/turbohud/turbohud-community-plugins/797748-int-extended-triuneswillplugin.html
  2. // https://pastebin.com/Mx628qDt
  3. // https://www.ownedcore.com/forums/diablo-3/turbohud/turbohud-community-plugins/797748-int-extended-triuneswillplugin-2.html (Very color blind person here XD)
  4. // TriunesWillPlugin
  5. // Ground Decorators & Timers for Triune's Will circles from Season 18 buff.
  6. // Additional Marker when you are in a circle (Thanks to JarJar & RNN !).
  7.  
  8. using System.Linq;
  9. using Turbo.Plugins.Default;
  10.  
  11. namespace Turbo.Plugins.Extended.Actors
  12. {
  13.     public class TriunesWillPlugin : BasePlugin, IInGameWorldPainter
  14.     {
  15.         public WorldDecoratorCollection LoveDecorator { get; set; }
  16.         public WorldDecoratorCollection DeterminationDecorator { get; set; }
  17.         public WorldDecoratorCollection CreationDecorator { get; set; }
  18.  
  19.         public WorldDecoratorCollection LoveInsideDecorator { get; set; }
  20.         public WorldDecoratorCollection DeterminationInsideDecorator { get; set; }
  21.         public WorldDecoratorCollection CreationInsideDecorator { get; set; }
  22.  
  23.         public float CircleRadius { get; set; }
  24.         public float InsideRadius { get; set; }
  25.  
  26.         public bool EnableLove { get; set; }
  27.         public bool EnableDetermination { get; set; }
  28.         public bool EnableCreation { get; set; }
  29.         public bool EnableInsideMarker { get; set; }
  30.  
  31.         public IFont DescriptionText1 { get; set; }
  32.         public IFont DescriptionText2 { get; set; }
  33.         public bool EnableDescription { get; set; }
  34.  
  35.         public TriunesWillPlugin()
  36.         {
  37.             Enabled = true;
  38.         }
  39.  
  40.         public override void Load(IController hud)
  41.         {
  42.             base.Load(hud);
  43.  
  44.  
  45.             EnableLove = true;      // Damage Circle
  46.             EnableCreation = true;  // CDR Circle
  47.             EnableDetermination = true; // RCR Circle
  48.  
  49.             EnableInsideMarker = true;  // Additional Circle Decorator when you are in it
  50.             EnableDescription = true;
  51.  
  52.             CircleRadius = 10.0f; // Change the radius of the circle decorator
  53.             InsideRadius = 10.0f; // Change the radius of the additional "inside marker"
  54.  
  55.             DescriptionText1 = Hud.Render.CreateFont("tahoma", 9f, 255, 255, 255, 255, false, false, 128, 0, 0, 0, true);
  56.             DescriptionText2 = Hud.Render.CreateFont("tahoma", 5f, 255, 255, 255, 255, false, false, 128, 0, 0, 0, true);
  57.  
  58.             LoveInsideDecorator = new WorldDecoratorCollection(
  59.                     new GroundCircleDecorator(Hud)
  60.                     {
  61.                         Brush = Hud.Render.CreateBrush(255, 150, 0, 0, -2, SharpDX.Direct2D1.DashStyle.Dash), // 220, 0, 64
  62.                     Radius = InsideRadius,
  63.                     }
  64.                     );
  65.  
  66.             CreationInsideDecorator = new WorldDecoratorCollection(
  67.                     new GroundCircleDecorator(Hud)
  68.                     {
  69.                         Brush = Hud.Render.CreateBrush(255, 0, 80, 150, -2, SharpDX.Direct2D1.DashStyle.Dash),
  70.                         Radius = InsideRadius,
  71.                     }
  72.                     );
  73.  
  74.             DeterminationInsideDecorator = new WorldDecoratorCollection(
  75.                     new GroundCircleDecorator(Hud)
  76.                     {
  77.                         Brush = Hud.Render.CreateBrush(255, 120, 80, 0, -2, SharpDX.Direct2D1.DashStyle.Dash), // Dark Blue 0, 64, 255 - Gold 164, 100, 32
  78.                     Radius = InsideRadius,
  79.                     }
  80.                     );
  81.  
  82.             LoveDecorator = new WorldDecoratorCollection(
  83.                     new GroundCircleDecorator(Hud)
  84.                     {
  85.                         Brush = Hud.Render.CreateBrush(255, 255, 0, 128, -2),
  86.                         Radius = CircleRadius,
  87.                     },
  88.                     new GroundLabelDecorator(Hud)
  89.                     {
  90.                         CountDownFrom = 7,
  91.                         TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 255, 96, 255, true, false, 128, 0, 0, 0, true),
  92.                     },
  93.                     new GroundTimerDecorator(Hud)
  94.                     {
  95.                         CountDownFrom = 7,
  96.                         BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  97.                         BackgroundBrushFill = Hud.Render.CreateBrush(164, 192, 0, 0, 0),
  98.                         Radius = 30,
  99.                     },
  100.                     new MapShapeDecorator(Hud)
  101.                     {
  102.                         ShapePainter = new CircleShapePainter(Hud),
  103.                         Brush = Hud.Render.CreateBrush(255, 255, 0, 128, -1f),
  104.                         ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
  105.                         Radius = CircleRadius - 2,
  106.                     }
  107.                     );
  108.  
  109.             CreationDecorator = new WorldDecoratorCollection(
  110.                     new GroundCircleDecorator(Hud)
  111.                     {
  112.                         Brush = Hud.Render.CreateBrush(255, 64, 200, 144, -2),
  113.                         Radius = CircleRadius,
  114.                     },
  115.                     new GroundLabelDecorator(Hud)
  116.                     {
  117.                         CountDownFrom = 7,
  118.                         TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 230, 196, true, false, 128, 0, 0, 0, true),
  119.                     },
  120.                     new GroundTimerDecorator(Hud)
  121.                     {
  122.                         CountDownFrom = 7,
  123.                         BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  124.                         BackgroundBrushFill = Hud.Render.CreateBrush(164, 0, 192, 192, 0),
  125.                         Radius = 30,
  126.                     },
  127.                     new MapShapeDecorator(Hud)
  128.                     {
  129.                         ShapePainter = new CircleShapePainter(Hud),
  130.                         Brush = Hud.Render.CreateBrush(255, 64, 200, 144, -1f),
  131.                         ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
  132.                         Radius = CircleRadius - 2,
  133.                     }
  134.                     );
  135.  
  136.             DeterminationDecorator = new WorldDecoratorCollection(
  137.                     new GroundCircleDecorator(Hud)
  138.                     {
  139.                         Brush = Hud.Render.CreateBrush(255, 164, 164, 32, -2), // Dark Blue 0, 64, 255
  140.                     Radius = CircleRadius,
  141.                     },
  142.                     new GroundLabelDecorator(Hud)
  143.                     {
  144.                         CountDownFrom = 7,
  145.                         TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 200, 200, 96, true, false, 128, 0, 0, 0, true), // Dark Blue 96, 96, 255
  146.                 },
  147.                     new GroundTimerDecorator(Hud)
  148.                     {
  149.                         CountDownFrom = 7,
  150.                         BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  151.                         BackgroundBrushFill = Hud.Render.CreateBrush(164, 164, 164, 0, 0), // Dark Blue 0, 0, 192
  152.                     Radius = 30,
  153.                     },
  154.                     new MapShapeDecorator(Hud)
  155.                     {
  156.                         ShapePainter = new CircleShapePainter(Hud),
  157.                         Brush = Hud.Render.CreateBrush(255, 164, 164, 32, -1f),
  158.                         ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
  159.                         Radius = CircleRadius - 2,
  160.                     }
  161.                     );
  162.  
  163.         }
  164.  
  165.         public void PaintWorld(WorldLayer layer)
  166.         {
  167.             if (Hud.Game.IsInTown)
  168.                 return;
  169.  
  170.             bool Inside = false;
  171.             float CoordX, CoordY;
  172.  
  173.             if (EnableLove)
  174.             {
  175.                 var love = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, 483606) == 1).OrderBy(d => d.CentralXyDistanceToMe);
  176.                 if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 2))
  177.                 { Inside = true; }
  178.                 foreach (var actor in love)
  179.                 {
  180.                     LoveDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  181.                     if (EnableDescription)
  182.                     {
  183.                         DescriptionText1.DrawText(DescriptionText1.GetTextLayout("DMG"), actor.FloorCoordinate.ToScreenCoordinate().X - 15, actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
  184.                         Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
  185.                         DescriptionText2.DrawText(DescriptionText2.GetTextLayout("DMG"), CoordX - 8, CoordY + 7);
  186.                     }
  187.                     if (Inside)
  188.                     { LoveInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
  189.                 }
  190.             }
  191.  
  192.             if (EnableCreation)
  193.             {
  194.                 var creation = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_7_Visual_Effect_None, 483606) == 1).OrderBy(d => d.CentralXyDistanceToMe);
  195.                 if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 8))
  196.                 { Inside = true; }
  197.                 foreach (var actor in creation)
  198.                 {
  199.                     CreationDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  200.                     if (EnableDescription)
  201.                     {
  202.                         DescriptionText1.DrawText(DescriptionText1.GetTextLayout("CDR"), actor.FloorCoordinate.ToScreenCoordinate().X - 15, actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
  203.                         Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
  204.                         DescriptionText2.DrawText(DescriptionText2.GetTextLayout("CDR"), CoordX - 8, CoordY + 7);
  205.                     }
  206.                     if (Inside)
  207.                     { CreationInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
  208.                 }
  209.             }
  210.  
  211.             if (EnableDetermination)
  212.             {
  213.                 var determination = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_6_Visual_Effect_None, 483606) == 1).OrderBy(d => d.CentralXyDistanceToMe);
  214.                 if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 5))
  215.                 { Inside = true; }
  216.                 foreach (var actor in determination)
  217.                 {
  218.                     DeterminationDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  219.                     if (EnableDescription)
  220.                     {
  221.                         DescriptionText1.DrawText(DescriptionText1.GetTextLayout("RCR"), actor.FloorCoordinate.ToScreenCoordinate().X - 15, actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
  222.                         Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
  223.                         DescriptionText2.DrawText(DescriptionText2.GetTextLayout("RCR"), CoordX - 8, CoordY + 7);
  224.                     }
  225.                     if (Inside)
  226.                     { DeterminationInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
  227.                 }
  228.             }
  229.  
  230.         }
  231.     }
  232. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement