Advertisement
RNNCode

BKCursorOnMonster

Aug 8th, 2019 (edited)
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.04 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.RNN
  5. {
  6.     public class BKCursorOnMonster : BasePlugin, IInGameWorldPainter
  7.     {
  8.         public IFont TextFontR { get; set; }
  9.         public IFont TextFontG { get; set; }
  10.         public IBrush brush { get; set; }
  11.        
  12.         public WorldDecoratorCollection HitBoxDecorator { get; set; }
  13.         public WorldDecoratorCollection MiniMapDecorator { get; set; }
  14.         public WorldDecoratorCollection MiniMap2Decorator { get; set; }
  15.         public WorldDecoratorCollection PointerDecorator { get; set; }
  16.         public WorldDecoratorCollection Pointer2Decorator { get; set; }
  17.         public WorldDecoratorCollection Mira { get; set; }
  18.        
  19.        
  20.         public bool ShowInMiniMap { get; set; }
  21.         public bool ShowLineToMonster { get; set; }
  22.         public bool OnlyGR { get; set; }
  23.        
  24.         public BKCursorOnMonster()
  25.         {
  26.             Enabled = true;
  27.         }
  28.  
  29.         public override void Load(IController hud)
  30.         {
  31.             base.Load(hud);
  32.             ShowInMiniMap = true;
  33.             ShowLineToMonster = true;
  34.             OnlyGR = false;
  35.            
  36.             TextFontG = Hud.Render.CreateFont("tahoma", 10, 255, 0, 255, 0, false, false, 250, 0, 0, 0, true);
  37.             TextFontR = Hud.Render.CreateFont("tahoma", 9, 255, 255, 255, 0, false, false, 250, 0, 0, 0, true);
  38.  
  39.             brush = Hud.Render.CreateBrush(50, 255, 255, 220, 2, SharpDX.Direct2D1.DashStyle.Dash, SharpDX.Direct2D1.CapStyle.Flat, SharpDX.Direct2D1.CapStyle.Flat);
  40.            
  41.             HitBoxDecorator = new WorldDecoratorCollection(
  42.                 new GroundCircleDecorator(Hud)
  43.                 {
  44.                     Brush = Hud.Render.CreateBrush(150, 200, 200, 200, 1),
  45.                     Radius = -1
  46.                 },
  47.                 new GroundCircleDecorator(Hud)
  48.                 {
  49.                     Brush = Hud.Render.CreateBrush(50, 200, 200, 200, 0),
  50.                     Radius = -1
  51.                 }
  52.             );
  53.             Mira = new WorldDecoratorCollection(
  54.                 new GroundShapeDecorator(Hud)
  55.                 {
  56.                     Brush = Hud.Render.CreateBrush(150, 255, 0, 50, 3),
  57.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  58.                     ShapePainter = WorldStarShapePainter.NewCross(Hud),
  59.                     Radius = 4
  60.                 },
  61.                 new GroundCircleDecorator(Hud)
  62.                 {
  63.                     //Brush = Hud.Render.CreateBrush(255, 55, 255, 55, 4),
  64.                     Brush = Hud.Render.CreateBrush(255, 255, 0, 50, -3),
  65.                     Radius = -1
  66.                 }
  67.             );
  68.                
  69.             MiniMapDecorator = new WorldDecoratorCollection(
  70.                 new MapShapeDecorator(Hud)
  71.                 {
  72.                     Brush = Hud.Render.CreateBrush(180, 255, 255, 255, 1, SharpDX.Direct2D1.DashStyle.Dash, SharpDX.Direct2D1.CapStyle.Flat, SharpDX.Direct2D1.CapStyle.Flat),
  73.                     ShapePainter = new LineFromMeShapePainter(Hud),
  74.                     Radius = 2
  75.                 },
  76.                 new MapShapeDecorator(Hud)
  77.                 {
  78.                     Brush = Hud.Render.CreateBrush(180, 255, 55, 55, 1),
  79.                     ShapePainter = new PlusShapePainter(Hud),
  80.                     Radius = 8
  81.                 },            
  82.                 new MapShapeDecorator(Hud)
  83.                 {
  84.                     Brush = Hud.Render.CreateBrush(180, 255, 55, 55, 1),
  85.                     ShapePainter = new CircleShapePainter(Hud),
  86.                     Radius = 5
  87.                 }
  88.             );
  89.             MiniMap2Decorator = new WorldDecoratorCollection(
  90.                 new MapShapeDecorator(Hud)
  91.                 {
  92.                     Brush = Hud.Render.CreateBrush(180, 255, 255, 255, 1, SharpDX.Direct2D1.DashStyle.Dash, SharpDX.Direct2D1.CapStyle.Flat, SharpDX.Direct2D1.CapStyle.Flat),
  93.                     ShapePainter = new LineFromMeShapePainter(Hud),
  94.                     Radius = 2
  95.                 },
  96.                 new MapShapeDecorator(Hud)
  97.                 {
  98.                     Brush = Hud.Render.CreateBrush(180, 55, 255, 55, 1),
  99.                     ShapePainter = new PlusShapePainter(Hud),
  100.                     Radius = 8
  101.                 },            
  102.                 new MapShapeDecorator(Hud)
  103.                 {
  104.                     Brush = Hud.Render.CreateBrush(180, 55, 255, 55, 1),
  105.                     ShapePainter = new CircleShapePainter(Hud),
  106.                     Radius = 5
  107.                 }
  108.             );
  109.             PointerDecorator = new WorldDecoratorCollection(
  110.                 new GroundShapeDecorator(Hud)
  111.                 {
  112.                     Brush = Hud.Render.CreateBrush(180, 255, 55, 55, 2),
  113.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  114.                     ShapePainter = WorldStarShapePainter.NewCross(Hud),
  115.                     Radius = 0.5f
  116.                 },
  117.                 new GroundCircleDecorator(Hud)
  118.                 {
  119.                     Brush = Hud.Render.CreateBrush(180, 255, 55, 55, 2),
  120.                     Radius = 0.5f
  121.                 }
  122.             );
  123.             Pointer2Decorator = new WorldDecoratorCollection(
  124.                 new GroundShapeDecorator(Hud)
  125.                 {
  126.                     Brush = Hud.Render.CreateBrush(180, 55, 255, 55, 2),
  127.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  128.                     ShapePainter = WorldStarShapePainter.NewCross(Hud),
  129.                     Radius = 0.5f
  130.                 },
  131.                 new GroundCircleDecorator(Hud)
  132.                 {
  133.                     Brush = Hud.Render.CreateBrush(180, 55, 255, 55, 2),
  134.                     Radius = 0.5f
  135.                 }
  136.             );
  137.         }
  138.  
  139.  
  140.         public void PaintWorld(WorldLayer layer)
  141.         {
  142.             if (!Hud.Game.IsInGame || Hud.Game.IsInTown ) return;
  143.             if ( OnlyGR && (Hud.Game.SpecialArea != SpecialArea.GreaterRift) ) return;
  144.  
  145.             var cursorScreenCoord = Hud.Window.CreateScreenCoordinate(Hud.Window.CursorX, Hud.Window.CursorY);
  146.             var CursorCoord = cursorScreenCoord.ToWorldCoordinate();
  147.  
  148.             var monster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1;
  149.             if (monster == null)
  150.             {
  151.                 if (ShowInMiniMap) MiniMapDecorator.Paint(layer, Hud.Game.Me, CursorCoord, null);          
  152.                 if (ShowLineToMonster) brush.DrawLineWorld(Hud.Game.Me.FloorCoordinate,CursorCoord);   
  153.                 PointerDecorator.Paint(layer, Hud.Game.Me, CursorCoord, null);
  154.                 TextFontR.DrawText(Hud.Game.Me.FloorCoordinate.XYDistanceTo(CursorCoord).ToString("F1") + "y", cursorScreenCoord.Offset(-15, -30));
  155.             }
  156.             else if (monster.IsSelected)
  157.             {
  158.                 if ( (monster.SummonerAcdDynamicId == 0) && ((monster.Rarity == ActorRarity.Champion) || (monster.Rarity == ActorRarity.Rare) || (monster.Rarity == ActorRarity.Boss) ) )
  159.                 {                  
  160.                     Mira.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  161.                 }
  162.  
  163.                 if (ShowInMiniMap) MiniMap2Decorator.Paint(layer, Hud.Game.Me, CursorCoord, null);         
  164.                 if (ShowLineToMonster) brush.DrawLineWorld(Hud.Game.Me.FloorCoordinate,monster.FloorCoordinate);   
  165.                 HitBoxDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  166.                 Pointer2Decorator.Paint(layer, Hud.Game.Me, monster.FloorCoordinate, null);
  167.                 TextFontG.DrawText(monster.CentralXyDistanceToMe.ToString("F1") + "y", monster.FloorCoordinate.ToScreenCoordinate().Offset(-20, -30) );
  168.             }
  169.         }
  170.     }
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement