Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Linq;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.Xenthalon
- {
- public class SweepingWindStackWarningPlugin : BasePlugin, IInGameWorldPainter
- {
- public WorldDecoratorCollection RechargeWarningCircle { get; set; }
- public WorldDecoratorCollection DrainedWarningCircle { get; set; }
- public WorldDecoratorCollection PlayerWarningLabel { get; set; }
- public string PlayerWarningLabelText { get; set; }
- public bool EnableInTown { get; set; }
- public SweepingWindStackWarningPlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- RechargeWarningCircle = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 0, 0, 255, 10.0f),
- Radius = 5
- }
- );
- DrainedWarningCircle = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 255, 0, 0, 10.0f),
- Radius = 5
- }
- );
- PlayerWarningLabel = new WorldDecoratorCollection(
- new GroundLabelDecorator(Hud)
- {
- TextFont = Hud.Render.CreateFont("tahoma", 13, 255, 255, 255, 0, true, false, 128, 0, 0, 0, true),
- }
- );
- PlayerWarningLabel.Enabled = false;
- PlayerWarningLabelText = "STACKS!";
- EnableInTown = false;
- }
- public void PaintWorld(WorldLayer layer)
- {
- if (Hud.Game.IsInGame &&
- Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Monk && // if monk
- Hud.Game.Me.Powers.UsedSkills.Any(x => x.SnoPower.Sno == 96090) && // and has skill sweeping wind
- Hud.Game.Me.Powers.BuffIsActive(446562) && // and has sunwoko 6p bonus
- (EnableInTown || (!EnableInTown && !Hud.Game.IsInTown)))
- {
- IBuff sweepingWind = Hud.Game.Me.Powers.GetBuff(96090);
- if (sweepingWind == null || !sweepingWind.Active)
- {
- DrainedWarningCircle.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, "");
- PlayerWarningLabel.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate.Offset(0, 0, 4), PlayerWarningLabelText);
- }
- else if (sweepingWind.IconCounts[0] < 2)
- {
- RechargeWarningCircle.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, "");
- PlayerWarningLabel.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate.Offset(0, 0, 4), PlayerWarningLabelText);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement