Advertisement
JackCeparou

SweepingWindStackWarningPlugin (Xenthalon)

Apr 2nd, 2017
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.93 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.Xenthalon
  5. {
  6.     public class SweepingWindStackWarningPlugin : BasePlugin, IInGameWorldPainter
  7.     {
  8.         public WorldDecoratorCollection RechargeWarningCircle { get; set; }
  9.         public WorldDecoratorCollection DrainedWarningCircle { get; set; }
  10.         public WorldDecoratorCollection PlayerWarningLabel { get; set; }
  11.         public string PlayerWarningLabelText { get; set; }
  12.         public bool EnableInTown { get; set; }
  13.  
  14.         public SweepingWindStackWarningPlugin()
  15.         {
  16.             Enabled = true;
  17.         }
  18.  
  19.         public override void Load(IController hud)
  20.         {
  21.             base.Load(hud);
  22.  
  23.             RechargeWarningCircle = new WorldDecoratorCollection(
  24.                 new GroundCircleDecorator(Hud)
  25.                 {
  26.                     Brush = Hud.Render.CreateBrush(255, 0, 0, 255, 10.0f),
  27.                     Radius = 5
  28.                 }
  29.             );
  30.  
  31.             DrainedWarningCircle = new WorldDecoratorCollection(
  32.                 new GroundCircleDecorator(Hud)
  33.                 {
  34.                     Brush = Hud.Render.CreateBrush(255, 255, 0, 0, 10.0f),
  35.                     Radius = 5
  36.                 }
  37.             );
  38.  
  39.             PlayerWarningLabel = new WorldDecoratorCollection(
  40.                 new GroundLabelDecorator(Hud)
  41.                 {
  42.                     TextFont = Hud.Render.CreateFont("tahoma", 13, 255, 255, 255, 0, true, false, 128, 0, 0, 0, true),
  43.                 }
  44.             );
  45.  
  46.             PlayerWarningLabel.Enabled = false;
  47.             PlayerWarningLabelText = "STACKS!";
  48.  
  49.             EnableInTown = false;
  50.         }
  51.  
  52.         public void PaintWorld(WorldLayer layer)
  53.         {
  54.             if (Hud.Game.IsInGame &&
  55.                 Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Monk &&     // if monk
  56.                 Hud.Game.Me.Powers.UsedSkills.Any(x => x.SnoPower.Sno == 96090) && // and has skill sweeping wind
  57.                 Hud.Game.Me.Powers.BuffIsActive(446562) &&                         // and has sunwoko 6p bonus
  58.                 (EnableInTown || (!EnableInTown && !Hud.Game.IsInTown)))
  59.             {
  60.                 IBuff sweepingWind = Hud.Game.Me.Powers.GetBuff(96090);
  61.  
  62.                 if (sweepingWind == null || !sweepingWind.Active)
  63.                 {
  64.                     DrainedWarningCircle.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, "");
  65.                     PlayerWarningLabel.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate.Offset(0, 0, 4), PlayerWarningLabelText);
  66.                 }
  67.                 else if (sweepingWind.IconCounts[0] < 2)
  68.                 {
  69.                     RechargeWarningCircle.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, "");
  70.                     PlayerWarningLabel.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate.Offset(0, 0, 4), PlayerWarningLabelText);
  71.                 }
  72.             }
  73.         }
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement