Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.68 KB | None | 0 0
  1. using System;
  2. using LeagueSharp;
  3. using LeagueSharp.Common;
  4. using SharpDX;
  5.  
  6. namespace Support
  7. {
  8.     internal class Alistar : Champion
  9.     {
  10.         public Spell Q;
  11.         public Spell W;
  12.         public Spell E;
  13.         public Spell R;
  14.         private long _lastW;
  15.  
  16.         public Alistar()
  17.         {
  18.             Utils.PrintMessage("Alistar loaded.");
  19.  
  20.             Q = new Spell(SpellSlot.Q, 365f);
  21.             W = new Spell(SpellSlot.W, 650f);
  22.             E = new Spell(SpellSlot.E, 575f);
  23.             R = new Spell(SpellSlot.R, 0f);
  24.         }
  25.  
  26.         public override void Game_OnGameUpdate(EventArgs args)
  27.         {
  28.             if (ComboActive)
  29.             {
  30.                 var t = SimpleTs.GetTarget(W.Range + 20, SimpleTs.DamageType.Physical);
  31.  
  32.                 if (t.IsValidTarget(W.Range) && Q.IsReady() && W.IsReady() && ObjectManager.Player.CanMove && DateTime.Now.Ticks - _lastW >= 500)
  33.                 {
  34.                     W.Cast(t);
  35.                     var timeToQ = Math.Max(0, ObjectManager.Player.Distance(t) - 500) * 10 / 25 + 25;
  36.                     _lastW = (long)(DateTime.Now.Ticks + timeToQ);
  37.                 }
  38.  
  39.                 if (t.IsValidTarget(Q.Range) && Q.IsReady() && ObjectManager.Player.CanMove && DateTime.Now.Ticks - _lastW < 100 && DateTime.Now.Ticks - _lastW >= 0)
  40.                 {
  41.                     Q.Cast();
  42.                 }
  43.  
  44.                 if (E.IsReady() && ((ObjectManager.Player.Mana / ObjectManager.Player.MaxMana) * 100) > GetValue<Slider>("AutoHeal").Value)
  45.                 {
  46.                     E.Cast();
  47.                 }
  48.             }
  49.         }
  50.  
  51.         public override void AntiGapcloser_OnEnemyGapCloser(ActiveGapcloser gapcloser)
  52.         {
  53.             if (Q.IsReady())
  54.             {
  55.                 if (gapcloser.Sender.IsValidTarget(Q.Range))
  56.                 {
  57.                     Q.Cast();
  58.                 }
  59.             }
  60.  
  61.             if (W.IsReady())
  62.             {
  63.                 if (gapcloser.Sender.IsValidTarget(W.Range))
  64.                 {
  65.                     W.Cast(gapcloser.Sender);
  66.                 }
  67.             }
  68.         }
  69.  
  70.         public override void Interrupter_OnPossibleToInterrupt(Obj_AI_Base unit, InterruptableSpell spell)
  71.         {
  72.             if (spell.DangerLevel == InterruptableDangerLevel.High)
  73.             {
  74.                 if (unit.IsValidTarget(Q.Range))
  75.                 {
  76.                     Q.Cast();
  77.                 }
  78.  
  79.                 if (unit.IsValidTarget(W.Range))
  80.                 {
  81.                     W.Cast(unit);
  82.                 }
  83.             }
  84.         }
  85.  
  86.         public override void Drawing_OnDraw(EventArgs args)
  87.         {
  88.             Spell[] spellList = { Q, W, E };
  89.  
  90.             foreach (var spell in spellList)
  91.             {
  92.                 var menuItem = GetValue<Circle>("Draw" + spell.Slot);
  93.                 if (menuItem.Active)
  94.                     Utility.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
  95.             }
  96.         }
  97.  
  98.         public override void DrawingMenu(Menu config)
  99.         {
  100.             config.AddItem(new MenuItem("DrawQ" + Id, "Q range").SetValue(new Circle(true, System.Drawing.Color.FromArgb(100, 255, 0, 255))));
  101.             config.AddItem(new MenuItem("DrawW" + Id, "W range").SetValue(new Circle(true, System.Drawing.Color.FromArgb(100, 255, 0, 255))));
  102.             config.AddItem(new MenuItem("DrawE" + Id, "E range").SetValue(new Circle(false, System.Drawing.Color.FromArgb(100, 255, 0, 255))));
  103.         }
  104.  
  105.         public override void MiscMenu(Menu config)
  106.         {
  107.             config.AddItem(new MenuItem("AutoHeal" + Id, "Auto E when below % hp").SetValue(new Slider(60, 0, 100)));
  108.         }
  109.     }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement