HaKache

TriunesWillPlugin

Aug 24th, 2019
1,416
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // TriunesWillPlugin
  2. // Ground Decorators & Timers for Triune's Will circles from Season 18 buff.
  3. // Additional Marker when you are in a circle (Thanks to JarJar & RNN !).
  4.  
  5. using System.Linq;
  6. using Turbo.Plugins.Default;
  7.  
  8. namespace Turbo.Plugins.Extended.Actors
  9. {
  10.     public class TriunesWillPlugin : BasePlugin, IInGameWorldPainter
  11.     {
  12.     public WorldDecoratorCollection LoveDecorator { get; set; }
  13.     public WorldDecoratorCollection DeterminationDecorator { get; set; }
  14.     public WorldDecoratorCollection CreationDecorator { get; set; }
  15.  
  16.     public WorldDecoratorCollection LoveInsideDecorator { get; set; }
  17.     public WorldDecoratorCollection DeterminationInsideDecorator { get; set; }
  18.     public WorldDecoratorCollection CreationInsideDecorator { get; set; }
  19.  
  20.     public float CircleRadius { get; set; }
  21.     public float InsideRadius { get; set; }
  22.  
  23.     public bool EnableLove { get; set; }
  24.     public bool EnableDetermination { get; set; }
  25.     public bool EnableCreation { get; set; }
  26.     public bool EnableInsideMarker { get; set; }
  27.  
  28.     public TriunesWillPlugin()
  29.         {
  30.         Enabled = true;
  31.  
  32.         EnableLove = true;      // Damage Circle
  33.         EnableCreation = true;  // CDR Circle
  34.         EnableDetermination = true; // RCR Circle
  35.  
  36.         EnableInsideMarker = true;  // Additional Circle Decorator when you are in it
  37.         }
  38.  
  39.     public override void Load(IController hud)
  40.         {
  41.         base.Load(hud);
  42.  
  43.         CircleRadius = 10.0f; // Change the radius of the circle decorator
  44.         InsideRadius = 10.0f; // Change the radius of the additional "inside marker"
  45.  
  46.         LoveInsideDecorator = new WorldDecoratorCollection(
  47.                 new GroundCircleDecorator(Hud)
  48.                 {
  49.                     Brush = Hud.Render.CreateBrush(255, 150, 0, 0, -2, SharpDX.Direct2D1.DashStyle.Dash), // 220, 0, 64
  50.                     Radius = InsideRadius,
  51.                 }
  52.                 );
  53.  
  54.         CreationInsideDecorator = new WorldDecoratorCollection(
  55.                 new GroundCircleDecorator(Hud)
  56.                 {
  57.                     Brush = Hud.Render.CreateBrush(255, 0, 80, 150, -2, SharpDX.Direct2D1.DashStyle.Dash),
  58.                     Radius = InsideRadius,
  59.                 }
  60.                 );
  61.  
  62.         DeterminationInsideDecorator = new WorldDecoratorCollection(
  63.                 new GroundCircleDecorator(Hud)
  64.                 {
  65.                     Brush = Hud.Render.CreateBrush(255, 120, 80, 0, -2, SharpDX.Direct2D1.DashStyle.Dash), // Dark Blue 0, 64, 255 - Gold 164, 100, 32
  66.                     Radius = InsideRadius,
  67.                 }
  68.                 );
  69.  
  70.         LoveDecorator = new WorldDecoratorCollection(
  71.                 new GroundCircleDecorator(Hud)
  72.                 {
  73.                     Brush = Hud.Render.CreateBrush(255, 255, 0, 128, -2),
  74.                     Radius = CircleRadius,
  75.                 },
  76.                 new GroundLabelDecorator(Hud)
  77.                 {
  78.                     CountDownFrom = 7,
  79.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 255, 96, 255, true, false, 128, 0, 0, 0, true),
  80.                 },
  81.                 new GroundTimerDecorator(Hud)
  82.                 {
  83.                     CountDownFrom = 7,
  84.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  85.                     BackgroundBrushFill = Hud.Render.CreateBrush(164, 192, 0, 0, 0),
  86.                     Radius = 30,
  87.                 }
  88.                 );
  89.  
  90.         CreationDecorator = new WorldDecoratorCollection(
  91.                 new GroundCircleDecorator(Hud)
  92.                 {
  93.                     Brush = Hud.Render.CreateBrush(255, 64, 200, 144, -2),
  94.                     Radius = CircleRadius,
  95.                 },
  96.                 new GroundLabelDecorator(Hud)
  97.                 {
  98.                     CountDownFrom = 7,
  99.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 230, 196, true, false, 128, 0, 0, 0, true),
  100.                 },
  101.                 new GroundTimerDecorator(Hud)
  102.                 {
  103.                     CountDownFrom = 7,
  104.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  105.                     BackgroundBrushFill = Hud.Render.CreateBrush(164, 0, 192, 192, 0),
  106.                     Radius = 30,
  107.                 }
  108.                 );
  109.  
  110.         DeterminationDecorator = new WorldDecoratorCollection(
  111.                 new GroundCircleDecorator(Hud)
  112.                 {
  113.                     Brush = Hud.Render.CreateBrush(255, 164, 164, 32, -2), // Dark Blue 0, 64, 255
  114.                     Radius = CircleRadius,
  115.                 },
  116.                 new GroundLabelDecorator(Hud)
  117.                 {
  118.                     CountDownFrom = 7,
  119.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 200, 200, 96, true, false, 128, 0, 0, 0, true), // Dark Blue 96, 96, 255
  120.                 },
  121.                 new GroundTimerDecorator(Hud)
  122.                 {
  123.                     CountDownFrom = 7,
  124.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
  125.                     BackgroundBrushFill = Hud.Render.CreateBrush(164, 164, 164, 0, 0), // Dark Blue 0, 0, 192
  126.                     Radius = 30,
  127.                 }
  128.                 );
  129.  
  130.         }
  131.  
  132.     public void PaintWorld(WorldLayer layer)
  133.         {
  134.         if (Hud.Game.IsInTown) return;
  135.  
  136.         bool Inside = false;
  137.            
  138.     if (EnableLove) {
  139.         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);
  140.         if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 2)) { Inside = true; }
  141.         foreach (var actor in love)
  142.         {
  143.         LoveDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  144.         if (Inside) { LoveInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
  145.         }
  146.     }
  147.  
  148.     if (EnableCreation) {
  149.             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);
  150.         if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 8)) { Inside = true; }
  151.             foreach (var actor in creation)
  152.             {
  153.         CreationDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  154.         if (Inside) { CreationInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
  155.             }
  156.     }
  157.  
  158.     if (EnableDetermination) {
  159.             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);
  160.         if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(483606, 5)) { Inside = true; }
  161.             foreach (var actor in determination)
  162.             {
  163.         DeterminationDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  164.         if (Inside) { DeterminationInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
  165.             }
  166.     }
  167.  
  168.  
  169.         }
  170.     }
  171. }
RAW Paste Data