Advertisement
zjqyf

GLQ_CursorOnMonster.cs

May 11th, 2018
2,402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.56 KB | None | 0 0
  1. using Turbo.Plugins.Default;
  2. namespace Turbo.Plugins.glq
  3. {
  4. public class GLQ_CursorOnMonster : BasePlugin, IInGameWorldPainter
  5. {
  6. public WorldDecoratorCollection TrashDecorator { get; set; }
  7. public WorldDecoratorCollection ChampionDecorator { get; set; }
  8. public WorldDecoratorCollection RareMinionDecorator { get; set; }
  9. public WorldDecoratorCollection RareDecorator { get; set; }
  10. public WorldDecoratorCollection UniqueDecorator { get; set; }
  11. public WorldDecoratorCollection BossDecorator { get; set; }
  12.  
  13. private float _radius = -1;
  14. public float Radius
  15. {
  16. get { return _radius; }
  17. set
  18. {
  19. if (value == _radius || value < -1)
  20. return;
  21.  
  22. _radius = value;
  23. InitDecorators();
  24. }
  25. }
  26.  
  27. public GLQ_CursorOnMonster()
  28. {
  29. Enabled = true;
  30. }
  31.  
  32. public override void Load(IController hud)
  33. {
  34. base.Load(hud);
  35. InitDecorators();
  36. }
  37.  
  38. public void PaintWorld(WorldLayer layer)
  39. {
  40. var monster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1;
  41. if (monster == null) return;
  42. if (monster.SummonerAcdDynamicId != 0 && monster.IsElite) return;
  43. if (!monster.Invisible && !monster.IsElite && (monster.SnoMonster.Priority != MonsterPriority.goblin) && (monster.SnoMonster.Priority != MonsterPriority.boss) && (monster.SnoMonster.Priority != MonsterPriority.keywarden))
  44. {
  45. TrashDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  46. }
  47. if (monster.Rarity == ActorRarity.Unique)
  48. {
  49. UniqueDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  50. }
  51. if (monster.SnoMonster.Priority == MonsterPriority.boss)
  52. {
  53. BossDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  54. }
  55. if (monster.Rarity == ActorRarity.Champion)
  56. {
  57. ChampionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  58. }
  59. if (monster.Rarity == ActorRarity.RareMinion)
  60. {
  61. RareMinionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  62. }
  63. if (monster.Rarity == ActorRarity.Rare)
  64. {
  65. RareDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  66. }
  67. if ((monster.Rarity == ActorRarity.Unique) && (monster.SnoMonster.Priority < MonsterPriority.keywarden))
  68. {
  69. UniqueDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  70. }
  71. if (monster.SnoMonster.Priority == MonsterPriority.boss)
  72. {
  73. BossDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
  74. }
  75. }
  76.  
  77. private void InitDecorators()
  78. {
  79. int stroke = (Radius == -1) ? 0 : 5;
  80.  
  81. var TrashGroundBrush = Hud.Render.CreateBrush(255, 200, 200, 200, stroke, SharpDX.Direct2D1.DashStyle.Dash);
  82. TrashDecorator = new WorldDecoratorCollection(
  83. new GroundCircleDecorator(Hud)
  84. {
  85. Brush = TrashGroundBrush,
  86. Radius = Radius,
  87. }
  88. );
  89.  
  90. var EliteChampionGroundBrush = Hud.Render.CreateBrush(255, 64, 128, 255, stroke, SharpDX.Direct2D1.DashStyle.Dash);
  91. ChampionDecorator = new WorldDecoratorCollection(
  92. new GroundCircleDecorator(Hud)
  93. {
  94. Brush = EliteChampionGroundBrush,
  95. Radius = Radius,
  96. }
  97. );
  98. var EliteMinionGroundBrush = Hud.Render.CreateBrush(255, 255, 216, 160, stroke, SharpDX.Direct2D1.DashStyle.Dash);
  99. RareMinionDecorator = new WorldDecoratorCollection(
  100. new GroundCircleDecorator(Hud)
  101. {
  102. Brush = EliteMinionGroundBrush,
  103. Radius = Radius,
  104. }
  105. );
  106. var EliteLeaderGroundBrush = Hud.Render.CreateBrush(255, 255, 148, 20, stroke, SharpDX.Direct2D1.DashStyle.Dash);
  107. RareDecorator = new WorldDecoratorCollection(
  108. new GroundCircleDecorator(Hud)
  109. {
  110. Brush = EliteLeaderGroundBrush,
  111. Radius = Radius,
  112. }
  113. );
  114. var EliteUniqueGroundBrush = Hud.Render.CreateBrush(255, 255, 140, 255, stroke, SharpDX.Direct2D1.DashStyle.Dash);
  115. UniqueDecorator = new WorldDecoratorCollection(
  116. new GroundCircleDecorator(Hud)
  117. {
  118. Brush = EliteUniqueGroundBrush,
  119. Radius = Radius,
  120. }
  121. );
  122. var BossGroundBrush = Hud.Render.CreateBrush(255, 255, 96, 0, stroke, SharpDX.Direct2D1.DashStyle.Dash);
  123. BossDecorator = new WorldDecoratorCollection(
  124. new GroundCircleDecorator(Hud)
  125. {
  126. Brush = BossGroundBrush,
  127. Radius = Radius,
  128. }
  129. );
  130. }
  131. }
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement