context: #region
  
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using LeagueSharp;
  using LeagueSharp.Common;
  using SharpDX;
  using SebbyLib;
  
  
  #endregion
  
  using EloBuddy; 
  using LeagueSharp.Common; 
  namespace hi_im_gosu_Reborn
  {
      public class Vayne
      {
          public static Spell E;
          public static Spell E2;
          public static Spell Q;
          public static Spell W;
          public static Spell R;
  
  
  
  
          public static Vector3 TumblePosition = Vector3.Zero;
  
  
          public static SebbyLib.Orbwalking.Orbwalker orbwalker;
  
          private static string News = "Added New Custom Orbwalker for better cs'ing and movement";
  
          public static Menu menu;
  
          public static Dictionary<string, SpellSlot> spellData;
          public static Items.Item zzrot = new Items.Item(3512, 400);
  
          public static AIHeroClient tar;
          public const string ChampName = "Vayne";
          public static AIHeroClient Player;
          public static BuffType[] buffs;
          public static Spell cleanse;
          public static Menu Itemsmenu;
          public static Menu qmenu;
          public static Menu emenu;
          public static Menu gmenu;
          public static Menu imenu;
          public static Menu rmenu;
          public static Menu botrk;
          public static Menu qss;
  
          //private static Obj_AI_Base target;
          /* Asuna VayneHunter Copypasta */
          public static readonly Vector2 MidPos = new Vector2(6707.485f, 8802.744f);
  
          public static readonly Vector2 DragPos = new Vector2(11514, 4462);
  
          public static float LastMoveC;
          //private static Obj_AI_Base target;
          public static bool CheckTarget(Obj_AI_Base target, float range = float.MaxValue)
          {
              if (target == null)
              {
                  return false;
              }
  
              if (target.DistanceToPlayer() > range)
              {
                  return false;
              }
  
              if (target.HasBuff("KindredRNoDeathBuff"))
              {
                  return false;
              }
  
              if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3)
              {
                  return false;
              }
  
              if (target.HasBuff("JudicatorIntervention"))
              {
                  return false;
              }
  
              if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3)
              {
                  return false;
              }
  
              if (target.HasBuff("ShroudofDarkness"))
              {
                  return false;
              }
  
              if (target.HasBuff("SivirShield"))
              {
                  return false;
              }
  
              return !target.HasBuff("FioraW");
          }
         
  
          public static void MoveToLimited(Vector3 where)
          {
              if (Environment.TickCount - LastMoveC < 80)
              {
                  return;
              }
  
              LastMoveC = Environment.TickCount;
              EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, where);
          }
  
          /* End Asuna VayneHunter Copypasta */
  
          public static void Main()
          {
              try
              {
                  Game_OnGameLoad(new EventArgs());
  
              }
              catch (Exception e)
              {
                  Console.WriteLine(e.ToString());
                  return;
              }
          }
          /*public static void DrawingOnOnDraw(EventArgs args)
          {
              // if vayne got Q ready
              if (Q.IsReady())
              {
                  var s = ObjectManager.Player.Position;
                  var e = s.Extend(Game.CursorPos, Q.Range);
                  DrawPointer(s, e, Q.Range);
              }
          }*/
  
          /* public static void DrawPointer(Vector3 start, Vector3 end, float len)
           {
               var line = new Geometry.Polygon.Line(start, end, len);
               var endNext = end.Extend(new Vector3(1, 0, 0), 100).To2D()
                   .RotateAroundPoint(start.To2D(), 90 * (float)Math.PI / 180);
               var endNext2 = end.Extend(new Vector3(1, 0, 0), 100).To2D()
                   .RotateAroundPoint(start.To2D(), -90 * (float)Math.PI / 180);
               var line2 = new Geometry.Polygon.Line(end.To2D(), endNext, 50);
               var line3 = new Geometry.Polygon.Line(end.To2D(), endNext2, 50);
               line2.Draw(System.Drawing.Color.Crimson);
               line3.Draw(System.Drawing.Color.Crimson);
               line.Draw(System.Drawing.Color.Crimson);
           }*/
          public static void Game_OnGameLoad(EventArgs args)
          {
              Q = new Spell(SpellSlot.Q, 300f);
              W = new Spell(SpellSlot.W);
              E2 = new Spell(
                 SpellSlot.E,(uint)(650 + ObjectManager.Player.BoundingRadius));
              E = new Spell(SpellSlot.E, 550f);
              E.SetTargetted(0.25f, 1600f);
              R = new Spell(SpellSlot.R);
  
              Player = ObjectManager.Player;
              //Utils.PrintMessage("Vayne loaded");
              if (Player.ChampionName != ChampName) return;
              spellData = new Dictionary<string, SpellSlot>();
              //Chat.Print("Riven");
              menu = new Menu("Gosu", "Gosu", true);
              //Orbwalker
              menu.AddSubMenu(new Menu("Orbwalker", "Orbwalker"));
              orbwalker = new SebbyLib.Orbwalking.Orbwalker(menu.SubMenu("Orbwalker"));
              //TS
              var TargetSelectorMenu = new Menu("Target Selector", "Target Selector");
              TargetSelector.AddToMenu(TargetSelectorMenu);
              // SimpleTs.AddToMenu(TargetSelectorMenu);
              menu.AddSubMenu(TargetSelectorMenu);
  
              menu.AddItem(
                  new MenuItem("aaqaa", "Auto -> Q -> AA").SetValue(new KeyBind("X".ToCharArray()[0], KeyBindType.Press)));
  
              qmenu = menu.AddSubMenu(new Menu("Tumble", "Tumble"));
              qmenu.AddItem(new MenuItem("UseQC", "Use Q Combo").SetValue(true));
              qmenu.AddItem(new MenuItem("hq", "Use Q Harass").SetValue(true));
              qmenu.AddItem(new MenuItem("restrictq", "Restrict Q usage?").SetValue(true));
              qmenu.AddItem(new MenuItem("UseQJ", "Use Q Farm").SetValue(true));
              qmenu.AddItem(new MenuItem("Junglemana", "Minimum Mana to Use Q Farm").SetValue(new Slider(60, 1, 100)));
              qmenu.AddItem(new MenuItem("AntiMQ", "Use Anti - Melee [Q]").SetValue(true));
             // qmenu.AddItem(new MenuItem("FastQ", "Fast Q").SetValue(true).SetValue(new KeyBind("Q".ToCharArray()[0], KeyBindType.Press)));
              qmenu.AddItem(new MenuItem("FocusTwoW", "Focus 2 W Stacks").SetValue(true));
              //qmenu.AddItem(new MenuItem("DrawQ", "Draw Q Arrow").SetValue(true));
  
  
              emenu = menu.AddSubMenu(new Menu("Condemn", "Condemn"));
              emenu.AddItem(new MenuItem("UseEC", "Use E Combo").SetValue(true));
              emenu.AddItem(new MenuItem("he", "Use E Harass").SetValue(true));
              emenu.AddItem(new MenuItem("UseET", "Use E (Toggle)").SetValue(new KeyBind("T".ToCharArray()[0], KeyBindType.Toggle)));
              emenu.AddItem(new MenuItem("zzrot", "[Beta] ZZrot Condemn").SetValue(new KeyBind("I".ToCharArray()[0], KeyBindType.Toggle))).Permashow(true, "Vayne | ZZRot Toggle", Color.Aqua);
             // emenu.AddItem(new MenuItem("FlashE", "Flash E").SetValue(true).SetValue(new KeyBind("Y".ToCharArray()[0], KeyBindType.Press)));
  
  
              //emenu.AddItem(new MenuItem("Gap_E", "Use E To Gabcloser").SetValue(true));
              // emenu.AddItem(new MenuItem("GapD", "Anti GapCloser Delay").SetValue(new Slider(0, 0, 1000)).SetTooltip("Sets a delay before the Condemn for Antigapcloser is casted."));
              emenu.AddItem(new MenuItem("EMode", "Use E Mode:", true).SetValue(new StringList(new[] { "Lord's", "Gosu", "Flowers", "VHR", "Marksman", "Sharpshooter", "OKTW", "Shine", "PRADASMART", "PRADAPERFECT", "OLDPRADA", "PRADALEGACY" })));
              emenu.AddItem(new MenuItem("PushDistance", "E Push Distance").SetValue(new Slider(415, 475, 300)));
              emenu.AddItem(new MenuItem("EHitchance", "E Hitchance").SetValue(new Slider(50, 1, 100)).SetTooltip("Only use this for Prada Condemn Methods"));
              emenu.AddItem(new MenuItem("UseEaa", "Use E after auto").SetValue(new KeyBind("M".ToCharArray()[0], KeyBindType.Press)));
  
  
  
              rmenu = menu.AddSubMenu(new Menu("Ult", "Ult"));
              rmenu.AddItem(new MenuItem("visibleR", "Smart Invisible R").SetValue(true).SetTooltip("Wether you want to set a delay to stay in R before you Q"));
              rmenu.AddItem(new MenuItem("Qtime", "Duration to wait").SetValue(new Slider(700, 0, 1000)));
  
              imenu = menu.AddSubMenu(new Menu("Interrupt Settings", "Interrupt Settings"));
              imenu.AddItem(new MenuItem("Int_E", "Use E To Interrupt").SetValue(true));
              imenu.AddItem(new MenuItem("Interrupt", "Interrupt Danger Spells", true).SetValue(true));
              imenu.AddItem(new MenuItem("AntiAlistar", "Interrupt Alistar W", true).SetValue(true));
              imenu.AddItem(new MenuItem("AntiRengar", "Interrupt Rengar Jump", true).SetValue(true));
              imenu.AddItem(new MenuItem("AntiKhazix", "Interrupt Khazix R", true).SetValue(true));
  
  
              gmenu = menu.AddSubMenu(new Menu("Gap Closer", "Gap Closer"));
              gmenu.AddItem(new MenuItem("Gapcloser", "Anti Gapcloser", true).SetValue(false));
              foreach (var target in HeroManager.Enemies)
              {
                  gmenu.AddItem(
                      new MenuItem("AntiGapcloser" + target.ChampionName.ToLower(), target.ChampionName, true)
                          .SetValue(false));
              }
  
  
              menu.AddItem(new MenuItem("walltumble", "Wall Tumble"))
  
gt:                 .SetValue(new KeyBind("U".ToCharArray()[0], KeyBindType.Press));