Guest User

StarpactcirclePlugin

a guest
Aug 22nd, 2018
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.71 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.Stone
  5. {
  6.     public class StarpactcirclePlugin : BasePlugin, IInGameWorldPainter
  7.     {
  8.         public WorldDecoratorCollection meteorcircleDeco { get; set; }
  9.         public WorldDecoratorCollection meteorstringDeco { get; set; }
  10.         public WorldDecoratorCollection meteorvisionstringDeco { get; set; }
  11.         public WorldDecoratorCollection meteortimerDecorator { get; set; }
  12.         public bool timeron { get; set; }
  13.         public float remaining { get; set; }
  14.         public float starpactstarttict { get; set; }
  15.         private bool starpacttimerRunning = false;
  16.  
  17.         public StarpactcirclePlugin()
  18.         {
  19.             Enabled = true;
  20.         }
  21.  
  22.         public override void Load(IController hud)
  23.         {
  24.             base.Load(hud);
  25.  
  26.             timeron = true;
  27.             meteorcircleDeco = new WorldDecoratorCollection(
  28.                 new GroundCircleDecorator(Hud)
  29.                 {
  30.                     Brush = Hud.Render.CreateBrush(255, 0, 140, 255, 6),
  31.                     Radius = 13,
  32.                 }
  33.                 );
  34.             meteorstringDeco = new WorldDecoratorCollection(
  35.                 new GroundLabelDecorator(Hud)
  36.                 {
  37.                     BackgroundBrush = Hud.Render.CreateBrush(255, 255, 255, 0, 0),
  38.                     BorderBrush = Hud.Render.CreateBrush(255, 112, 48, 160, -1),
  39.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 0, 140, 255, true, false, 128, 0, 0, 0, true),
  40.                 }
  41.             );
  42.             meteorvisionstringDeco = new WorldDecoratorCollection(
  43.             new GroundLabelDecorator(Hud)
  44.                 {
  45.                     BackgroundBrush = Hud.Render.CreateBrush(255, 255, 128, 0, 0),
  46.                     BorderBrush = Hud.Render.CreateBrush(255, 112, 48, 160, -1),
  47.                     TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 120, 0, 120, true, false, 128, 0, 0, 0, true),
  48.                 }
  49.                 );
  50.             meteortimerDecorator = new WorldDecoratorCollection(
  51.                 new GroundLabelDecorator(Hud)
  52.                 {
  53.                     CountDownFrom = 1.25f,
  54.                     TextFont = Hud.Render.CreateFont("tahoma", 9, 255, 100, 255, 150, true, false, 128, 0, 0, 0, true),
  55.                 },
  56.                 new GroundTimerDecorator(Hud)
  57.                 {
  58.                     CountDownFrom = 1.25f,
  59.                     BackgroundBrushEmpty = Hud.Render.CreateBrush(100, 0, 0, 0, 0),
  60.                     BackgroundBrushFill = Hud.Render.CreateBrush(200, 223, 47, 2, 0),
  61.                     Radius = 25,
  62.                 }
  63.             );
  64.         }
  65.  
  66.         public void PaintWorld(WorldLayer layer)
  67.         {
  68.             var actors = Hud.Game.Actors;
  69.             var me = Hud.Game.Me;
  70.             remaining = 1.25f - ((Hud.Game.CurrentGameTick - starpactstarttict) / 60.0f);
  71.             if (starpacttimerRunning == true && remaining <= 0) starpacttimerRunning = false;
  72.             if (remaining < 0) remaining = 0;
  73.             foreach (var actor in actors)
  74.             {
  75.                     switch (actor.SnoActor.Sno)
  76.                     {
  77.                         case 217142:
  78.                             meteorcircleDeco.Paint(layer, actor, actor.FloorCoordinate, null);
  79.                             if (Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.Wizard)
  80.                             {
  81.                                 meteortimerDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  82.                                 break;
  83.                             }
  84.                             if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard)
  85.                             {
  86.                                 if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && me.Stats.ResourceCurArcane < 5)
  87.                                 {
  88.                                     if (!starpacttimerRunning)
  89.                                     {
  90.                                         starpactstarttict = Hud.Game.CurrentGameTick;
  91.                                         starpacttimerRunning = true;
  92.                                     }
  93.                                     if (timeron) meteortimerDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  94.                                     break;
  95.                                 }
  96.                                 if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && remaining > 0)
  97.                                 {
  98.                                     if (timeron) meteortimerDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
  99.                                 }
  100.                             }
  101.                             break;
  102.                     }
  103.             }
  104.         }
  105.     }
  106. }
Add Comment
Please, Sign In to add comment