Advertisement
Guest User

GRVoicePlugin

a guest
Jul 24th, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.97 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.One
  5. {
  6.     public class GRVoice : BasePlugin, IInGameWorldPainter
  7.     {
  8.         private bool inGRift { get; set; }
  9.         private string GRSpeak { get; set; }
  10.         private string GRSimulacrumSpeak { get; set; }
  11.         private float GRProgress { get; set; }
  12.         private bool statement { get; set; }
  13.         private bool GRSimulacrum { get; set; }
  14.         public GRVoice()
  15.         {
  16.             Enabled = true;
  17.         }
  18.  
  19.         public override void Load(IController hud)
  20.         {
  21.             base.Load(hud);
  22.             GRSimulacrum = true;
  23.             GRSimulacrumSpeak = "No Simulacrum";
  24.             GRProgress = 95;
  25.             GRSpeak = "GR progression";
  26.             GRSpeak += GRProgress;
  27.             statement = true;
  28.            
  29.         }
  30.  
  31.         public void PaintWorld(WorldLayer layer)
  32.         {
  33.             inGRift = Hud.Game.SpecialArea == SpecialArea.GreaterRift;
  34.             if (!inGRift) return;
  35.             if (statement && Hud.Game.RiftPercentage >= GRProgress && Hud.Sound.LastSpeak.TimerTest(5000))
  36.             {
  37.                 Hud.Sound.Speak(GRSpeak);
  38.                 statement = false;
  39.                 Hud.Sound.LastSpeak.Restart();
  40.             }
  41.             if (!statement && Hud.Game.RiftPercentage == 0) statement = true;
  42.  
  43.             //Simulacrum
  44.             if (!GRSimulacrum) return;
  45.             var skill = Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == Hud.Sno.SnoPowers.Necromancer_Simulacrum.Sno).FirstOrDefault();
  46.             if (skill == null) return;
  47.             if (Hud.Game.Me.Stats.ResourceMaxEssence < 350 && 1 > (Hud.Game.Me.Powers.UsedNecromancerPowers.Simulacrum.CooldownFinishTick - Hud.Game.CurrentGameTick) && Hud.Sound.LastSpeak.TimerTest(5000))
  48.             {
  49.                 Hud.Sound.Speak(GRSimulacrumSpeak);
  50.                 statement = false;
  51.                 Hud.Sound.LastSpeak.Restart();
  52.             }
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement