Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using LeagueSharp;
- using LeagueSharp.Common;
- using SharpDX;
- namespace Support
- {
- internal class Alistar : Champion
- {
- public Spell Q;
- public Spell W;
- public Spell E;
- public Spell R;
- private long _lastW;
- public Alistar()
- {
- Utils.PrintMessage("Alistar loaded.");
- Q = new Spell(SpellSlot.Q, 365f);
- W = new Spell(SpellSlot.W, 650f);
- E = new Spell(SpellSlot.E, 575f);
- R = new Spell(SpellSlot.R, 0f);
- }
- public override void Game_OnGameUpdate(EventArgs args)
- {
- if (ComboActive)
- {
- var t = SimpleTs.GetTarget(W.Range + 20, SimpleTs.DamageType.Physical);
- if (t.IsValidTarget(W.Range) && Q.IsReady() && W.IsReady() && ObjectManager.Player.CanMove && DateTime.Now.Ticks - _lastW >= 500)
- {
- W.Cast(t);
- var timeToQ = Math.Max(0, ObjectManager.Player.Distance(t) - 500) * 10 / 25 + 25;
- _lastW = (long)(DateTime.Now.Ticks + timeToQ);
- }
- if (t.IsValidTarget(Q.Range) && Q.IsReady() && ObjectManager.Player.CanMove && DateTime.Now.Ticks - _lastW < 100 && DateTime.Now.Ticks - _lastW >= 0)
- {
- Q.Cast();
- }
- if (E.IsReady() && ((ObjectManager.Player.Mana / ObjectManager.Player.MaxMana) * 100) > GetValue<Slider>("AutoHeal").Value)
- {
- E.Cast();
- }
- }
- }
- public override void AntiGapcloser_OnEnemyGapCloser(ActiveGapcloser gapcloser)
- {
- if (Q.IsReady())
- {
- if (gapcloser.Sender.IsValidTarget(Q.Range))
- {
- Q.Cast();
- }
- }
- if (W.IsReady())
- {
- if (gapcloser.Sender.IsValidTarget(W.Range))
- {
- W.Cast(gapcloser.Sender);
- }
- }
- }
- public override void Interrupter_OnPossibleToInterrupt(Obj_AI_Base unit, InterruptableSpell spell)
- {
- if (spell.DangerLevel == InterruptableDangerLevel.High)
- {
- if (unit.IsValidTarget(Q.Range))
- {
- Q.Cast();
- }
- if (unit.IsValidTarget(W.Range))
- {
- W.Cast(unit);
- }
- }
- }
- public override void Drawing_OnDraw(EventArgs args)
- {
- Spell[] spellList = { Q, W, E };
- foreach (var spell in spellList)
- {
- var menuItem = GetValue<Circle>("Draw" + spell.Slot);
- if (menuItem.Active)
- Utility.DrawCircle(ObjectManager.Player.Position, spell.Range, menuItem.Color);
- }
- }
- public override void DrawingMenu(Menu config)
- {
- config.AddItem(new MenuItem("DrawQ" + Id, "Q range").SetValue(new Circle(true, System.Drawing.Color.FromArgb(100, 255, 0, 255))));
- config.AddItem(new MenuItem("DrawW" + Id, "W range").SetValue(new Circle(true, System.Drawing.Color.FromArgb(100, 255, 0, 255))));
- config.AddItem(new MenuItem("DrawE" + Id, "E range").SetValue(new Circle(false, System.Drawing.Color.FromArgb(100, 255, 0, 255))));
- }
- public override void MiscMenu(Menu config)
- {
- config.AddItem(new MenuItem("AutoHeal" + Id, "Auto E when below % hp").SetValue(new Slider(60, 0, 100)));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement