Advertisement
Guest User

SweepingWindStackWarningPlugin

a guest
Nov 15th, 2017
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.99 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.                     Brush = Hud.Render.CreateBrush(255, 0, 0, 255, 10.0f),
  26.                     Radius = 5
  27.                 }
  28.             );
  29.  
  30.             DrainedWarningCircle = new WorldDecoratorCollection(
  31.                 new GroundCircleDecorator(Hud)
  32.                 {
  33.                     Brush = Hud.Render.CreateBrush(255, 255, 0, 0, 10.0f),
  34.                     Radius = 5
  35.                 }
  36.             );
  37.  
  38.             PlayerWarningLabel = new WorldDecoratorCollection(
  39.                 new GroundLabelDecorator(Hud)
  40.                 {
  41.                     TextFont = Hud.Render.CreateFont("tahoma", 13, 255, 255, 255, 0, true, false, 128, 0, 0, 0, true),
  42.                 }
  43.             );
  44.  
  45.             PlayerWarningLabel.Enabled = false;
  46.             PlayerWarningLabelText = "STACKS!";
  47.  
  48.             EnableInTown = false;
  49.         }
  50.  
  51.         public void PaintWorld(WorldLayer layer)
  52.         {
  53.             if (Hud.Game.IsInGame &&
  54.                 Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Monk &&     // if monk
  55.                 Hud.Game.Me.Powers.UsedSkills.Any(x => x.SnoPower.Sno == Hud.Sno.SnoPowers.Monk_SweepingWind.Sno) && // and has skill sweeping wind
  56.                 //Hud.Game.Me.Powers.BuffIsActive(446562) &&                         // and has sunwoko 6p bonus
  57.                 (EnableInTown || (!EnableInTown && !Hud.Game.IsInTown)))
  58.             {
  59.                 IBuff sweepingWind = Hud.Game.Me.Powers.GetBuff(Hud.Sno.SnoPowers.Monk_SweepingWind.Sno);
  60.  
  61.                 if (sweepingWind == null || !sweepingWind.Active)
  62.                 {
  63.                     DrainedWarningCircle.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, "");
  64.                     PlayerWarningLabel.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate.Offset(0, 0, 4), PlayerWarningLabelText);
  65.                 }
  66.                 else if (sweepingWind.IconCounts[0] < 2)
  67.                 {
  68.                     RechargeWarningCircle.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, "");
  69.                     PlayerWarningLabel.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate.Offset(0, 0, 4), PlayerWarningLabelText);
  70.                 }
  71.             }
  72.         }
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement