Advertisement
Guest User

[V9.2] [MTO] Execute Indicator

a guest
Dec 2nd, 2020
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.43 KB | None | 0 0
  1. // Execute Indicator Plugin by MTO
  2. // v1.0.1
  3. // Shows an icon on minimap and world map for mobs that meet the threshold to be executed by you or any member in your party
  4. // Threshold is 18% for Early Grave, 15% for Unruned Frailty or Grim Scythe: Cursed Scythe, or 10% for Executioner
  5.  
  6. using Turbo.Plugins.Default;
  7. namespace Turbo.Plugins.MTO
  8.  
  9. {
  10.     public class LowHealthmonstersCircleplugin : BasePlugin, IInGameWorldPainter {
  11.  
  12.         public WorldDecoratorCollection LowHealthDecorator { get; set; }
  13.         public WorldDecoratorCollection LowHealthDecoratorFifteen { get; set; }
  14.         public WorldDecoratorCollection LowHealthDecoratorTen { get; set; }
  15.  
  16.         public float LowHealthDecoratorRadius { get; set; }
  17.         public LowHealthmonstersCircleplugin () {
  18.             Enabled = true;
  19.         }
  20.  
  21.         public override void Load (IController hud) {
  22.             base.Load (hud);
  23.             LowHealthDecoratorRadius = 1.25f;
  24.             LowHealthDecorator = new WorldDecoratorCollection (
  25.                 new GroundLabelDecorator (Hud) {
  26.                     TextFont = Hud.Render.CreateFont ("tahoma", 7, 255, 255, 255, 255, true, false, false)
  27.                 },
  28.                 new MapLabelDecorator (Hud) {
  29.                     LabelFont = Hud.Render.CreateFont ("tahoma", 7, 255, 255, 255, 255, true, false, false),
  30.                 },
  31.                 new GroundCircleDecorator (Hud) {
  32.                     Brush = Hud.Render.CreateBrush (255, 175, 0, 0, -12.5f),
  33.                         Radius = .1f
  34.                 }
  35.             );
  36.         }
  37.  
  38.         public void PaintWorld (WorldLayer layer) {
  39.             var executeType = "";
  40.             var monsters = Hud.Game.AliveMonsters;
  41.             foreach (var p in Hud.Game.Players) {
  42.                 var skills = p.Powers.CurrentSkills;
  43.                 foreach (var s in skills) {
  44.                     if (s.SnoPower.NameEnglish == "Frailty") {
  45.                         if (s.RuneNameEnglish == "Early Grave") {
  46.                             executeType = "FrailtyEarlyGrave";
  47.                         } else if (s.RuneNameEnglish != "Early Grave" && !executeType.Contains ("EarlyGrave")) {
  48.                             executeType = "Frailty";
  49.                         }
  50.                     }
  51.                     if (s.RuneNameEnglish == "Cursed Scythe" && !executeType.Contains ("Frailty")) {
  52.                         executeType = "Frailty";
  53.                     }
  54.                 }
  55.                 if (p.Powers.BuffIsActive (483516) && !executeType.Contains ("Frailty")) {
  56.                     executeType = "Executioner";
  57.                 }
  58.             };
  59.             if (executeType != "") {
  60.                 foreach (var monster in monsters) {
  61.                     var threshold = 0;
  62.                     switch (executeType) {
  63.                         case "Executioner":
  64.                             threshold = 10;
  65.                             break;
  66.                         case "Frailty":
  67.                             threshold = 15;
  68.                             break;
  69.                         case "FrailtyEarlyGrave":
  70.                             threshold = 18;
  71.                             break;
  72.                     }
  73.  
  74.                     if (monster.CurHealth / monster.MaxHealth * 100 <= threshold) {
  75.                         LowHealthDecorator.Paint (layer, monster, monster.FloorCoordinate, "💀");
  76.                     }
  77.  
  78.                 }
  79.             }
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement