Esempio n. 1
0
        public void Cast_BasicSkillshot_AOE_Farm(Spell spell, int extrawidth = 0)
        {
            if(!spell.IsReady())
                return;
            var minions = MinionManager.GetMinions(MyHero.ServerPosition, spell.Type == SkillshotType.SkillshotLine ? spell.Range : spell.Range + ((spell.Width + extrawidth) / 2), MinionTypes.All, MinionTeam.NotAlly);
            if(minions.Count == 0)
                return;
            MinionManager.FarmLocation castPostion;

            switch(spell.Type)
            {
                case SkillshotType.SkillshotCircle:
                    castPostion = MinionManager.GetBestCircularFarmLocation(minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width + extrawidth, spell.Range);
                    break;
                case SkillshotType.SkillshotLine:
                    castPostion = MinionManager.GetBestLineFarmLocation(
                        minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width, spell.Range);
                    break;
                default:
                    return;
            }
            spell.UpdateSourcePosition();
            if(castPostion.MinionsHit >= 2 || minions.Any(x => x.Team == GameObjectTeam.Neutral))
                spell.Cast(castPostion.Position, UsePackets());
        }
Esempio n. 2
0
        public static void CastBasicFarm(Spell spell)
        {
            if (!spell.IsReady())
                return;
            var minion = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, spell.Range, MinionTypes.All, MinionTeam.NotAlly);

            if (minion.Count == 0)
                return;

            if (spell.Type == SkillshotType.SkillshotCircle)
            {
                spell.UpdateSourcePosition();

                var predPosition = spell.GetCircularFarmLocation(minion);

                if (predPosition.MinionsHit >= 2)
                {
                    spell.Cast(predPosition.Position);
                }
            }
            else if (spell.Type == SkillshotType.SkillshotLine || spell.Type == SkillshotType.SkillshotCone)
            {
                spell.UpdateSourcePosition();

                var predPosition = spell.GetLineFarmLocation(minion);

                if (predPosition.MinionsHit >= 2)
                    spell.Cast(predPosition.Position);
            }
        }
Esempio n. 3
0
        public static void CastBasicSkillShot(Spell spell, float range, TargetSelector.DamageType type, HitChance hitChance, bool towerCheck = false)
        {
            var target = TargetSelector.GetTarget(range, type);

            if (target == null || !spell.IsReady())
                return;

            if (towerCheck && target.UnderTurret(true))
                return;

            spell.UpdateSourcePosition();

            if (spell.Type == SkillshotType.SkillshotCircle)
            {
                var pred = Prediction.GetPrediction(target, spell.Delay);

                if (pred.Hitchance >= hitChance)
                    spell.Cast(pred.CastPosition);
            }
            else
            {
                spell.CastIfHitchanceEquals(target, hitChance); 
            }
           
        }
Esempio n. 4
0
        public void CastSkillshot(Obj_AI_Hero t, Spell s, HitChance hc = HitChance.High)
        {
            if (!s.IsSkillshot)
                return;

            PredictionOutput p = s.GetPrediction(t);

            if (s.Collision)
            {
                for (int i = 0; i < p.CollisionObjects.Count; i++)
                    if (!p.CollisionObjects[i].IsDead && (p.CollisionObjects[i].IsEnemy || p.CollisionObjects[i].IsMinion))
                        return;
            }

            if ((t.HasBuffOfType(BuffType.Slow) && p.Hitchance >= HitChance.High) || p.Hitchance == HitChance.Immobile)
                s.Cast(p.CastPosition);
            else if (t.IsRecalling())
                s.Cast(t.ServerPosition);
            else
            {
                if (s.IsReady())
                {
                    s.SPredictionCast(t, hc);
                }
            }
        }
Esempio n. 5
0
        private static void CastMec(Spell spell, int minHit)
        {
            if (!spell.IsReady() || ObjectManager.Player.HealthPercent <= 10)
                return;

            foreach (var target in HeroManager.Enemies.Where(x => x.IsValidTarget(spell.Range)))
            {
                var pred = spell.GetPrediction(target, true);

                var nearByEnemies = 1;

                if (spell.Type == SkillshotType.SkillshotLine && spell.Collision)
                {
                    var poly = new Geometry.Polygon.Circle(pred.UnitPosition, spell.Width);

                    nearByEnemies +=
                        HeroManager.Enemies.Where(x => x.NetworkId != target.NetworkId)
                            .Count(enemy => poly.IsInside(enemy.ServerPosition));

                }
                else
                {
                    nearByEnemies = pred.AoeTargetsHitCount;
                }

                if (nearByEnemies >= minHit)
                {
                    
                    spell.Cast(target);
                    return;
                }
            }
        }
Esempio n. 6
0
        public void UseSpellOnTeleport(Spell spell)
        {
            if (!IsMenuEnabled("EOnTP") || (Environment.TickCount - LastCheck) < 1500)
            {
                return;
            }

            LastCheck = Environment.TickCount;
            var player = ObjectManager.Player;
            if (!spell.IsReady())
            {
                return;
            }

            foreach (
                var targetPosition in
                    ObjectManager.Get<Obj_AI_Hero>()
                        .Where(
                            obj =>
                                obj.Distance(player) < spell.Range && obj.Team != player.Team &&
                                obj.HasBuff("teleport_target", true)))
            {
                spell.Cast(targetPosition.ServerPosition);
            }
        }
Esempio n. 7
0
        public static void wardJump(Vector2 pos)
        {
            Q = new Spell(SpellSlot.Q, 700);

            if (!Q.IsReady())
                return;

            var wardIs = false;

            if (!InDistance(pos, Player.ServerPosition.LSTo2D(), Q.Range))
            {
                pos = Player.ServerPosition.LSTo2D() + Vector2.Normalize(pos - Player.ServerPosition.LSTo2D())*600;
            }

            if (!Q.IsReady())
                return;

            foreach (var ally in ObjectManager.Get<Obj_AI_Base>().Where(ally => ally.IsAlly && !(ally is Obj_AI_Turret) && InDistance(pos, ally.ServerPosition.LSTo2D(), 200)))
            {
                wardIs = true;
                moveTo(pos);
                if (InDistance(Player.ServerPosition.LSTo2D(), ally.ServerPosition.LSTo2D(), Q.Range + ally.BoundingRadius))
                {
                    if (last < Environment.TickCount)
                    {
                        Q.Cast(ally);
                        last = Environment.TickCount + 2000;
                    }
                    else return;
                }
                return;
            }
            Polygon pol;
            if ((pol = Program.map.getInWhichPolygon(pos)) != null)
            {
                if (InDistance(pol.getProjOnPolygon(pos), Player.ServerPosition.LSTo2D(), Q.Range) && !wardIs &&
                    InDistance(pol.getProjOnPolygon(pos), pos, 250))
                {
                    putWard(pos);
                }
            }
            else if (!wardIs)
            {
                putWard(pos);
            }
        }
Esempio n. 8
0
 private static bool CheckFor(Spell spell, Obj_AI_Base target, float spellrange, string menuitem)
 {
     if (spell.IsReady() && target.IsValidTarget(spellrange) && !target.HasBuffOfType(BuffType.Invulnerability) && !target.HasBuff("UndyingRage") && !target.IsDead && Config.Item(menuitem).GetValue<bool>() == true)
     {
         return true;
     }
     else return false;
 }
Esempio n. 9
0
        public static void wardJump(Vector2 pos)
        {
            W = new Spell(SpellSlot.Q, 700);
            Vector2 posStart = pos;
            if (!W.IsReady())
                return;
            bool wardIs = false;
            if (!inDistance(pos, Player.ServerPosition.To2D(), W.Range+15))
            {
                pos = Player.ServerPosition.To2D() + Vector2.Normalize(pos - Player.ServerPosition.To2D())*600;
            }

            if(!W.IsReady() && W.ChargedSpellName == "")
                return;
            foreach (Obj_AI_Base ally in ObjectManager.Get<Obj_AI_Base>().Where(ally => ally.IsAlly
                && !(ally is Obj_AI_Turret) && inDistance(pos, ally.ServerPosition.To2D(), 200)))
            {
                    wardIs = true;
                moveTo(pos);
                if (inDistance(Player.ServerPosition.To2D(), ally.ServerPosition.To2D(), W.Range + ally.BoundingRadius))
                {
                    if (last < Environment.TickCount)
                    {
                        W.Cast(ally);
                        last = Environment.TickCount + 2000;
                    }
                    else return;
                }
                return;
            }
            Polygon pol;
            if ((pol = Program.map.getInWhichPolygon(pos)) != null)
            {
                if (inDistance(pol.getProjOnPolygon(pos), Player.ServerPosition.To2D(), W.Range + 15) && !wardIs && inDistance(pol.getProjOnPolygon(pos), pos, 200))
                {
                    putWard(pos);
                }
                
            }
            else if(!wardIs)
            {
                    putWard(pos);
            }

        }
Esempio n. 10
0
 public static void CastBasicSkillShot(Spell spell, float range, LeagueSharp.Common.TargetSelector.DamageType type, HitChance hitChance)
 {
     var target = LeagueSharp.Common.TargetSelector.GetTarget(range, type);
     if (target == null || !spell.IsReady())
     return;
     spell.UpdateSourcePosition();
     if (spell.GetPrediction(target).Hitchance >= hitChance)
     spell.Cast(target, packets());
 }
Esempio n. 11
0
 public Obj_AI_Hero Cast_BasicSkillshot_Enemy(Spell spell, TargetSelector.PriorityMode prio = TargetSelector.PriorityMode.AutoPriority, float extrarange = 0)
 {
     if(!spell.IsReady())
         return null;
     var target = TargetSelector.GetTarget(spell.Range, prio);
     if(target == null)
         return null;
     if (!target.IsValidTarget(spell.Range + extrarange) || spell.GetPrediction(target).Hitchance < HitChance.High)
         return null;
     spell.Cast(target, UsePackets());
     return target;
 }
Esempio n. 12
0
 static void Karma()
 {
     Game.PrintChat("Karma supported");
     var shield = new Spell(SpellSlot.E, 400);
     Game.OnUpdate += eventArgs =>
     {
         if (shield.IsReady() && ObjectManager.Player.CountEnemiesInRange(1500) > 0)
         {
             shield.CastOnUnit(ObjectManager.Player);
         }
     };
 }
Esempio n. 13
0
 /// <summary>
 ///     Casts a basic circle skillshot towards target if hitchance is high
 /// </summary>
 /// <param name="spell"></param>
 /// <param name="damageType"></param>
 /// <param name="extrarange"></param>
 /// <returns></returns>
 public Obj_AI_Base castCircleSkillShot(Spell spell,
     SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, float extrarange = 0)
 {
     if (!spell.IsReady())
         return null;
     Obj_AI_Hero target = SimpleTs.GetTarget(spell.Range + extrarange, damageType);
     if (target == null)
         return null;
     if (target.IsValidTarget(spell.Range + extrarange) &&
         spell.GetPrediction(target).Hitchance >= HitChance.High)
         spell.Cast(target, true);
     return target;
 }
Esempio n. 14
0
 /// <summary>
 ///     Casts a basic line skillshot towards target if hitchance is high
 /// </summary>
 /// <param name="spell"></param>
 /// <param name="damageType"></param>
 /// <returns> target </returns>
 public Obj_AI_Hero castLineSkillShot(Spell spell,
     SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
 {
     if (!spell.IsReady())
         return null;
     Obj_AI_Hero target = SimpleTs.GetTarget(spell.Range, damageType);
     if (target == null)
         return null;
     if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).Hitchance < HitChance.High)
         return null;
     spell.Cast(target, true);
     return target;
 }
Esempio n. 15
0
        public static void TargetSkill(Obj_AI_Base target, Spell spell, bool packet = false, bool towerCheck = false)
        {
            if (!spell.IsReady())
            {
                return;
            }

            if (target == null || towerCheck && target.UnderTurret(true))
            {
                return;
            }

            spell.Cast(target, packet);
        }
Esempio n. 16
0
        public void Cast_BasicSkillshot_AOE_Farm(Spell spell, int extrawidth = 0)
        {
            if(!spell.IsReady() )
                return;
            var minions = MinionManager.GetMinions(ObjectManager.Player.Position, spell.Type == SkillshotType.SkillshotLine ? spell.Range : spell.Range + ((spell.Width + extrawidth) / 2),MinionTypes.All , MinionTeam.NotAlly);
            if(minions.Count == 0)
                return;
            var castPostion = new MinionManager.FarmLocation();

            if(spell.Type == SkillshotType.SkillshotCircle)
                castPostion = MinionManager.GetBestCircularFarmLocation(minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width + extrawidth, spell.Range);
            if(spell.Type == SkillshotType.SkillshotLine)
                castPostion = MinionManager.GetBestLineFarmLocation(minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width, spell.Range);
            spell.Cast(castPostion.Position, UsePackets());
        }
Esempio n. 17
0
        public Caitlyn()
        {
            Q = new Spell(SpellSlot.Q, 1240);
            W = new Spell(SpellSlot.W, 820);
            E = new Spell(SpellSlot.E, 800);
            R = new Spell(SpellSlot.R, 2000);

            Q.SetSkillshot(0.50f, 50f, 2000f, false, SkillshotType.SkillshotLine);
            E.SetSkillshot(0.25f, 60f, 1600f, true, SkillshotType.SkillshotLine);

            AntiGapcloser.OnEnemyGapcloser += AntiGapcloser_OnEnemyGapcloser;
            Drawing.OnEndScene += DrawingOnOnEndScene;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Hero_OnProcessSpellCast;

            Obj_AI_Base.OnBuffAdd += (sender, args) =>
                {
                    if (W.IsReady())
                    {
                        BuffInstance aBuff =
                            (from fBuffs in
                                 sender.Buffs.Where(
                                     s =>
                                     sender.Team != ObjectManager.Player.Team
                                     && sender.Distance(ObjectManager.Player.Position) < W.Range)
                             from b in new[]
                                           {
                                               "teleport", /* Teleport */ "pantheon_grandskyfall_jump", /* Pantheon */
                                               "crowstorm", /* FiddleScitck */
                                               "zhonya", "katarinar", /* Katarita */
                                               "MissFortuneBulletTime", /* MissFortune */
                                               "gate", /* Twisted Fate */
                                               "chronorevive" /* Zilean */
                                           }
                             where args.Buff.Name.ToLower().Contains(b)
                             select fBuffs).FirstOrDefault();

                        if (aBuff != null)
                        {
                            CastW(sender.Position);
                            //W.Cast(sender.Position);
                        }
                    }
                };

            Marksman.Utils.Utils.PrintMessage("Caitlyn loaded.");
        }
Esempio n. 18
0
File: Jinx.cs Progetto: CjShu/L-CC
        public Jinx()
        {
            Q = new Spell(SpellSlot.Q);
            W = new Spell(SpellSlot.W, 1490);
            E = new Spell(SpellSlot.E, 900);
            R = new Spell(SpellSlot.R, 3000);

            W.SetSkillshot(0.6f, 70f, 3300f, true, SkillshotType.SkillshotLine);
            E.SetSkillshot(0.7f, 120f, 1750f, false, SkillshotType.SkillshotCircle);
            R.SetSkillshot(0.7f, 140f, 1500f, false, SkillshotType.SkillshotLine);

            Obj_AI_Base.OnBuffAdd += (sebder, args) =>
            {
                if (E.IsReady())
                {
                    BuffInstance aBuff = (from fBuffs in sebder.Buffs.Where(s =>
                    sebder.Team != ObjectManager.Player.Team
                    && sebder.Distance(ObjectManager.Player.Position) < E.Range)
                                          from b in new[]
                                          {
                        "teleport_", /* Teleport */
                        "pantheon_grandskyfall_jump", /* Pantheon */
                        "crowstorm", /* FiddleScitck */
                        "zhonya", "katarinar", /* Katarita */
                        "MissFortuneBulletTime", /* MissFortune */
                        "gate", /* Twisted Fate */
                        "chronorevive" /* Zilean */
                    }
                                          where args.Buff.Name.ToLower().Contains(b)
                                          select fBuffs).FirstOrDefault();
                    if (aBuff != null)
                    {
                        E.Cast(sebder.Position);
                    }
                }
            };
            Utility.HpBarDamageIndicator.DamageToUnit = GetComboDamage;
            Utility.HpBarDamageIndicator.Enabled = true;
            Game.OnUpdate += Game_OnUpdate;
            AntiGapcloser.OnEnemyGapcloser += OnEnemyGapcloser;
            Obj_AI_Base.OnProcessSpellCast += OnProcessSpellCast;
            Drawing.OnDraw += OnDraw;
            AioOrb.Orbwalking.BeforeAttack += BeforeAttack;

            Hero.Helpe.PrintMessage("Jinx TwAio");
        }
Esempio n. 19
0
        public Jinx()
        {
            Q = new Spell(SpellSlot.Q);
            W = new Spell(SpellSlot.W, 1500f);
            E = new Spell(SpellSlot.E, 900f);
            R = new Spell(SpellSlot.R, 25000f);

            W.SetSkillshot(0.6f, 60f, 3300f, true, SkillshotType.SkillshotLine);
            E.SetSkillshot(0.7f, 120f, 1750f, false, SkillshotType.SkillshotCircle);
            R.SetSkillshot(0.6f, 140f, 1700f, false, SkillshotType.SkillshotLine);
            
            Obj_AI_Base.OnBuffAdd += (sender, args) =>
            {
                if (E.IsReady())
                {
                    BuffInstance aBuff =
                        (from fBuffs in
                             sender.Buffs.Where(
                                 s =>
                                 sender.Team != ObjectManager.Player.Team
                                 && sender.Distance(ObjectManager.Player.Position) < E.Range)
                         from b in new[]
                                           {
                                               "teleport_", /* Teleport */ "pantheon_grandskyfall_jump", /* Pantheon */ 
                                               "crowstorm", /* FiddleScitck */
                                               "zhonya", "katarinar", /* Katarita */
                                               "MissFortuneBulletTime", /* MissFortune */
                                               "gate", /* Twisted Fate */
                                               "chronorevive" /* Zilean */
                                           }
                         where args.Buff.Name.ToLower().Contains(b)
                         select fBuffs).FirstOrDefault();

                    if (aBuff != null)
                    {
                        E.Cast(sender.Position);
                    }
                }
            };
            Utility.HpBarDamageIndicator.DamageToUnit = GetComboDamage;
            Utility.HpBarDamageIndicator.Enabled = true;

            Utils.Utils.PrintMessage("Jinx loaded.");
        }
Esempio n. 20
0
        public static void Farm(Spell spell,
            int minHit = 3,
            float overrideWidth = -1f,
            bool chargeMax = true,
            List<Obj_AI_Base> minions = null)
        {
            if (!spell.IsReady())
            {
                return;
            }
            var spellWidth = overrideWidth > 0 ? overrideWidth : spell.Width;

            if (minions == null)
            {
                minions =
                    MinionManager.GetMinions(
                        (((chargeMax && spell.IsChargedSpell ? spell.ChargedMaxRange : spell.Range) + spellWidth) * 1.5f),
                        MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth);
            }

            if (minions.Count == 0)
            {
                return;
            }

            if (minHit > 1)
            {
                minHit = minions.Any(m => m.Team == GameObjectTeam.Neutral) ? 1 : minHit;
            }

            if (spell.Type == SkillshotType.SkillshotCircle)
            {
                CircleFarm(spell, minions, minHit, overrideWidth);
            }
            else if (spell.Type == SkillshotType.SkillshotLine)
            {
                LineFarm(spell, minions, minHit, overrideWidth);
            }
            else if (spell.Type == SkillshotType.SkillshotCone)
            {
                ConeFarm(spell, minions, minHit, overrideWidth);
            }
        }
Esempio n. 21
0
        public Ashe()
        {
            Q = new Spell(SpellSlot.Q);
            W = new Spell(SpellSlot.W, 1200);
            E = new Spell(SpellSlot.E);
            R = new Spell(SpellSlot.R, 4000);

            W.SetSkillshot(250f, (float)(45f * Math.PI / 180), 900f, true, SkillshotType.SkillshotCone);
            E.SetSkillshot(377f, 299f, 1400f, false, SkillshotType.SkillshotLine);
            R.SetSkillshot(250f, 130f, 1600f, false, SkillshotType.SkillshotLine);

            Obj_AI_Base.OnProcessSpellCast += Game_OnProcessSpell;
            Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;

            Utility.HpBarDamageIndicator.DamageToUnit = GetComboDamage;
            Utility.HpBarDamageIndicator.Enabled = true;

            Obj_AI_Base.OnBuffAdd += (sender, args) =>
            {
                if (!Config.Item("RInterruptable" + Id).GetValue<bool>())
                    return;

                BuffInstance aBuff =
                    (from fBuffs in
                        sender.Buffs.Where(
                            s =>
                                sender.Team != ObjectManager.Player.Team
                                && sender.Distance(ObjectManager.Player.Position) < 2500)
                        from b in new[] {"katarinar", "MissFortuneBulletTime", "crowstorm"}

                        where b.Contains(args.Buff.Name.ToLower())
                        select fBuffs).FirstOrDefault();

                if (aBuff != null && R.IsReady())
                {
                    R.Cast(sender.Position);
                }
            };

            Utils.Utils.PrintMessage("Ashe loaded.");
        }
Esempio n. 22
0
 /// <summary>
 ///     Thats basically provide combo damage
 /// </summary>
 /// <param name="spell1">Q Spell</param>
 /// <param name="spell2">W Spell</param>
 /// <param name="spell3">E Spell</param>
 /// <param name="spell4">R Spell</param>
 /// <param name="unit">Target</param>
 /// <returns></returns>
 public static float ComboDamage(this Spell spell1, Spell spell2, Spell spell3, Spell spell4, AIHeroClient unit)
 {
     var combodamage = 0f;
     if (spell1.IsReady())
     {
         combodamage += spell1.GetDamage(unit);
     }
     if (spell2.IsReady())
     {
         combodamage += spell2.GetDamage(unit);
     }
     if (spell3.IsReady())
     {
         combodamage += spell2.GetDamage(unit);
     }
     if (spell4.IsReady())
     {
         combodamage += spell2.GetDamage(unit);
     }
     return combodamage;
 }
Esempio n. 23
0
        public static void CastSingleLine(Spell spell, Spell spell2, bool wallCheck, float extraPrerange = 1)
        {
            if (!spell.IsReady() || Utils.TickCount - _lastCast < 0)
                return;

            //-------------------------------Single---------------------------
            var target = TargetSelector.GetTarget(spell.Range + spell2.Range, TargetSelector.DamageType.Magical);

            if (target == null)
                return;

            var vector1 = Player.ServerPosition + Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * (spell.Range * extraPrerange);

            spell2.UpdateSourcePosition(vector1, vector1);

            var pred = Prediction.GetPrediction(target, spell.Delay);
            Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width);

            if (Player.Distance(target) < spell.Range)
            {
                var vector2 = pred.CastPosition.Extend(target.ServerPosition, spell2.Range*.3f);
                Geometry.Polygon.Rectangle rec2 = new Geometry.Polygon.Rectangle(vector2, vector2.Extend(pred.CastPosition, spell2.Range), spell.Width);

                if ((!rec2.Points.Exists(Util.IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving)
                {
                    spell2.UpdateSourcePosition(vector2, vector2);
                    CastLineSpell(vector2, vector2.Extend(pred.CastPosition, spell2.Range));
                    _lastCast = Utils.TickCount + 500;
                }

            }
            else if (!rec1.Points.Exists(Util.IsWall) || !wallCheck)
            {
                //wall check
                if (pred.Hitchance >= HitChance.High)
                {
                    CastLineSpell(vector1, pred.CastPosition);
                }
            }
        }
Esempio n. 24
0
 /// <summary>
 /// Basic Wardjump
 /// </summary>
 /// <param name="W">W Skill</param>
 /// <param name="position">Jump Position</param>
 public static void HikiJump(Spell W,Vector3 position)
 {
     ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
     if (WardCastable && W.Instance.Name == "BlindMonkWOne" && W.IsReady())
     {
         ObjectManager.Player.Spellbook.CastSpell(Items.GetWardSlot().SpellSlot, position);
         LastWardCreated = Game.Time;
         LastWardJumpTime = Game.Time;
         WardCastPosition = position;
     }
     var ward = ObjectManager.Get<Obj_AI_Base>()
             .OrderBy(obj => obj.Distance(ObjectManager.Player.ServerPosition))
             .FirstOrDefault(
                 obj =>
                     obj.IsAlly && !obj.IsMe && obj.Name.IndexOf("ward", StringComparison.InvariantCultureIgnoreCase) >= 0 &&
                     (!(obj.Name.IndexOf("turret", StringComparison.InvariantCultureIgnoreCase) >= 0) &&
                      Vector3.DistanceSquared(Game.CursorPos, obj.ServerPosition) <= 150 * 150));
     if (ward != null)
     {
         W.CastOnUnit(ward);
     }
 }
Esempio n. 25
0
        public Ashe()
        {
            Q = new LeagueSharp.Common.Spell(SpellSlot.Q);
            W = new LeagueSharp.Common.Spell(SpellSlot.W, 1200);
            E = new LeagueSharp.Common.Spell(SpellSlot.E);
            R = new LeagueSharp.Common.Spell(SpellSlot.R, 4000);

            W.SetSkillshot(250f, (float)(45f * Math.PI / 180), 900f, true, SkillshotType.SkillshotCone);
            E.SetSkillshot(377f, 299f, 1400f, false, SkillshotType.SkillshotLine);
            R.SetSkillshot(250f, 130f, 1600f, false, SkillshotType.SkillshotLine);

            Obj_AI_Base.OnProcessSpellCast += Game_OnProcessSpell;
            Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;

            Obj_AI_Base.OnBuffGain += (sender, args) =>
            {
                if (!Program.misc["RInterruptable"].Cast<CheckBox>().CurrentValue)
                    return;

                BuffInstance aBuff =
                    (from fBuffs in
                        sender.Buffs.Where(
                            s =>
                                sender.Team != ObjectManager.Player.Team
                                && sender.LSDistance(ObjectManager.Player.Position) < 2500)
                     from b in new[] { "katarinar", "MissFortuneBulletTime", "crowstorm" }

                     where b.Contains(args.Buff.Name.ToLower())
                     select fBuffs).FirstOrDefault();

                if (aBuff != null && R.IsReady())
                {
                    R.Cast(sender.Position);
                }
            };

            Utils.Utils.PrintMessage("Ashe loaded.");
        }
Esempio n. 26
0
        public Teemo()
        {
            Q = new LeagueSharp.Common.Spell(SpellSlot.Q, 680);
            R = new LeagueSharp.Common.Spell(SpellSlot.R, 230);
            Q.SetTargetted(0f, 2000f);
            R.SetSkillshot(0.1f, 75f, float.MaxValue, false, SkillshotType.SkillshotCircle);
            Obj_AI_Base.OnBuffGain += (sender, args) =>
            {
                if (R.IsReady())
                {
                    BuffInstance aBuff =
                        (from fBuffs in
                             sender.Buffs.Where(
                                 s =>
                                 sender.Team != ObjectManager.Player.Team
                                 && sender.LSDistance(ObjectManager.Player.Position) < R.Range)
                         from b in new[]
                                           {
                                               "teleport", /* Teleport */ "pantheon_grandskyfall_jump", /* Pantheon */
                                               "crowstorm", /* FiddleScitck */
                                               "zhonya", "katarinar", /* Katarita */
                                               "MissFortuneBulletTime", /* MissFortune */
                                               "gate", /* Twisted Fate */
                                               "chronorevive" /* Zilean */
                                           }
                         where args.Buff.Name.ToLower().Contains(b)
                         select fBuffs).FirstOrDefault();

                    if (aBuff != null)
                    {
                        R.Cast(sender.Position);
                    }
                }
            };

            Utils.Utils.PrintMessage("Teemo loaded.");
        }
Esempio n. 27
0
        public Jhin()
        {
            Q = new LeagueSharp.Common.Spell(SpellSlot.Q, 600);
            W = new LeagueSharp.Common.Spell(SpellSlot.W, 2400);
            E = new LeagueSharp.Common.Spell(SpellSlot.E, 750);
            R = new LeagueSharp.Common.Spell(SpellSlot.R, 3500);

            W.SetSkillshot(250f, (float)(45f * Math.PI / 180), 900f, true, SkillshotType.SkillshotCone);
            E.SetSkillshot(377f, 299f, 1400f, false, SkillshotType.SkillshotLine);
            R.SetSkillshot(250f, 130f, 1600f, false, SkillshotType.SkillshotLine);

            Obj_AI_Base.OnProcessSpellCast += Game_OnProcessSpell;
            Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;
            Drawing.OnEndScene += DrawingOnOnEndScene;

            Obj_AI_Base.OnBuffGain += (sender, args) =>
            {
                BuffInstance aBuff =
                    (from fBuffs in
                         sender.Buffs.Where(
                             s =>
                             sender.Team != ObjectManager.Player.Team
                             && sender.LSDistance(ObjectManager.Player.Position) < 2500)
                     from b in new[] { "katarinar", "MissFortuneBulletTime", "crowstorm" }

                     where b.Contains(args.Buff.Name.ToLower())
                     select fBuffs).FirstOrDefault();

                if (aBuff != null && E.IsReady())
                {
                    R.Cast(sender.Position);
                }
            };

            Utils.Utils.PrintMessage("Jhin loaded.");
        }
 public static void Add(Spell spell, bool readyCheck = true)
 {
     try
     {
         if (_menu == null)
         {
             return;
         }
         _menu.AddItem(
             new MenuItem(_menu.Name + "." + spell.Slot, spell.Slot.ToString().ToUpper()).SetValue(false));
         if (readyCheck)
         {
             Functions.Add(spell.Slot.ToString(), hero => spell.IsReady() ? spell.GetDamage(hero) : 0);
         }
         else
         {
             Functions.Add(spell.Slot.ToString(), hero => spell.GetDamage(hero));
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
Esempio n. 29
0
        public static void SkillShot(Obj_AI_Base target,
            Spell spell,
            HitChance hitChance,
            bool aoe = false,
            bool towerCheck = false)
        {
            if (!spell.IsReady())
            {
                return;
            }

            if (target == null || towerCheck && target.UnderTurret(true))
            {
                return;
            }

            spell.UpdateSourcePosition();

            var prediction = spell.GetPrediction(target, aoe);
            if (prediction.Hitchance >= hitChance)
            {
                spell.Cast(prediction.CastPosition);
            }
        }
Esempio n. 30
0
        private static void Combo()
        {
            var target = TargetSelector.GetTarget(1000, DamageType.Magical);

            if (target == null)
            {
                return;
            }
            var cmbdmg   = ComboDamage(target);
            var hasFlash = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerFlash")) == SpellState.Ready;

            if (getCheckBoxItem(menuC, "usee") && E.IsReady())
            {
                if (getCheckBoxItem(menuC, "useewall"))
                {
                    var bestpos = CombatHelper.bestVectorToPoppyFlash2(target);
                    var damage  =
                        (float)
                        (ComboDamage(target) +
                         player.CalcDamage(target, DamageType.Magical,
                                           eSecond[E.Level - 1] + 0.8f * player.FlatMagicDamageMod) +
                         player.GetAutoAttackDamage(target) * 4);
                    var damageno = ComboDamage(target) + player.GetAutoAttackDamage(target) * 4;
                    if (getCheckBoxItem(menuC, "useeflash") && hasFlash && !CheckWalls(player, target) &&
                        damage > target.Health && target.Health > damageno &&
                        CombatHelper.bestVectorToPoppyFlash(target).IsValid())
                    {
                        player.Spellbook.CastSpell(player.GetSpellSlot("SummonerFlash"), bestpos);
                        Utility.DelayAction.Add(
                            100, () => E.CastOnUnit(target, getCheckBoxItem(config, "packets")));
                    }
                    if (E.CanCast(target) &&
                        (CheckWalls(player, target) ||
                         target.Health < E.GetDamage(target) + player.GetAutoAttackDamage(target, true)))
                    {
                        E.CastOnUnit(target, getCheckBoxItem(config, "packets"));
                    }
                    if (E.CanCast(target) && Q.IsReady() && Q.Instance.SData.Mana + E.Instance.SData.Mana > player.Mana &&
                        target.Health <
                        E.GetDamage(target) + Q.GetDamage(target) + player.GetAutoAttackDamage(target, true))
                    {
                        E.CastOnUnit(target, getCheckBoxItem(config, "packets"));
                    }
                }
                else
                {
                    if (E.CanCast(target))
                    {
                        E.CastOnUnit(target, getCheckBoxItem(config, "packets"));
                    }
                }
            }
            if (getCheckBoxItem(menuC, "useq") && Q.IsReady() && Q.CanCast(target) && target.Distance(player) < Q.Range &&
                (player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target) || !Orbwalker.CanAutoAttack))
            {
                Q.CastIfHitchanceEquals(target, HitChance.High, getCheckBoxItem(config, "packets"));
            }

            var hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready &&
                            getCheckBoxItem(menuC, "useIgnite");
            var ignitedmg = hasIgnite ? (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite) : 0f;

            if (ignitedmg > target.Health && hasIgnite && !E.CanCast(target) && !Q.CanCast(target) &&
                (player.Distance(target) > Q.Range || player.HealthPercent < 30))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }
            if (getCheckBoxItem(menuC, "userindanger") && R.IsReady() && player.CountEnemiesInRange(800) >= 2 &&
                player.CountEnemiesInRange(800) > player.CountAlliesInRange(1500) + 1 && player.HealthPercent < 60 ||
                (player.Health < target.Health && player.HealthPercent < 40 &&
                 player.CountAlliesInRange(1000) + 1 < player.CountEnemiesInRange(1000)))
            {
                var targ =
                    HeroManager.Enemies.Where(
                        e =>
                        e.IsValidTarget() && R.CanCast(e) &&
                        (player.HealthPercent < 60 || e.CountEnemiesInRange(300) > 2) &&
                        HeroManager.Enemies.Count(h => h.Distance(e) < 400 && e.HealthPercent < 35) == 0 &&
                        R.GetPrediction(e).CastPosition.Distance(player.Position) < R.ChargedMaxRange)
                    .OrderByDescending(e => R.GetPrediction(e).CastPosition.CountEnemiesInRange(400))
                    .ThenByDescending(e => e.Distance(target))
                    .FirstOrDefault();
                if (R.Range > 1300 && targ == null)
                {
                    targ =
                        HeroManager.Enemies.Where(
                            e =>
                            e.IsValidTarget() && R.CanCast(e) &&
                            R.GetPrediction(e).CastPosition.Distance(player.Position) < R.ChargedMaxRange)
                        .OrderByDescending(e => R.GetPrediction(e).CastPosition.CountEnemiesInRange(400))
                        .ThenByDescending(e => e.Distance(target))
                        .FirstOrDefault();
                }
                if (!R.IsCharging && targ != null)
                {
                    R.StartCharging();
                }
                if (R.IsCharging && targ != null && R.CanCast(targ) && R.Range > 1000 && R.Range > targ.Distance(player))
                {
                    R.CastIfHitchanceEquals(targ, HitChance.Medium, getCheckBoxItem(config, "packets"));
                }
                if (R.IsCharging && targ != null && R.Range < 1000)
                {
                    return;
                }
            }
            if (getCheckBoxItem(menuC, "user") && R.IsReady() && player.Distance(target) < 1400 &&
                !target.UnderTurret(true))
            {
                var cond = (Rdmg(target) < target.Health && ignitedmg + Rdmg(target) > target.Health &&
                            player.Distance(target) < 600) ||
                           (target.Distance(player) > E.Range && Rdmg(target) > target.Health &&
                            target.Distance(player) < 1100);
                if (!R.IsCharging && cond && !Q.IsReady() && player.HealthPercent < 40)
                {
                    R.StartCharging();
                    if (hasIgnite && cmbdmg > target.Health && cmbdmg - Rdmg(target) < target.Health)
                    {
                        if (!target.HasBuff("summonerdot"))
                        {
                            player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
                        }
                    }
                }
                if (R.IsCharging && R.CanCast(target) && R.Range > target.Distance(player) && cond)
                {
                    R.CastIfHitchanceEquals(target, HitChance.High, getCheckBoxItem(config, "packets"));
                }
            }
        }
Esempio n. 31
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if (R1.IsReady() && Program.misc["UseRM"].Cast <CheckBox>().CurrentValue)
            {
                bool bigRocket = HasBigRocket();
                foreach (
                    AIHeroClient hero in
                    ObjectManager.Get <AIHeroClient>()
                    .Where(
                        hero =>
                        hero.LSIsValidTarget(bigRocket ? R2.Range : R1.Range) &&
                        R1.GetDamage(hero) * (bigRocket ? 1.5f : 1f) > hero.Health))
                {
                    if (bigRocket)
                    {
                        R2.Cast(hero, false, true);
                    }
                    else
                    {
                        R1.Cast(hero, false, true);
                    }
                }
            }

            if ((!ComboActive && !HarassActive) || !Orbwalker.CanMove)
            {
                return;
            }

            var useQ = ComboActive ? Program.combo["UseQC"].Cast <CheckBox>().CurrentValue : Program.harass["UseQH"].Cast <CheckBox>().CurrentValue;
            var useE = ComboActive ? Program.combo["UseEC"].Cast <CheckBox>().CurrentValue : Program.harass["UseEH"].Cast <CheckBox>().CurrentValue;
            var useR = ComboActive ? Program.combo["UseRC"].Cast <CheckBox>().CurrentValue : Program.harass["UseRH"].Cast <CheckBox>().CurrentValue;
            var rLim = ComboActive ? Program.combo["RlimC"].Cast <Slider>().CurrentValue : Program.harass["RlimH"].Cast <Slider>().CurrentValue;

            if (useQ && Q.IsReady())
            {
                var t = TargetSelector.GetTarget(Q.Range, DamageType.Magical);
                if (t != null)
                {
                    if (Q.Cast(t, false, true))
                    {
                        return;
                    }
                }
            }

            if (useE && E.IsReady())
            {
                var t = TargetSelector.GetTarget(E.Range, DamageType.Physical);
                if (t.LSIsValidTarget())
                {
                    if (E.Cast(t, false, true))
                    {
                        return;
                    }
                }
            }

            if (useR && R1.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Ammo > rLim)
            {
                bool         bigRocket = HasBigRocket();
                AIHeroClient t         = TargetSelector.GetTarget(bigRocket ? R2.Range : R1.Range, DamageType.Magical);

                if (t.LSIsValidTarget())
                {
                    if (bigRocket)
                    {
                        R2.Cast(t, false, true);
                    }
                    else
                    {
                        R1.Cast(t, false, true);
                    }
                }
            }
        }
Esempio n. 32
0
        private static void Combo()
        {
            var t          = TargetSelector.GetTarget(_bq.Range, DamageType.Physical);
            var reksaifury = Equals(_player.Mana, _player.MaxMana);

            if (IsBurrowed())
            {
                if (getCheckBoxItem(comboMenu, "UseEBCombo"))
                {
                    var te = TargetSelector.GetTarget(_be.Range + _bw.Range, DamageType.Physical);
                    if (_be.IsReady() && te.LSIsValidTarget(_be.Range + _bw.Range) && _player.LSDistance(te) > _q.Range)
                    {
                        var predE = _be.GetPrediction(te, true);
                        if (predE.Hitchance >= HitChance.High)
                        {
                            _be.Cast(predE.CastPosition.LSExtend(_player.ServerPosition, -50));
                        }
                    }
                }

                if (getCheckBoxItem(comboMenu, "UseQBCombo"))
                {
                    var tbq = TargetSelector.GetTarget(_bq.Range, DamageType.Magical);
                    if (_bq.IsReady() && t.LSIsValidTarget(_bq.Range))
                    {
                        _bq.CastIfHitchanceEquals(tbq, HitChance.High);
                    }
                }

                if (getCheckBoxItem(comboMenu, "UseWCombo"))
                {
                    var tw = TargetSelector.GetTarget(_w.Range, DamageType.Physical);
                    if (_w.IsReady() && tw.LSIsValidTarget(_w.Range) && !_bq.IsReady())
                    {
                        _bw.Cast(t);
                    }
                }
            }

            if (!IsBurrowed())
            {
                if (getCheckBoxItem(comboMenu, "UseQCombo"))
                {
                    var tq = TargetSelector.GetTarget(_q.Range, DamageType.Physical);
                    if (_q.IsReady() && tq.LSIsValidTarget(_q.Range))
                    {
                        _q.Cast(t);
                    }
                }

                if (getCheckBoxItem(comboMenu, "UseECombo"))
                {
                    var te = TargetSelector.GetTarget(_e.Range, DamageType.Physical);
                    if (te.LSIsValidTarget(_e.Range) && _e.IsReady())
                    {
                        if (reksaifury && !Qactive(_player))
                        {
                            _e.Cast(te);
                        }
                        else if (_player.Mana < 100 && t.Health <= EDamage(t))
                        {
                            _e.Cast(te);
                        }
                        else if (_player.Mana == 100 && t.Health <= EDamagetrue(t))
                        {
                            _e.Cast(te);
                        }
                        else if (t.Health <= ComboDamage(t))
                        {
                            _e.Cast(te);
                        }
                    }
                }

                if (getCheckBoxItem(comboMenu, "UseWCombo") && _w.IsReady())
                {
                    var tw = TargetSelector.GetTarget(_bq.Range, DamageType.Physical);
                    if (!_q.IsReady() && !tw.LSIsValidTarget(_e.Range) && tw.LSIsValidTarget(_bq.Range) && !Qactive(_player))
                    {
                        _w.Cast();
                    }
                }
            }
        }
Esempio n. 33
0
        private void Harass()
        {
            AIHeroClient target = LeagueSharp.Common.TargetSelector.GetTarget(200, LeagueSharp.Common.TargetSelector.DamageType.Magical);
            float        perc   = config.Item("minmanaH", true).GetValue <Slider>().Value / 100f;

            if (player.Mana < player.MaxMana * perc || target == null)
            {
                return;
            }
            if (config.Item("useqH", true).GetValue <bool>() && target.Distance(player) < 200 && Q.IsReady())
            {
                Q.Cast();
            }
        }
Esempio n. 34
0
 private static void AfterAttack(AttackableUnit target, EventArgs args)
 {
     TTTar = target;
     if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
     {
         if (HasItem())
         {
             CastItem();
         }
         else if (R2BadaoStyle && R.IsReady() && R.Instance.Name == R2name && Qstate == 3)
         {
             if (target is Obj_AI_Base)
             {
                 R.Cast(target as Obj_AI_Base);
             }
             if (Q.IsReady())
             {
                 Utility.DelayAction.Add(150, () => callbackQ(TTTar));
             }
         }
         else if (W.IsReady() && InWRange(target))
         {
             W.Cast();
             if (Q.IsReady())
             {
                 Utility.DelayAction.Add(150, () => callbackQ(TTTar));
             }
         }
         else if (Q.IsReady())
         {
             callbackQ(TTTar);
         }
         else if (E.IsReady() && Ecombo)
         {
             E.Cast(target.Position);
         }
     }
     if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
     {
         if (HasItem() && UseTiamatClear)
         {
             CastItem();
         }
         else if (W.IsReady() && InWRange(target) && UseWClear)
         {
             W.Cast();
             if (Q.IsReady() && UseQClear)
             {
                 Utility.DelayAction.Add(150, () => callbackQ(TTTar));
             }
         }
         else if (Q.IsReady() && UseQClear)
         {
             callbackQ(TTTar);
         }
         else if (E.IsReady() && UseEClear)
         {
             E.Cast(target.Position);
         }
     }
     if (doBurst)
     {
         if (HasItem())
         {
             CastItem();
             if (R.IsReady() && R.Instance.Name == R2name)
             {
                 if (target is AIHeroClient)
                 {
                     callbackR2(TTTar);
                 }
                 if (Q.IsReady())
                 {
                     Utility.DelayAction.Add(150, () => callbackQ(TTTar));
                 }
             }
             else if (Q.IsReady())
             {
                 callbackQ(TTTar);
             }
         }
         else if (R.IsReady() && R.Instance.Name == R2name)
         {
             if (target is AIHeroClient)
             {
                 R.Cast(target as AIHeroClient);
             }
             if (Q.IsReady())
             {
                 Utility.DelayAction.Add(150, () => callbackQ(TTTar));
             }
         }
         else if (W.IsReady() && InWRange(target))
         {
             W.Cast();
             if (Q.IsReady())
             {
                 Utility.DelayAction.Add(150, () => callbackQ(TTTar));
             }
         }
         else if (Q.IsReady())
         {
             callbackQ(TTTar);
         }
         else if (E.IsReady() && Ecombo)
         {
             E.Cast(target.Position);
         }
     }
     if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
     {
         if (HasItem())
         {
             CastItem();
         }
         else if (W.IsReady() && InWRange(target))
         {
             W.Cast();
             if (Q.IsReady())
             {
                 Utility.DelayAction.Add(150, () => callbackQ(TTTar));
             }
         }
         else if (Q.IsReady())
         {
             Q.Cast(target.Position);
         }
         else if (E.IsReady())
         {
             E.Cast(target.Position);
         }
     }
 }
Esempio n. 35
0
        private void Game_OnUpdate(EventArgs args)
        {
            _r.Range = _r.Level * 300;

            if (!ObjectManager.Player.IsDead)
            {
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                {
                    if (getCheckBoxItem(comboMenu, "qCombo"))
                    {
                        if (_q.IsReady())
                        {
                            if (!HeroManager.Enemies.Any(Orbwalking.InAutoAttackRange))
                            {
                                var target = TargetSelector.GetTarget(_q.Range, _q.DamageType);
                                if (target != null)
                                {
                                    _q.CastOnUnit(target);
                                }
                            }
                        }
                    }

                    if (getCheckBoxItem(comboMenu, "wCombo"))
                    {
                        if (_w.IsReady())
                        {
                            if (ObjectManager.Player.CountEnemiesInRange(1000f) >= 1)
                            {
                                _w.Cast();
                            }
                        }
                    }

                    if (getCheckBoxItem(comboMenu, "rCombo"))
                    {
                        if (_r.IsReady())
                        {
                            var target =
                                HeroManager.Enemies.FirstOrDefault(
                                    x =>
                                    x.IsValidTarget(_r.Range) && !x.IsFacing(ObjectManager.Player) &&
                                    !x.HasBuff("bantamtraptarget") &&
                                    _r.GetPrediction(x).Hitchance >= _r.MinHitChance);
                            if (target != null)
                            {
                                _r.Cast(target, false, true);
                            }
                        }
                    }
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
                {
                    if (getCheckBoxItem(harassMenu, "qHarass"))
                    {
                        if (_q.IsReady())
                        {
                            if (!HeroManager.Enemies.Any(Orbwalking.InAutoAttackRange))
                            {
                                var target = TargetSelector.GetTarget(_q.Range, _q.DamageType);
                                if (target != null)
                                {
                                    _q.CastOnUnit(target);
                                }
                            }
                        }
                    }
                }

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
                {
                    //Laneclear
                    if (getCheckBoxItem(laneClearMenu, "qClear"))
                    {
                        if (ObjectManager.Player.ManaPercent >= getSliderItem(laneClearMenu, "clearMana"))
                        {
                            if (_q.IsReady())
                            {
                                var target =
                                    MinionManager.GetMinions(_q.Range)
                                    .FirstOrDefault(
                                        x =>
                                        x.IsKillableAndValidTarget(_q.GetDamage(x), DamageType.Magical, _q.Range) &&
                                        (x.CharData.BaseSkinName.Contains("siege") ||
                                         x.CharData.BaseSkinName.Contains("super")));
                                if (target != null)
                                {
                                    _q.CastOnUnit(target);
                                }
                            }
                        }
                    }

                    //Jungleclear
                    if (getCheckBoxItem(jungleMenu, "qJungle"))
                    {
                        if (ObjectManager.Player.ManaPercent >= getSliderItem(jungleMenu, "jungleMana"))
                        {
                            if (_q.IsReady())
                            {
                                var target =
                                    MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral,
                                                             MinionOrderTypes.MaxHealth).FirstOrDefault(x => x.IsValidTarget(600));
                                if (target != null)
                                {
                                    _q.CastOnUnit(target);
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 36
0
        private static void Interrupter2_OnInterruptableTarget(AIHeroClient sender,
                                                               Interrupter2.InterruptableTargetEventArgs args)
        {
            if (sender.LSIsValidTarget(1000f) && args.DangerLevel == Interrupter2.DangerLevel.High && _e.IsReady())
            {
                _r.Cast();

                if (!_r.IsReady())
                {
                    _e.Cast(ObjectManager.Player);
                }
            }
        }
Esempio n. 37
0
        private static void Game_OnUpdate(EventArgs args)
        {
            var vTarget = TargetSelector.GetTarget(Q.Range, DamageType.Magical);

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
            {
                JungleFarm();
                WaveClear();
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                if (vTarget == null)
                {
                    return;
                }
                if (getCheckBoxItem(comboMenu, "UseQ") && Q.IsReady() && (System.Environment.TickCount - LastMove > 50))
                {
                    Qcast(vTarget);
                    LastMove = System.Environment.TickCount;
                }

                if (E.IsReady() && Player.LSDistance(vTarget) <= E.Range && getCheckBoxItem(comboMenu, "UseE") &&
                    (System.Environment.TickCount - LastMove > 50))
                {
                    E.Cast(vTarget, true);
                    LastMove = System.Environment.TickCount;
                }

                if (getCheckBoxItem(comboMenu, "UseW") && W.IsReady() && (System.Environment.TickCount - LastMove > 50))
                {
                    W.Cast();
                    LastMove = System.Environment.TickCount;
                }

                if (getCheckBoxItem(comboMenu, "UseR") && R.IsReady() && GetCDamage(vTarget) >= vTarget.Health &&
                    (System.Environment.TickCount - LastMove > 50))
                {
                    R.Cast(vTarget);
                    LastMove = System.Environment.TickCount;
                }
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                if (vTarget == null)
                {
                    return;
                }
                if (getCheckBoxItem(harassMenu, "UseQH") && Q.IsReady())
                {
                    Qcast(vTarget);
                }

                if (getCheckBoxItem(harassMenu, "UseEH") && E.IsReady() && Player.LSDistance(vTarget) <= E.Range)
                {
                    E.Cast(vTarget, true);
                }
            }

            if (getCheckBoxItem(comboMenu, "AutoB") && Bomb != null)
            {
                foreach (var hero in ObjectManager.Get <AIHeroClient>().Where(hero => hero.IsEnemy && hero.LSDistance(Bomb.Position) <= 300))
                {
                    Qcast(hero);
                }
            }

            AIHeroClient target = TargetSelector.GetTarget(1300, DamageType.Magical);

            if (getKeyBindItem(comboMenu, "Insec"))
            {
                if (target == null)
                {
                    EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
                    return;
                }
                CastE(target);
                if (savedQ != null)
                {
                    if (savedQ != null && !SimpleQ && target.LSDistance(Player) < R.Range - 100 && target.Position.LSDistance(savedQ.position) < 550 + QExplosionRange / 2)
                    {
                        HandeR(target, savedQ.position, true);
                    }
                }
                else
                {
                    castInsec(target);
                }
            }
        }
Esempio n. 38
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (Player.LSIsRecalling())
            {
                return;
            }

            if (Player.IsZombie)
            {
                if (getCheckBoxItem(miscMenu, "autoZombie"))
                {
                    Orbwalker.ActiveModesFlags = Player.LSCountEnemiesInRange(Q.Range) > 0 ? Orbwalker.ActiveModes.Combo : Orbwalker.ActiveModes.LaneClear;
                }
                if (R.IsReady() && getCheckBoxItem(rMenu, "autoRzombie"))
                {
                    float timeDeadh = 8;
                    timeDeadh = OktwCommon.GetPassiveTime(Player, "KarthusDeathDefiedBuff");
                    Program.debug("Time " + timeDeadh);
                    if (timeDeadh < 4)
                    {
                        foreach (var target in Program.Enemies.Where(target => target.LSIsValidTarget() && OktwCommon.ValidUlt(target)))
                        {
                            var rDamage = R.GetDamage(target);
                            if (target.Health < 3 * rDamage && target.CountAlliesInRange(800) > 0)
                            {
                                R.Cast();
                            }
                            if (target.Health < rDamage * 1.5 && target.LSDistance(Player.Position) < 900)
                            {
                                R.Cast();
                            }
                            if (target.Health + target.HPRegenRate * 5 < rDamage)
                            {
                                R.Cast();
                            }
                        }
                    }
                }
            }

            if (Program.LagFree(0))
            {
                SetMana();
                Jungle();
            }
            if (Program.LagFree(1) && Q.IsReady() && getCheckBoxItem(qMenu, "autoQ"))
            {
                LogicQ();
            }
            if (Program.LagFree(2) && E.IsReady() && getCheckBoxItem(eMenu, "autoE"))
            {
                LogicE();
            }
            if (Program.LagFree(3) && R.IsReady())
            {
                LogicR();
            }
            if (Program.LagFree(4) && W.IsReady() && getCheckBoxItem(wMenu, "autoW"))
            {
                LogicW();
            }
        }
Esempio n. 39
0
 private static void Combo()
 {
     if (IgniteSlot != SpellSlot.Unknown && IgniteSlot.IsReady() && Menu.Item("UseIgniteC").GetValue <bool>())
     {
         var t = TargetSelector.GetTarget(600, TargetSelector.DamageType.True);
         if (t != null)
         {
             if (t.Health < ComboDmg(t))
             {
                 Player.Spellbook.CastSpell(IgniteSlot, t);
             }
         }
     }
     if (Q.IsReady() && Menu.Item("UseQC").GetValue <bool>())
     {
         var t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
         if (t != null)
         {
             if (EloBuddy.Player.Instance.IsInAutoAttackRange(t))
             {
                 Q.Cast(t);
             }
             else if (!Menu.Item("UseQinAA").GetValue <bool>())
             {
                 Q.Cast(t);
             }
         }
     }
     if (W.IsReady() && Menu.Item("UseWC").GetValue <bool>())
     {
         var t = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Magical);
         if (t != null)
         {
             if (t.Path.Count() < 2)
             {
                 if (t.HasBuffOfType(BuffType.Slow))
                 {
                     if (W.GetPrediction(t).Hitchance >= HitChance.VeryHigh)
                     {
                         if (W.Cast(t) == Spell.CastStates.SuccessfullyCasted)
                         {
                             return;
                         }
                     }
                 }
                 if (t.CountEnemiesInRange(250) > 2)
                 {
                     if (W.GetPrediction(t).Hitchance >= HitChance.VeryHigh)
                     {
                         if (W.Cast(t) == Spell.CastStates.SuccessfullyCasted)
                         {
                             return;
                         }
                     }
                 }
                 if (Player.Position.Distance(t.ServerPosition) < Player.Position.Distance(t.Position))
                 {
                     if (W.Cast(t) == Spell.CastStates.SuccessfullyCasted)
                     {
                         return;
                     }
                 }
                 else
                 {
                     if (W.Cast(t) == Spell.CastStates.SuccessfullyCasted)
                     {
                         return;
                     }
                 }
             }
         }
     }
     if (E.IsReady() && Menu.Item("UseEC").GetValue <bool>())
     {
         var hitchance = (HitChance)(Menu.Item("PredEC").GetValue <StringList>().SelectedIndex + 3);
         var t         = TargetSelector.GetTarget(ECastRange + E.Range, TargetSelector.DamageType.Magical);
         if (t != null)
         {
             CastE(t, hitchance);
         }
     }
     if (R.IsReady() && Menu.Item("UseRC").GetValue <bool>() && R.Instance.Name == "ViktorChaosStorm")
     {
         var t = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);
         if (t != null)
         {
             if (t.Health < ComboDmg(t) && t.HealthPercent > 5)
             {
                 LeagueSharp.Common.Utility.DelayAction.Add(100, () => R.Cast(t, false, true));
             }
         }
         foreach (var unit in HeroManager.Enemies.Where(h => h.IsValidTargetLS(R.Range)))
         {
             R.CastIfWillHit(unit, Menu.Item("HitRC").GetValue <Slider>().Value);
         }
     }
 }
Esempio n. 40
0
        private void AutoWardLogic()
        {
            foreach (var enemy in Program.Enemies)
            {
                if (enemy.IsHPBarRendered)
                {
                    return;
                }
                var need = OKTWtracker.ChampionInfoList.Find(x => x.NetworkId == enemy.NetworkId);
                if (need == null || need.PredictedPos == null)
                {
                    continue;
                }


                var PPDistance = need.PredictedPos.Distance(Player.Position);

                if (PPDistance > 1400)
                {
                    continue;
                }

                var timer = Game.Time - need.LastVisableTime;

                if (timer > 1 && timer < 3)
                {
                    if (Program.Combo && PPDistance < 900 && Player.ChampionName == "Karthus" && Q.IsReady() && Player.CountEnemiesInRange(900) == 0)
                    {
                        Q.Cast(need.PredictedPos);
                    }

                    if (Program.Combo && PPDistance < 1400 && Player.ChampionName == "Ashe" && E.IsReady() && Player.CountEnemiesInRange(800) == 0 && PortAIO.Champion.Ashe.Program.getAutoE())
                    {
                        E.Cast(Player.Position.Extend(need.PredictedPos, 5000));
                    }

                    if (PPDistance < 800 && Player.ChampionName == "MissFortune" && E.IsReady() && Program.Combo &&
                        Player.Mana > 200)
                    {
                        E.Cast(Player.Position.Extend(need.PredictedPos, 800));
                    }

                    if (!Orbwalker.IsAutoAttacking && PPDistance < 800 && Player.ChampionName == "Caitlyn" && W.IsReady() && Player.Mana > 200f && PortAIO.Champion.Caitlyn.Program.getBushW() && Utils.TickCount - W.LastCastAttemptT > 2000)
                    {
                        W.Cast(need.PredictedPos);
                    }
                }


                if (timer < 4)
                {
                    if (getCheckBoxItem("AutoWardCombo") && Program.AIOmode != 2 && !Program.Combo)
                    {
                        return;
                    }
                    if (NavMesh.IsWallOfGrass(need.PredictedPos, 0))
                    {
                        if (PPDistance < 600 && getCheckBoxItem("AutoWard"))
                        {
                            if (TrinketN.IsReady())
                            {
                                TrinketN.Cast(need.PredictedPos);
                                need.LastVisableTime = Game.Time - 5;
                            }
                            else if (RSightStone.IsReady())
                            {
                                RSightStone.Cast(need.PredictedPos);
                                need.LastVisableTime = Game.Time - 5;
                            }
                            else if (SightStone.IsReady())
                            {
                                SightStone.Cast(need.PredictedPos);
                                need.LastVisableTime = Game.Time - 5;
                            }
                            else if (EOTOasis.IsReady())
                            {
                                EOTOasis.Cast(need.PredictedPos);
                                need.LastVisableTime = Game.Time - 5;
                            }
                            else if (EOTEquinox.IsReady())
                            {
                                EOTEquinox.Cast(need.PredictedPos);
                                need.LastVisableTime = Game.Time - 5;
                            }
                            else if (EOTWatchers.IsReady())
                            {
                                EOTWatchers.Cast(need.PredictedPos);
                                need.LastVisableTime = Game.Time - 5;
                            }
                        }

                        if (getCheckBoxItem("AutoWardBlue"))
                        {
                            if (FarsightOrb.IsReady())
                            {
                                FarsightOrb.Cast(need.PredictedPos);
                                need.LastVisableTime = Game.Time - 5;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 41
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (Player.HasBuff("Recall"))
            {
                return;
            }

            HaveStun = Player.HasBuff("pyromania_particle");

            SetMana();

            if (R.IsReady() && (SebbyLib.Program.LagFree(1) || SebbyLib.Program.LagFree(3)) && !HaveTibers)
            {
                var realRange = R.Range;

                if (flash.IsReady())
                {
                    realRange = FR.Range;
                }

                foreach (
                    var enemy in
                    SebbyLib.Program.Enemies.Where(
                        enemy => enemy.LSIsValidTarget(realRange) && OktwCommon.ValidUlt(enemy)))
                {
                    if (enemy.LSIsValidTarget(R.Range))
                    {
                        var Rmode = getSliderItem(RMenu, "UM" + enemy.NetworkId);

                        if (Rmode == 2)
                        {
                            continue;
                        }

                        var poutput  = R.GetPrediction(enemy, true);
                        var aoeCount = poutput.AoeTargetsHitCount;

                        if (Rmode == 1)
                        {
                            R.Cast(enemy);
                        }

                        if (Rmode == 3 && HaveStun)
                        {
                            R.Cast(enemy);
                        }

                        if (aoeCount >= getSliderItem(RMenu, "rCount") && getSliderItem(RMenu, "rCount") > 0)
                        {
                            R.Cast(enemy);
                        }
                        else if (SebbyLib.Program.Combo && HaveStun && getCheckBoxItem(RMenu, "autoRcombo"))
                        {
                            R.Cast(enemy);
                        }
                        else if (getCheckBoxItem(RMenu, "autoRks"))
                        {
                            var comboDmg = OktwCommon.GetKsDamage(enemy, R);

                            if (W.IsReady() && RMANA + WMANA < Player.Mana)
                            {
                                comboDmg += W.GetDamage(enemy);
                            }

                            if (Q.IsReady() && RMANA + WMANA + QMANA < Player.Mana)
                            {
                                comboDmg += Q.GetDamage(enemy);
                            }

                            if (enemy.Health < comboDmg)
                            {
                                R.Cast(poutput.CastPosition);
                            }
                        }
                    }
                    else if (HaveStun && flash.IsReady())
                    {
                        var poutputFlas   = FR.GetPrediction(enemy, true);
                        var aoeCountFlash = poutputFlas.AoeTargetsHitCount;
                        if (HaveStun && aoeCountFlash >= getSliderItem(RMenu, "rCountFlash") &&
                            getSliderItem(RMenu, "rCountFlash") > 0)
                        {
                            Player.Spellbook.CastSpell(flash, poutputFlas.CastPosition);
                            R.Cast(poutputFlas.CastPosition);
                        }
                    }
                }
            }

            var t = TargetSelector.GetTarget(Q.Range, DamageType.Magical);

            if (t.LSIsValidTarget() && SebbyLib.Program.LagFree(2))
            {
                if (Q.IsReady() && getCheckBoxItem(QMenu, "autoQ"))
                {
                    if (SebbyLib.Program.Combo && RMANA + WMANA < Player.Mana)
                    {
                        Q.Cast(t);
                    }
                    else if (SebbyLib.Program.Farm && RMANA + WMANA + QMANA < Player.Mana &&
                             getCheckBoxItem(QMenu, "harrasQ"))
                    {
                        Q.Cast(t);
                    }
                    else
                    {
                        var qDmg = OktwCommon.GetKsDamage(t, Q);
                        var wDmg = W.GetDamage(t);
                        if (qDmg > t.Health)
                        {
                            Q.Cast(t);
                        }
                        else if (qDmg + wDmg > t.Health && Player.Mana > QMANA + WMANA)
                        {
                            Q.Cast(t);
                        }
                    }
                }
                if (W.IsReady() && SebbyLib.Program.LagFree(2) && getCheckBoxItem(WMenu, "autoW") &&
                    t.LSIsValidTarget(W.Range))
                {
                    var poutput = W.GetPrediction(t, true);

                    if (SebbyLib.Program.Combo && RMANA + WMANA < Player.Mana)
                    {
                        W.Cast(poutput.CastPosition);
                    }
                    else if (SebbyLib.Program.Farm && RMANA + WMANA + QMANA < Player.Mana &&
                             getCheckBoxItem(WMenu, "harrasW"))
                    {
                        W.Cast(poutput.CastPosition);
                    }
                    else
                    {
                        var wDmg = OktwCommon.GetKsDamage(t, W);
                        var qDmg = Q.GetDamage(t);
                        if (wDmg > t.Health)
                        {
                            W.Cast(poutput.CastPosition);
                        }
                        else if (qDmg + wDmg > t.Health && Player.Mana > QMANA + WMANA)
                        {
                            W.Cast(poutput.CastPosition);
                        }
                    }
                }
            }
            else if (Q.IsReady() || W.IsReady())
            {
                if (getCheckBoxItem(FarmMenu, "farmQ"))
                {
                    if (SebbyLib.Program.getCheckBoxItem("supportMode"))
                    {
                        if (SebbyLib.Program.LaneClear && Player.Mana > RMANA + QMANA)
                        {
                            farm();
                        }
                    }
                    else
                    {
                        if ((!HaveStun || SebbyLib.Program.LaneClear) && SebbyLib.Program.Farm)
                        {
                            farm();
                        }
                    }
                }
            }

            if (SebbyLib.Program.LagFree(3))
            {
                if (!HaveStun)
                {
                    if (E.IsReady() && !SebbyLib.Program.LaneClear && getCheckBoxItem(EMenu, "autoE") &&
                        Player.Mana > RMANA + EMANA + QMANA + WMANA)
                    {
                        E.Cast();
                    }
                    else if (W.IsReady() && Player.InFountain())
                    {
                        W.Cast(Player.Position);
                    }
                }
                if (R.IsReady())
                {
                    if (getCheckBoxItem(RMenu, "tibers") && HaveTibers && Tibbers != null && Tibbers.IsValid)
                    {
                        var enemy =
                            SebbyLib.Program.Enemies.Where(
                                x => x.LSIsValidTarget() && Tibbers.LSDistance(x.Position) < 1000 && !x.UnderTurret(true))
                            .OrderBy(x => x.LSDistance(Tibbers))
                            .FirstOrDefault();
                        if (enemy != null)
                        {
                            EloBuddy.Player.IssueOrder(Tibbers.LSDistance(enemy.Position) > 200 ? GameObjectOrder.MovePet : GameObjectOrder.AutoAttackPet, enemy);
                        }
                        else
                        {
                            var annieTarget = Orbwalker.LastTarget as Obj_AI_Base;
                            if (annieTarget != null)
                            {
                                EloBuddy.Player.IssueOrder(
                                    Tibbers.LSDistance(annieTarget.Position) > 200
                                        ? GameObjectOrder.MovePet
                                        : GameObjectOrder.AutoAttackPet, annieTarget);
                            }
                            else if (Tibbers.UnderTurret(true))
                            {
                                EloBuddy.Player.IssueOrder(GameObjectOrder.MovePet, Player);
                            }
                        }
                    }
                    else
                    {
                        Tibbers = null;
                    }
                }
            }
        }
Esempio n. 42
0
        private static void Combo(bool useq, bool usew, bool user)
        {
            if (useq && _q.IsReady())
            {
                var qtarget = TargetSelector.GetTarget(_q.Range, DamageType.Magical);
                if (qtarget.IsValidTarget())
                {
                    var poutput = _q.GetPrediction(qtarget);
                    if (poutput.Hitchance >= (HitChance)getSliderItem(menuQ, "hitchanceq") + 2)
                    {
                        _q.Cast(poutput.CastPosition);
                    }
                }
            }

            if (usew && _w.IsReady())
            {
                var wtarget = TargetSelector.GetTarget(_w.Range + 10, DamageType.Magical);
                if (wtarget.IsValidTarget())
                {
                    if (!getCheckBoxItem(menuW, "waitfor") || _mw * 1 >= wtarget.Health)
                    {
                        var poutput = _w.GetPrediction(wtarget);
                        if (poutput.Hitchance >= (HitChance)getSliderItem(menuW, "hitchancew") + 2)
                        {
                            _w.Cast(poutput.CastPosition);
                        }
                    }
                }
            }

            if (user && _r.IsReady())
            {
                var ticks = getSliderItem(menuW, "calcw");

                var rtarget = TargetSelector.GetTarget(_r.Range, DamageType.Magical);
                if (rtarget.IsValidTarget() && getCheckBoxItem(menuR, "rkill"))
                {
                    if (_mr + _mq + _mw * ticks + _ma * 3 + _mi + _guise >= rtarget.Health)
                    {
                        if (rtarget.Health > _mr + _ma * 2 + _mw * 2 && !rtarget.IsZombie)
                        {
                            if (_e.IsReady())
                            {
                                _e.CastOnUnit(Me);
                            }
                            _r.Cast();
                        }
                    }

                    if (Me.CountEnemiesInRange(_r.Range) >= getSliderItem(menuR, "rcount"))
                    {
                        if (_e.IsReady())
                        {
                            _e.CastOnUnit(Me);
                        }

                        _r.Cast();
                    }
                }
            }
        }
Esempio n. 43
0
File: Jhin.cs Progetto: riwalry1/AIO
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if (!ComboActive)
            {
                var t = TargetSelector.GetTarget(W.Range, DamageType.Physical);
                if (!t.LSIsValidTarget() || !W.IsReady())
                {
                    return;
                }

                if (Program.harass["UseWTH"].Cast <KeyBind>().CurrentValue)
                {
                    if (ObjectManager.Player.HasBuff("Recall"))
                    {
                        return;
                    }
                    W.Cast(t);
                }

                if (t.HasBuffOfType(BuffType.Stun) || t.HasBuffOfType(BuffType.Snare) || t.HasBuffOfType(BuffType.Charm) ||
                    t.HasBuffOfType(BuffType.Fear) || t.HasBuffOfType(BuffType.Taunt) ||
                    t.HasBuff("zhonyasringshield") || t.HasBuff("Recall") && !IsActive(ObjectManager.Player, R))
                {
                    W.Cast(t.Position);
                }
            }

            /* [ Combo ] */
            if (ComboActive)
            {
                var useW = Program.combo["UseWC"].Cast <CheckBox>().CurrentValue;

                var t = TargetSelector.GetTarget(W.Range, DamageType.Physical);

                if (Q.IsReady() && JhinQCastReady)
                {
                    if (t.LSIsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 90))
                    {
                        Q.Cast();
                    }
                }

                if (useW && W.IsReady() && t.LSIsValidTarget() && !IsActive(ObjectManager.Player, R))
                {
                    W.Cast(t);
                }

                var useR = Program.combo["UseRC"].Cast <CheckBox>().CurrentValue;
                if (useR && R.IsReady())
                {
                    var minRRange = Program.combo["UseRCMinRange"].Cast <Slider>().CurrentValue;
                    var maxRRange = Program.combo["UseRCMaxRange"].Cast <Slider>().CurrentValue;

                    t = TargetSelector.GetTarget(maxRRange, DamageType.Physical);
                    if (!t.LSIsValidTarget())
                    {
                        return;
                    }

                    var aaDamage = Orbwalking.InAutoAttackRange(t) ? ObjectManager.Player.LSGetAutoAttackDamage(t, true) : 0;

                    if (t.Health > aaDamage && t.Health <= ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.R) && ObjectManager.Player.LSDistance(t) >= minRRange)
                    {
                        R.Cast(t);
                    }
                }
            }

            //Harass
            if (HarassActive)
            {
                var target = TargetSelector.GetTarget(1200, DamageType.Physical);
                if (target == null)
                {
                    return;
                }

                if (Program.harass["UseWH"].Cast <CheckBox>().CurrentValue&& W.IsReady())
                {
                    W.Cast(target);
                }
            }

            //Manual cast R
            if (Program.misc["RManualCast"].Cast <KeyBind>().CurrentValue)
            {
                var rTarget = TargetSelector.GetTarget(2000, DamageType.Physical);
                R.Cast(rTarget);
            }
        }
Esempio n. 44
0
        private static void OnGameUpdate(EventArgs args)
        {
            try
            {
                if (Player.IsDead)
                {
                    return;
                }
                var QTarget = TargetSelector.GetTarget(_Q.Range, DamageType.Magical);
                var WTarget = TargetSelector.GetTarget(_W.Range, DamageType.Magical);
                var ETarget = TargetSelector.GetTarget(_E.Range, DamageType.Magical);
                var RTarget = TargetSelector.GetTarget(_E.Range, DamageType.Magical);

                var KTarget = ObjectManager.Get <AIHeroClient>().OrderBy(x => x.Health).FirstOrDefault(x => x.IsEnemy && Player.LSDistance(x) < 900);
                //KillSteal
                if (KTarget != null && !KTarget.IsDead && KTarget.IsEnemy && KTarget.Health > 0)
                {
                    if (getCheckBoxItem(KillSteal, "Veigar_KseQ") && _Q.IsReady() && KTarget.Health < _Q.GetDamage(KTarget) && KTarget.LSDistance(Player) <= _Q.Range)
                    {
                        _Q.CastIfHitchanceEquals(KTarget, Hitchance("Veigar_CUseQ_Hit"), true);
                        return;
                    }
                    if (getCheckBoxItem(KillSteal, "Veigar_KseR") && _R.IsReady() && KTarget.Health < getRDam(KTarget) && KTarget.LSDistance(Player) <= _R.Range)
                    {
                        _R.Cast(KTarget, true);
                        return;
                    }

                    if (getCheckBoxItem(KillSteal, "Veigar_KseW") && _W.IsReady() && !KTarget.CanMove && KTarget.Health < _W.GetDamage(KTarget) && KTarget.LSDistance(Player) <= _W.Range)
                    {
                        _W.CastIfHitchanceEquals(KTarget, LeagueSharp.Common.HitChance.VeryHigh, true);
                        return;
                    }
                }

                //Combo
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                {
                    if (getCheckBoxItem(Combo, "Veigar_CUseE") && ETarget != null && _E.IsReady())
                    {
                        switch (getBoxItem(Combo, "Veigar_CEMode"))
                        {
                        case 0:
                            SpellUseE(ETarget);
                            break;

                        case 1:
                            CastE(ETarget);
                            break;

                        default:
                            SpellUseE(ETarget);
                            break;
                        }
                    }
                    if (getCheckBoxItem(Combo, "Veigar_CUseW") && WTarget != null && _W.IsReady())
                    {
                        _W.CastIfHitchanceEquals(WTarget, LeagueSharp.Common.HitChance.VeryHigh, true);
                        return;
                    }
                    if (getCheckBoxItem(Combo, "Veigar_CUseQ") && QTarget != null && _Q.IsReady())
                    {
                        _Q.CastIfHitchanceEquals(QTarget, Hitchance("Veigar_CUseQ_Hit"), true);
                        return;
                    }

                    if (getCheckBoxItem(Combo, "Veigar_CUseR_Select") && getCheckBoxItem(Combo, "Veigar_CUseR") && _R.IsReady() && KTarget.Health < getRDam(KTarget) && KTarget.LSDistance(Player) <= _R.Range)
                    {
                        _R.Cast(KTarget, true);
                        return;
                    }

                    if (getCheckBoxItem(Combo, "Veigar_CUseR_Select"))
                    {
                        return;
                    }

                    if (getCheckBoxItem(Combo, "Veigar_CUseR") && RTarget != null && _R.IsReady())
                    {
                        _R.Cast(RTarget, true);
                        return;
                    }
                }

                //Harass
                if ((Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass) || getKeyBindItem(Harass, "Veigar_AutoHUseQ")) && getSliderItem(Harass, "Veigar_HManarate") < Player.ManaPercent)
                {
                    if (getCheckBoxItem(Harass, "Veigar_HUseE") && ETarget != null && _E.IsReady() && !ETarget.CanMove)
                    {
                        SpellUseE(ETarget);
                    }
                    if (getCheckBoxItem(Harass, "Veigar_HUseW") && WTarget != null && _W.IsReady() && !WTarget.CanMove)
                    {
                        _W.CastIfHitchanceEquals(WTarget, LeagueSharp.Common.HitChance.VeryHigh, true);
                        return;
                    }
                    if (getCheckBoxItem(Harass, "Veigar_HUseQ") && QTarget != null && _Q.IsReady())
                    {
                        _Q.CastIfHitchanceEquals(QTarget, Hitchance("Veigar_CUseQ_Hit"), true);
                        return;
                    }
                }

                // Last Hit
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit))
                {
                    if (getCheckBoxItem(LastHit, "Veigar_LHUseQ") && _Q.IsReady())
                    {
                        LastHitQ();
                    }
                }

                //LaneClear
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear) && getSliderItem(LaneClear, "Veigar_LManarate") < Player.ManaPercent)
                {
                    var MinionsTarget = MinionManager.GetMinions(900, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health);
                    foreach (var item in MinionsTarget)
                    {
                        if (getCheckBoxItem(LaneClear, "Veigar_LUseQ"))
                        {
                            if (getCheckBoxItem(LaneClear, "Veigar_LUseQSet"))
                            {
                                //_Q.CastIfHitchanceEquals(item, LeagueSharp.Common.HitChance.High, true);
                                LastHitQ();
                                return;
                            }
                            if (!getCheckBoxItem(LaneClear, "Veigar_LUseQSet"))
                            {
                                _Q.CastIfHitchanceEquals(item, LeagueSharp.Common.HitChance.High, true);
                                return;
                            }
                        }
                    }

                    var MonsterTarget = MinionManager.GetMinions(900, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.Health);
                    foreach (var item in MonsterTarget)
                    {
                        if (getCheckBoxItem(JungleClear, "Veigar_JUseQ"))
                        {
                            if (getCheckBoxItem(JungleClear, "Veigar_JUseQSet"))
                            {
                                //_Q.CastIfHitchanceEquals(item, LeagueSharp.Common.HitChance.Low, true);
                                LastHitQ();
                                return;
                            }
                            if (!getCheckBoxItem(JungleClear, "Veigar_JUseQSet"))
                            {
                                _Q.CastIfHitchanceEquals(item, LeagueSharp.Common.HitChance.Low, true);
                                return;
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                if (NowTime() > ErrorTime)
                {
                    //Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 06");
                    ErrorTime = TickCount(10000);
                }
            }
        }
Esempio n. 45
0
        private void OnUpdate(EventArgs args)
        {
            if (Range && E.IsReady() && Utils.TickCount - Etick < 250 + Game.Ping)
            {
                E.Cast(EcastPos);
            }

            if (Config.Item("flee", true).GetValue <KeyBind>().Active)
            {
                FleeMode();
            }

            if (Range)
            {
                if (Config.Item("autoWmove", true).GetValue <bool>() && Orbwalker.GetTarget() != null && Player.HasBuff("jaycehyperchargevfx"))
                {
                    LeagueSharp.Common.Orbwalking.Move = false;
                }
                else
                {
                    LeagueSharp.Common.Orbwalking.Move = true;
                }

                if (Program.LagFree(1) && Q.IsReady() && Config.Item("autoQ", true).GetValue <bool>())
                {
                    LogicQ();
                }

                if (Program.LagFree(2) && W.IsReady() && Config.Item("autoW", true).GetValue <bool>())
                {
                    LogicW();
                }
            }
            else
            {
                if (Program.LagFree(1) && E2.IsReady() && Config.Item("autoEm", true).GetValue <bool>())
                {
                    LogicE2();
                }

                if (Program.LagFree(2) && Q2.IsReady() && Config.Item("autoQm", true).GetValue <bool>())
                {
                    LogicQ2();
                }
                if (Program.LagFree(3) && W2.IsReady() && Config.Item("autoWm", true).GetValue <bool>())
                {
                    LogicW2();
                }
            }

            if (Program.LagFree(4))
            {
                if (Program.None && Config.Item("stack", true).GetValue <bool>() && !Player.HasBuff("Recall") && Player.Mana > Player.MaxMana * 0.90 && (Items.HasItem(Tear) || Items.HasItem(Manamune)))
                {
                    if (Utils.TickCount - Q.LastCastAttemptT > 4200 && Utils.TickCount - W.LastCastAttemptT > 4200 && Utils.TickCount - E.LastCastAttemptT > 4200)
                    {
                        if (Range)
                        {
                            if (W.IsReady())
                            {
                                W.Cast();
                            }
                            else if (E.IsReady() && (Player.InFountainLS() || Player.IsMoving))
                            {
                                E.Cast(Player.ServerPosition);
                            }
                            else if (Q.IsReady() && !E.IsReady())
                            {
                                Q.Cast(Player.Position.Extend(Game.CursorPos, 500));
                            }
                            else if (R.IsReady() && Player.InFountainLS())
                            {
                                R.Cast();
                            }
                        }
                        else
                        {
                            if (W.IsReady())
                            {
                                W.Cast();
                            }
                            else if (R.IsReady() && Player.InFountainLS())
                            {
                                R.Cast();
                            }
                        }
                    }
                }

                SetValue();
                if (R.IsReady())
                {
                    LogicR();
                }
            }

            Jungle();
            LaneClearLogic();
        }
Esempio n. 46
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            _q.Width = MantraIsActive ? 80f : 60f; // Mantra increases the q line width
            _q.Range = MantraIsActive ? 1250f : 1050f;
            if (getCheckBoxItem(miscMenu, "UseEDefense"))
            {
                foreach (
                    var hero in
                    ObjectManager.Get <AIHeroClient>()
                    .Where(
                        hero =>
                        hero.LSIsValidTarget(_e.Range) && hero.IsAlly &&
                        ObjectManager.Get <AIHeroClient>()
                        .Count(h => h.LSIsValidTarget() && h.LSDistance(hero) < 400) > 1))
                {
                    _e.Cast(hero);
                }
            }

            if (!Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) &&
                !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                return;
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass) &&
                ObjectManager.Player.Mana -
                ObjectManager.Player.Spellbook.Spells.First(s => s.Slot == SpellSlot.W).SData.Mana -
                ObjectManager.Player.Spellbook.Spells.First(s => s.Slot == SpellSlot.E).SData.Mana < 0)
            {
                return;
            }


            var qTarget = TargetSelector.GetTarget(_q.Range, DamageType.Magical);
            var wTarget = TargetSelector.GetTarget(_w.Range, DamageType.Magical);

            var qActive =
                getCheckBoxItem(
                    Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ? comboMenu : harassMenu,
                    "UseQ" + (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ? "Combo" : "Harass"));
            var wActive =
                getCheckBoxItem(
                    Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ? comboMenu : harassMenu,
                    "UseW" + (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ? "Combo" : "Harass"));
            var rActive =
                getCheckBoxItem(
                    Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ? comboMenu : harassMenu,
                    "UseR" + (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ? "Combo" : "Harass"));

            if (wActive && wTarget != null && _w.IsReady())
            {
                if (ObjectManager.Player.Health / ObjectManager.Player.MaxHealth /
                    (qTarget.Health / qTarget.MaxHealth) < 1)
                {
                    if (rActive)
                    {
                        _r.Cast();
                    }

                    if (!rActive || !_r.IsReady())
                    {
                        _w.Cast(wTarget);
                    }
                }
            }

            if (qActive && qTarget != null && _q.IsReady())
            {
                if (rActive)
                {
                    _r.Cast();
                }

                if (!rActive || !_r.IsReady())
                {
                    var qPrediction = _q.GetPrediction(qTarget);
                    if (qPrediction.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
                    {
                        _q.Cast(qTarget);
                    }
                    else if (qPrediction.HitChance == EloBuddy.SDK.Enumerations.HitChance.Collision)
                    {
                        var minionsHit = qPrediction.CollisionObjects;
                        var closest    =
                            minionsHit.Where(m => m.NetworkId != ObjectManager.Player.NetworkId)
                            .OrderBy(m => m.LSDistance(ObjectManager.Player))
                            .FirstOrDefault();

                        if (closest != null && closest.LSDistance(qPrediction.UnitPosition) < 200)
                        {
                            _q.Cast(qTarget);
                        }
                    }
                }
            }

            if (wActive && wTarget != null)
            {
                _w.Cast(wTarget);
            }
        }
Esempio n. 47
0
 private static bool CastSecondW()
 {
     return(getCheckBoxItem(wMenu, "WBackHarass") &&
            Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass) &&
            W.IsReady() && !W.IsFirstW() && !Q.IsReady() && W.Cast());
 }
Esempio n. 48
0
        private void OnDraw(EventArgs args)
        {
            if (Config.Item("disableDraws").GetValue <bool>())
            {
                return;
            }

            if (Config.Item("showWards").GetValue <bool>())
            {
                var circleSize = 30;
                foreach (var obj in OKTWward.HiddenObjList.Where(obj => Render.OnScreen(Drawing.WorldToScreen(obj.pos))))
                {
                    if (obj.type == 1)
                    {
                        OktwCommon.DrawTriangleOKTW(circleSize, obj.pos, System.Drawing.Color.Yellow);
                        DrawFontTextMap(Tahoma13, "" + (int)(obj.endTime - Game.Time), obj.pos, SharpDX.Color.Yellow);
                    }

                    if (obj.type == 2)
                    {
                        OktwCommon.DrawTriangleOKTW(circleSize, obj.pos, System.Drawing.Color.HotPink);
                        DrawFontTextMap(Tahoma13, "VW", obj.pos, SharpDX.Color.HotPink);
                    }
                    if (obj.type == 3)
                    {
                        OktwCommon.DrawTriangleOKTW(circleSize, obj.pos, System.Drawing.Color.Orange);
                        DrawFontTextMap(Tahoma13, "! " + (int)(obj.endTime - Game.Time), obj.pos, SharpDX.Color.Orange);
                    }
                }
            }

            bool blink = true;

            if ((int)(Game.Time * 10) % 2 == 0)
            {
                blink = false;
            }

            var   HpBar        = Config.Item("HpBar").GetValue <bool>();
            var   championInfo = Config.Item("championInfo").GetValue <bool>();
            var   GankAlert    = Config.Item("GankAlert").GetValue <bool>();
            var   ShowKDA      = Config.Item("ShowKDA").GetValue <bool>();
            var   ShowRecall   = Config.Item("ShowRecall").GetValue <bool>();
            var   ShowClicks   = Config.Item("ShowClicks").GetValue <bool>();
            float posY         = ((float)Config.Item("posY").GetValue <Slider>().Value * 0.01f) * Drawing.Height;
            float posX         = ((float)Config.Item("posX").GetValue <Slider>().Value * 0.01f) * Drawing.Width;
            float positionDraw = 0;
            float positionGang = 500;
            int   Width        = 103;
            int   Height       = 8;
            int   XOffset      = 10;
            int   YOffset      = 20;
            var   FillColor    = System.Drawing.Color.GreenYellow;
            var   Color        = System.Drawing.Color.Azure;
            float offset       = 0;

            foreach (var enemy in HeroManager.Enemies)
            {
                offset += 0.15f;

                if (Config.Item("SS").GetValue <bool>())
                {
                    if (!enemy.IsVisible && !enemy.IsDead)
                    {
                        var ChampionInfoOne = OKTWtracker.ChampionInfoList.Find(x => x.NetworkId == enemy.NetworkId);
                        if (ChampionInfoOne != null && enemy != Program.jungler)
                        {
                            if ((int)(Game.Time * 10) % 2 == 0 && Game.Time - ChampionInfoOne.LastVisableTime > 3 && Game.Time - ChampionInfoOne.LastVisableTime < 7)
                            {
                                DrawFontTextScreen(TextBold, "SS " + enemy.ChampionName + " " + (int)(Game.Time - ChampionInfoOne.LastVisableTime), Drawing.Width * offset, Drawing.Height * 0.02f, SharpDX.Color.Orange);
                            }
                            if (Game.Time - ChampionInfoOne.LastVisableTime >= 7)
                            {
                                DrawFontTextScreen(TextBold, "SS " + enemy.ChampionName + " " + (int)(Game.Time - ChampionInfoOne.LastVisableTime), Drawing.Width * offset, Drawing.Height * 0.02f, SharpDX.Color.Orange);
                            }
                        }
                    }
                }

                if (enemy.IsValidTarget() && ShowClicks)
                {
                    var lastWaypoint = enemy.GetWaypoints().Last().To3D();
                    if (lastWaypoint.IsValid())
                    {
                        drawLine(enemy.Position, lastWaypoint, 1, System.Drawing.Color.Red);

                        if (enemy.GetWaypoints().Count() > 1)
                        {
                            DrawFontTextMap(Tahoma13, enemy.ChampionName, lastWaypoint, SharpDX.Color.WhiteSmoke);
                        }
                    }
                }

                if (HpBar && enemy.IsHPBarRendered && Render.OnScreen(Drawing.WorldToScreen(enemy.Position)))
                {
                    var barPos = enemy.HPBarPosition;

                    float QdmgDraw = 0, WdmgDraw = 0, EdmgDraw = 0, RdmgDraw = 0, damage = 0;;

                    if (Q.IsReady())
                    {
                        damage = damage + Q.GetDamage(enemy);
                    }

                    if (W.IsReady() && Player.ChampionName != "Kalista")
                    {
                        damage = damage + W.GetDamage(enemy);
                    }

                    if (E.IsReady())
                    {
                        damage = damage + E.GetDamage(enemy);
                    }

                    if (R.IsReady())
                    {
                        damage = damage + R.GetDamage(enemy);
                    }

                    if (Q.IsReady())
                    {
                        QdmgDraw = (Q.GetDamage(enemy) / damage);
                    }

                    if (W.IsReady() && Player.ChampionName != "Kalista")
                    {
                        WdmgDraw = (W.GetDamage(enemy) / damage);
                    }

                    if (E.IsReady())
                    {
                        EdmgDraw = (E.GetDamage(enemy) / damage);
                    }

                    if (R.IsReady())
                    {
                        RdmgDraw = (R.GetDamage(enemy) / damage);
                    }

                    var percentHealthAfterDamage = Math.Max(0, enemy.Health - damage) / enemy.MaxHealth;

                    var yPos                     = barPos.Y + YOffset;
                    var xPosDamage               = barPos.X + XOffset + Width * percentHealthAfterDamage;
                    var xPosCurrentHp            = barPos.X + XOffset + Width * enemy.Health / enemy.MaxHealth;

                    float differenceInHP = xPosCurrentHp - xPosDamage;
                    var   pos1           = barPos.X + XOffset + (107 * percentHealthAfterDamage);

                    for (int i = 0; i < differenceInHP; i++)
                    {
                        if (Q.IsReady() && i < QdmgDraw * differenceInHP)
                        {
                            Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, System.Drawing.Color.Cyan);
                        }
                        else if (W.IsReady() && i < (QdmgDraw + WdmgDraw) * differenceInHP)
                        {
                            Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, System.Drawing.Color.Orange);
                        }
                        else if (E.IsReady() && i < (QdmgDraw + WdmgDraw + EdmgDraw) * differenceInHP)
                        {
                            Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, System.Drawing.Color.Yellow);
                        }
                        else if (R.IsReady() && i < (QdmgDraw + WdmgDraw + EdmgDraw + RdmgDraw) * differenceInHP)
                        {
                            Drawing.DrawLine(pos1 + i, yPos, pos1 + i, yPos + Height, 1, System.Drawing.Color.YellowGreen);
                        }
                    }
                }

                var kolor = System.Drawing.Color.GreenYellow;

                if (enemy.IsDead)
                {
                    kolor = System.Drawing.Color.Gray;
                }
                else if (!enemy.IsVisible)
                {
                    kolor = System.Drawing.Color.OrangeRed;
                }

                var kolorHP = System.Drawing.Color.GreenYellow;

                if (enemy.IsDead)
                {
                    kolorHP = System.Drawing.Color.GreenYellow;
                }
                else if ((int)enemy.HealthPercent < 30)
                {
                    kolorHP = System.Drawing.Color.Red;
                }
                else if ((int)enemy.HealthPercent < 60)
                {
                    kolorHP = System.Drawing.Color.Orange;
                }

                if (championInfo)
                {
                    positionDraw += 15;
                    DrawFontTextScreen(Tahoma13, "" + enemy.Level, posX - 25, posY + positionDraw, SharpDX.Color.White);
                    DrawFontTextScreen(Tahoma13, enemy.ChampionName, posX, posY + positionDraw, SharpDX.Color.White);

                    if (true)
                    {
                        var ChampionInfoOne = Core.OKTWtracker.ChampionInfoList.Find(x => x.NetworkId == enemy.NetworkId);
                        if (Game.Time - ChampionInfoOne.FinishRecallTime < 4)
                        {
                            DrawFontTextScreen(Tahoma13, "FINISH", posX - 90, posY + positionDraw, SharpDX.Color.GreenYellow);
                        }
                        else if (ChampionInfoOne.StartRecallTime <= ChampionInfoOne.AbortRecallTime && Game.Time - ChampionInfoOne.AbortRecallTime < 4)
                        {
                            DrawFontTextScreen(Tahoma13, "ABORT", posX - 90, posY + positionDraw, SharpDX.Color.Yellow);
                        }
                        else if (Game.Time - ChampionInfoOne.StartRecallTime < 8)
                        {
                            int   recallPercent = (int)(((Game.Time - ChampionInfoOne.StartRecallTime) / 8) * 100);
                            float recallX1      = posX - 90;
                            float recallY1      = posY + positionDraw + 3;
                            float recallX2      = (recallX1 + ((int)recallPercent / 2)) + 1;
                            float recallY2      = posY + positionDraw + 3;
                            Drawing.DrawLine(recallX1, recallY1, recallX1 + 50, recallY2, 8, System.Drawing.Color.Red);
                            Drawing.DrawLine(recallX1, recallY1, recallX2, recallY2, 8, System.Drawing.Color.White);
                        }
                    }

                    var fSlot = enemy.Spellbook.Spells[4];

                    if (fSlot.Name != "SummonerFlash")
                    {
                        fSlot = enemy.Spellbook.Spells[5];
                    }

                    if (fSlot.Name == "SummonerFlash")
                    {
                        var fT = fSlot.CooldownExpires - Game.Time;
                        if (ShowKDA)
                        {
                            if (fT < 0)
                            {
                                DrawFontTextScreen(Tahoma13, "F rdy", posX + 110, posY + positionDraw, SharpDX.Color.GreenYellow);
                            }
                            else
                            {
                                DrawFontTextScreen(Tahoma13, "F " + (int)fT, posX + 110, posY + positionDraw, SharpDX.Color.Yellow);
                            }
                        }
                        if (Config.Item("RF").GetValue <bool>())
                        {
                            if (fT < 2 && fT > -3)
                            {
                                DrawFontTextScreen(TextBold, enemy.ChampionName + " FLASH READY!", Drawing.Width * offset, Drawing.Height * 0.1f, SharpDX.Color.Yellow);
                            }
                            else if (fSlot.Cooldown - fT < 5)
                            {
                                DrawFontTextScreen(TextBold, enemy.ChampionName + " FLASH LOST!", Drawing.Width * offset, Drawing.Height * 0.1f, SharpDX.Color.Red);
                            }
                        }
                    }

                    if (enemy.Level > 5)
                    {
                        var rSlot = enemy.Spellbook.Spells[3];
                        var t     = rSlot.CooldownExpires - Game.Time;
                        if (ShowKDA)
                        {
                            if (t < 0)
                            {
                                DrawFontTextScreen(Tahoma13, "R rdy", posX + 145, posY + positionDraw, SharpDX.Color.GreenYellow);
                            }
                            else
                            {
                                DrawFontTextScreen(Tahoma13, "R " + (int)t, posX + 145, posY + positionDraw, SharpDX.Color.Yellow);
                            }
                        }
                        if (Config.Item("RF").GetValue <bool>())
                        {
                            if (t < 2 && t > -3)
                            {
                                DrawFontTextScreen(TextBold, enemy.ChampionName + " R READY!", Drawing.Width * offset, Drawing.Height * 0.2f, SharpDX.Color.YellowGreen);
                            }
                            else if (rSlot.Cooldown - t < 5)
                            {
                                DrawFontTextScreen(TextBold, enemy.ChampionName + " R LOST!", Drawing.Width * offset, Drawing.Height * 0.1f, SharpDX.Color.Red);
                            }
                        }
                    }
                    else if (ShowKDA)
                    {
                        DrawFontTextScreen(Tahoma13, "R ", posX + 145, posY + positionDraw, SharpDX.Color.Yellow);
                    }
                    //Drawing.DrawText(posX - 70, posY + positionDraw, kolor, enemy.Level + " lvl");
                }

                var Distance = Player.Distance(enemy.Position);
                if (GankAlert && !enemy.IsDead && Distance > 1200)
                {
                    var wts = Drawing.WorldToScreen(ObjectManager.Player.Position.Extend(enemy.Position, positionGang));

                    wts[0] = wts[0];
                    wts[1] = wts[1] + 15;

                    if ((int)enemy.HealthPercent > 0)
                    {
                        Drawing.DrawLine(wts[0], wts[1], (wts[0] + ((int)enemy.HealthPercent) / 2) + 1, wts[1], 8, kolorHP);
                    }

                    if ((int)enemy.HealthPercent < 100)
                    {
                        Drawing.DrawLine((wts[0] + ((int)enemy.HealthPercent) / 2), wts[1], wts[0] + 50, wts[1], 8, System.Drawing.Color.White);
                    }

                    if (enemy.IsVisible)
                    {
                        if (Program.jungler.NetworkId == enemy.NetworkId)
                        {
                            DrawFontTextMap(Tahoma13B, enemy.ChampionName, Player.Position.Extend(enemy.Position, positionGang), SharpDX.Color.OrangeRed);
                        }
                        else
                        {
                            DrawFontTextMap(Tahoma13, enemy.ChampionName, Player.Position.Extend(enemy.Position, positionGang), SharpDX.Color.White);
                        }
                    }
                    else
                    {
                        var ChampionInfoOne = Core.OKTWtracker.ChampionInfoList.Find(x => x.NetworkId == enemy.NetworkId);
                        if (ChampionInfoOne != null)
                        {
                            if (Game.Time - ChampionInfoOne.LastVisableTime > 3 && Game.Time - ChampionInfoOne.LastVisableTime < 7)
                            {
                                DrawFontTextMap(Tahoma13, "SS " + enemy.ChampionName + " " + (int)(Game.Time - ChampionInfoOne.LastVisableTime), Player.Position.Extend(enemy.Position, positionGang), SharpDX.Color.Yellow);
                            }
                            else
                            {
                                DrawFontTextMap(Tahoma13, "SS " + enemy.ChampionName + " " + (int)(Game.Time - ChampionInfoOne.LastVisableTime), Player.Position.Extend(enemy.Position, positionGang), SharpDX.Color.Yellow);
                            }
                        }
                        else
                        {
                            DrawFontTextMap(Tahoma13, "SS " + enemy.ChampionName, Player.Position.Extend(enemy.Position, positionGang), SharpDX.Color.Yellow);
                        }
                    }


                    if (Distance < 3500 && enemy.IsVisible && !Render.OnScreen(Drawing.WorldToScreen(enemy.Position)) && Program.jungler != null)
                    {
                        if (Program.jungler.NetworkId == enemy.NetworkId)
                        {
                            drawLine(Player.Position.Extend(enemy.Position, 100), Player.Position.Extend(enemy.Position, positionGang - 100), (int)((3500 - Distance) / 280), System.Drawing.Color.Crimson);
                        }
                        else
                        {
                            if (enemy.IsFacing(Player))
                            {
                                drawLine(Player.Position.Extend(enemy.Position, 100), Player.Position.Extend(enemy.Position, positionGang - 100), (int)((3500 - Distance) / 280), System.Drawing.Color.Orange);
                            }
                            else
                            {
                                drawLine(Player.Position.Extend(enemy.Position, 100), Player.Position.Extend(enemy.Position, positionGang - 100), (int)((3500 - Distance) / 280), System.Drawing.Color.Gold);
                            }
                        }
                    }
                    else if (Distance < 3500 && !enemy.IsVisible && !Render.OnScreen(Drawing.WorldToScreen(Player.Position.Extend(enemy.Position, Distance + 500))))
                    {
                        var need = Core.OKTWtracker.ChampionInfoList.Find(x => x.NetworkId == enemy.NetworkId);
                        if (need != null && Game.Time - need.LastVisableTime < 5)
                        {
                            drawLine(Player.Position.Extend(enemy.Position, 100), Player.Position.Extend(enemy.Position, positionGang - 100), (int)((3500 - Distance) / 300), System.Drawing.Color.Gray);
                        }
                    }
                }
                positionGang = positionGang + 100;
            }

            if (Program.AIOmode == 2)
            {
                Drawing.DrawText(Drawing.Width * 0.2f, Drawing.Height * 1f, System.Drawing.Color.Cyan, "OKTW AIO only utility mode ON");
            }
        }
Esempio n. 49
0
        private static void Combo()
        {
            var comboQ = getSliderItem(comboMenu, "comboQ");
            var comboW = getCheckBoxItem(comboMenu, "comboW");
            var comboE = getCheckBoxItem(comboMenu, "comboE");
            var comboR = getSliderItem(comboMenu, "comboR");

            if (comboQ > 1 && _spellQ.IsReady())
            {
                if (_spellR.IsReady() && comboR > 0)
                //search unit that provides most targets hit by ult. prioritize hero target unit
                {
                    var         maxTargetsHit      = 0;
                    Obj_AI_Base unitMostTargetsHit = null;

                    foreach (
                        var unit in
                        ObjectManager.Get <Obj_AI_Base>()
                        .Where(
                            x =>
                            x.LSIsValidTarget(_spellQ.Range) &&
                            _spellQ.GetPrediction(x).Hitchance >= HitChance.High))             //causes troubles?
                    {
                        var targetsHit = unit.LSCountEnemiesInRange((int)_spellR.Range);
                        //unitposition might not reflect where you land with Q

                        if (targetsHit > maxTargetsHit ||
                            (unitMostTargetsHit != null && targetsHit >= maxTargetsHit &&
                             unit.Type == GameObjectType.AIHeroClient))
                        {
                            maxTargetsHit      = targetsHit;
                            unitMostTargetsHit = unit;
                        }
                    }

                    if (maxTargetsHit >= comboR)
                    {
                        CastQ(unitMostTargetsHit);
                    }
                }

                Obj_AI_Base target = TargetSelector.GetTarget(_spellQ.Range, DamageType.Magical);
                if (target != null)
                {
                    var pred = _spellQ.GetPrediction(target);
                    if (comboQ == 2 || (comboQ == 3 && !Orbwalking.InAutoAttackRange(target)) && _spellQ.IsReady() && target.LSIsValidTarget() && pred.Hitchance >= HitChance.High)
                    {
                        _spellQ.Cast(pred.CastPosition);
                    }
                    else if (!target.CanMove && comboQ == 2 || comboQ == 3)
                    {
                        _spellQ.Cast(target);
                    }
                }
            }

            if (comboW && _spellW.IsReady())
            {
                var target = TargetSelector.GetTarget(_spellW.Range + 200, DamageType.Magical);

                if (target != null)
                {
                    var enoughMana = GetManaPercent() >= getSliderItem(comboMenu, "comboWPercent");

                    if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).ToggleState == 1)
                    {
                        if (ObjectManager.Player.LSDistance(target.ServerPosition) <= _spellW.Range && enoughMana)
                        {
                            _comboW = true;
                            _spellW.Cast();
                        }
                    }
                    else if (!enoughMana)
                    {
                        RegulateWState(true);
                    }
                }
                else
                {
                    RegulateWState();
                }
            }

            if (comboE && _spellE.IsReady())
            {
                CastE(Helper.EnemyTeam.OrderBy(x => x.LSDistance(ObjectManager.Player)).FirstOrDefault(x => _spellE.IsInRange(x)));
            }
        }
Esempio n. 50
0
        private static void OnCombo()
        {
            bool useQ         = getCheckBoxItem(comboMenu, "comboUseQ") && Q.IsReady();
            bool useW         = getCheckBoxItem(comboMenu, "comboUseW") && W.IsReady();
            bool useE         = getCheckBoxItem(comboMenu, "comboUseE") && E.IsReady();
            bool useR         = getCheckBoxItem(comboMenu, "comboUseR") && R.IsReady();
            bool killpriority = getCheckBoxItem(comboMenu, "spPriority") && R.IsReady();
            bool rKillSteal   = getCheckBoxItem(comboMenu, "rLastHit");
            var  Etarget      = TargetSelector.GetTarget(EMaxRange, DamageType.Magical);
            var  Qtarget      = TargetSelector.GetTarget(Q.Range, DamageType.Magical);
            var  RTarget      = TargetSelector.GetTarget(R.Range, DamageType.Magical);

            if (killpriority && Qtarget != null & Etarget != null && Etarget != Qtarget && ((Etarget.Health > TotalDmg(Etarget, false, true, false, false)) || (Etarget.Health > TotalDmg(Etarget, false, true, true, false) && Etarget == RTarget)) && Qtarget.Health < TotalDmg(Qtarget, true, true, false, false))
            {
                Etarget = Qtarget;
            }

            if (RTarget != null && rKillSteal && useR)
            {
                if (TotalDmg(RTarget, true, true, false, false) < RTarget.Health && TotalDmg(RTarget, true, true, true, true) > RTarget.Health)
                {
                    R.Cast(RTarget.ServerPosition);
                }
            }


            if (useE)
            {
                if (Etarget != null)
                {
                    CastE();
                }
            }
            if (useQ)
            {
                if (Qtarget != null)
                {
                    Q.Cast(Qtarget);
                }
            }

            if (useW)
            {
                var t = TargetSelector.GetTarget(W.Range, DamageType.Magical);

                if (t != null)
                {
                    if (t.Path.Count() < 2)
                    {
                        if (t.HasBuffOfType(BuffType.Slow))
                        {
                            if (W.GetPrediction(t).HitChance >= EloBuddy.SDK.Enumerations.HitChance.Medium)
                            {
                                if (W.Cast(t))
                                {
                                    return;
                                }
                            }
                        }
                        if (t.CountEnemiesInRange(250) > 2 || W.IsInRange(t))
                        {
                            if (W.GetPrediction(t).HitChance >= EloBuddy.SDK.Enumerations.HitChance.Medium)
                            {
                                if (W.Cast(t))
                                {
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            if (useR && R.Instance.Name == "ViktorChaosStorm" && player.CanCast && !player.Spellbook.IsCastingSpell)
            {
                foreach (var unit in HeroManager.Enemies.Where(h => h.LSIsValidTarget(R.Range)))
                {
                    R.CastIfWillHit(unit, getSliderItem(comboMenu, "HitR"));
                }
            }
        }
Esempio n. 51
0
        private static void Combo()
        {
            var t = TargetSelector.GetTarget(Q.Range, DamageType.Physical);

            if (t == null)
            {
                return;
            }

            if (t.LSIsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 95) && shenBuffActive)
            {
                return;
            }

            var minQRange = getSliderItem(comboMenu, "ComboUseQMinRange");

            if (Q.IsReady() && Q.GetDamage(t) > t.Health)
            {
                Q.Cast(t);
            }

            if (E.IsReady())
            {
                switch (getBoxItem(comboMenu, "Combo.CastE"))
                {
                case 0:
                    if (E.IsReady() && Q.IsReady() && t.LSIsValidTarget(Q.Range))
                    {
                        if (Player.LSDistance(t) >= minQRange && t.LSIsValidTarget(Q.Range))
                        {
                            Q.Cast(t);
                        }
                        if (E.IsReady() && t.LSIsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 95))
                        {
                            E.Cast();
                        }
                    }
                    break;

                case 1:
                    if (E.IsReady() && t.LSIsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 95))
                    {
                        E.Cast();
                    }
                    break;
                }

                if (eCounterStrike && t.LSIsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65))
                {
                    E.Cast();
                }
            }

            if (Q.IsReady() && Player.LSDistance(t) >= minQRange && t.LSIsValidTarget(Q.Range))
            {
                Q.Cast(t);
            }


            if (ObjectManager.Player.LSDistance(t) <= E.Range)
            {
                CastItems();
                //UseItems(t);
            }

            if (W.IsReady() && ObjectManager.Player.CountEnemiesInRange(Orbwalking.GetRealAutoAttackRange(t)) > 0)
            {
                W.Cast();
            }

            if (E.IsReady() && ObjectManager.Player.CountEnemiesInRange(Orbwalking.GetRealAutoAttackRange(t)) > 0)
            {
                E.Cast();
            }

            if (R.IsReady())
            {
                if (Player.LSDistance(t) < Player.AttackRange)
                {
                    if (
                        ObjectManager.Player.CountEnemiesInRange(
                            (int)Orbwalking.GetRealAutoAttackRange(ObjectManager.Player)) >= 2 ||
                        t.Health > Player.Health)
                    {
                        R.CastOnUnit(Player);
                    }
                }
            }
        }
Esempio n. 52
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            R.Range = 500 * (R.Level == 0 ? 1 : R.Level) + 1500;

            AIHeroClient t;

            if (W.IsReady() && (Program.misc["AutoWI"].Cast <ComboBox>().CurrentValue == 1 || (Program.misc["AutoWI"].Cast <ComboBox>().CurrentValue == 2 && ComboActive)))
            {
                t = TargetSelector.GetTarget(W.Range, DamageType.Physical);
                if (t.LSIsValidTarget(W.Range))
                {
                    if (t.HasBuffOfType(BuffType.Stun) || t.HasBuffOfType(BuffType.Snare) ||
                        t.HasBuffOfType(BuffType.Taunt) || t.HasBuffOfType(BuffType.Knockup) ||
                        t.HasBuff("zhonyasringshield") || t.HasBuff("Recall"))
                    {
                        CastW(t.Position);
                    }

                    if (t.HasBuffOfType(BuffType.Slow))
                    {
                        var hit = t.LSIsFacing(ObjectManager.Player)
                            ? t.Position.LSExtend(ObjectManager.Player.Position, +140)
                            : t.Position.LSExtend(ObjectManager.Player.Position, -140);
                        CastW(hit);
                    }
                }
            }

            if (Q.IsReady() && (Program.misc["AutoQI"].Cast <ComboBox>().CurrentValue == 1 || (Program.misc["AutoQI"].Cast <ComboBox>().CurrentValue == 2 && ComboActive)))
            {
                t = TargetSelector.GetTarget(Q.Range - 30, DamageType.Physical);
                if (t.LSIsValidTarget(Q.Range) &&
                    (t.HasBuffOfType(BuffType.Stun) || t.HasBuffOfType(BuffType.Snare) || t.HasBuffOfType(BuffType.Taunt) || (t.Health <= ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.Q) && !Orbwalking.InAutoAttackRange(t))))
                {
                    CastQ(t);
                }
            }

            if (Program.combo["UseQMC"].Cast <KeyBind>().CurrentValue)
            {
                t = TargetSelector.GetTarget(Q.Range, DamageType.Physical);
                CastQ(t);
            }

            //if (GetValue<KeyBind>("UseEMC").Active)
            //{
            //    t = TargetSelector.GetTarget(E.Range - 50, DamageType.Physical);
            //    E.Cast(t);
            //}

            if (Program.combo["UseRMC"].Cast <KeyBind>().CurrentValue&& R.IsReady())
            {
                foreach (var e in HeroManager.Enemies.Where(e => e.LSIsValidTarget(R.Range)).OrderBy(e => e.Health))
                {
                    R.CastOnUnit(e);
                }
            }

            if (Program.misc["UseEQC"].Cast <KeyBind>().CurrentValue&& E.IsReady() && Q.IsReady())
            {
                t = TargetSelector.GetTarget(E.Range, DamageType.Physical);
                if (t.LSIsValidTarget(E.Range) &&
                    t.Health
                    < ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.Q)
                    + ObjectManager.Player.LSGetSpellDamage(t, SpellSlot.E) + 20 && E.CanCast(t))
                {
                    E.Cast(t);
                    CastQ(t);
                }
            }

            if ((!ComboActive && !HarassActive) || !Orbwalker.CanMove)
            {
                return;
            }

            //var useQ = GetValue<bool>("UseQ" + (ComboActive ? "C" : "H"));
            var useW = Program.combo["UseWC"].Cast <CheckBox>().CurrentValue;
            var useE = Program.combo["UseEC"].Cast <CheckBox>().CurrentValue;
            var useR = Program.combo["UseRC"].Cast <CheckBox>().CurrentValue;

            //if (Q.IsReady() && useQ)
            //{
            //    t = TargetSelector.GetTarget(Q.Range, DamageType.Physical);
            //    if (t != null)
            //    {
            //        CastQ(t);
            //    }
            //}

            if (useE && E.IsReady())
            {
                //var enemies = HeroManager.Enemies.Where(e => e.LSIsValidTarget(E.Range));
                //var objAiHeroes = enemies as AIHeroClient[] ?? enemies.ToArray();
                //IEnumerable<AIHeroClient> nResult =
                //    (from e in objAiHeroes join d in dangerousEnemies on e.ChampionName equals d select e)
                //        .Distinct();

                //foreach (var n in nResult.Where(n => n.LSIsFacing(ObjectManager.Player)))
                //{
                //    if (n.LSIsValidTarget(Orbwalking.GetRealAutoAttackRange(null) + 65 - 300) && E.GetPrediction(n).CollisionObjects.Count == 0)
                //    {
                //        E.Cast(n.Position);
                //        if (W.IsReady())
                //            W.Cast(n.Position);
                //    }
                //}

                var nResult = HeroManager.Enemies.Where(e => e.LSIsValidTarget(E.Range));
                foreach (var n in nResult)
                {
                    if (n.LSIsValidTarget(n.LSIsFacing(ObjectManager.Player) ? E.Range - 200 : E.Range - 300) && E.GetPrediction(n).CollisionObjects.Count == 0)
                    {
                        E.Cast(n.Position);
                    }
                }
            }

            if (useW && W.IsReady())
            {
                var nResult = HeroManager.Enemies.Where(e => e.LSIsValidTarget(W.Range));
                foreach (var n in nResult)
                {
                    if (ObjectManager.Player.LSDistance(n) < 450 && n.LSIsFacing(ObjectManager.Player))
                    {
                        CastW(CommonGeometry.CenterOfVectors(new[] { ObjectManager.Player.Position, n.Position }));
                    }
                }
            }

            if (R.IsReady() && useR)
            {
                foreach (var e in HeroManager.Enemies.Where(e => e.LSIsValidTarget(R.Range) && e.Health <= R.GetDamage(e) && !Orbwalking.InAutoAttackRange(e) && canCastR))
                {
                    R.CastOnUnit(e);
                }
            }
        }
Esempio n. 53
0
 private static void BeforeAttack(AttackableUnit target, Orbwalker.PreAttackArgs args)
 {
     if (E.IsReady() && args.Target.IsValid<AIHeroClient>() && getCheckBoxItem(weMenu, "autoE"))
         E.Cast();
 }
Esempio n. 54
0
        private void Game_OnUpdate(EventArgs args)
        {
            if (Program.LagFree(0))
            {
                SetMana();
            }
            if (R.IsReady() && Config.Item("Rjungle", true).GetValue <bool>())
            {
                KsJungle();
            }
            else
            {
                DragonTime = 0;
            }

            if (E.IsReady())
            {
                if (Program.LagFree(0))
                {
                    LogicE();
                }

                if (Config.Item("smartE", true).GetValue <KeyBind>().Active)
                {
                    Esmart = true;
                }
                if (Config.Item("smartEW", true).GetValue <KeyBind>().Active&& W.IsReady())
                {
                    CursorPosition = Game.CursorPos;
                    W.Cast(CursorPosition);
                }
                if (Esmart && Player.Position.Extend(Game.CursorPos, E.Range).CountEnemiesInRange(500) < 4)
                {
                    E.Cast(Player.Position.Extend(Game.CursorPos, E.Range), true);
                }

                if (!CursorPosition.IsZero)
                {
                    E.Cast(Player.Position.Extend(CursorPosition, E.Range), true);
                }
            }
            else
            {
                CursorPosition = Vector3.Zero;
                Esmart         = false;
            }

            if (Q.IsReady())
            {
                LogicQ();
            }

            if (Program.LagFree(3) && W.IsReady() && Config.Item("autoW", true).GetValue <bool>())
            {
                LogicW();
            }

            if (R.IsReady())
            {
                if (Config.Item("useR", true).GetValue <KeyBind>().Active)
                {
                    var t = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Physical);
                    if (t.IsValidTargetLS())
                    {
                        R.Cast(t, true, true);
                    }
                }

                if (Program.LagFree(4))
                {
                    LogicR();
                }
            }
        }
Esempio n. 55
0
 static void killsteal()
 {
     if (KillstealQ && Q.IsReady())
     {
         var targets = HeroManager.Enemies.Where(x => x.LSIsValidTarget(Q.Range) && !x.IsZombie);
         foreach (var target in targets)
         {
             if (target.Health < Q.GetDamage(target) && (!target.HasBuff("kindrednodeathbuff") && !target.HasBuff("Undying Rage") && !target.HasBuff("JudicatorIntervention")))
             {
                 Q.Cast(target);
             }
         }
     }
 }
Esempio n. 56
0
 private static void OnDraw(EventArgs args)
 {
     if (Player.IsDead)
     {
         return;
     }
     if (getCheckBoxItem(drawMenu, "Q") && Q.Level > 0)
     {
         Render.Circle.DrawCircle(Player.Position, Q.Range, Q.IsReady() ? Color.Green : Color.Red);
     }
     if (getCheckBoxItem(drawMenu, "W") && W.Level > 0)
     {
         Render.Circle.DrawCircle(Player.Position, W.Range, W.IsReady() ? Color.Green : Color.Red);
     }
     if (getCheckBoxItem(drawMenu, "E") && E.Level > 0)
     {
         Render.Circle.DrawCircle(Player.Position, E.Range, E.IsReady() ? Color.Green : Color.Red);
     }
     if (getCheckBoxItem(drawMenu, "R") && R.Level > 0)
     {
         Render.Circle.DrawCircle(Player.Position, R.Range, R.IsReady() ? Color.Green : Color.Red);
     }
 }
Esempio n. 57
0
        private static void Smartks()
        {
            foreach (var t in ObjectManager.Get <AIHeroClient>().Where(t => t.IsEnemy).Where(t => t.LSIsValidTarget(_q.Range)))
            {
                #region e
                if (t.Health < _e.GetDamage(t) && _e.IsReady())
                {
                    _e.Cast(t);
                }
                #endregion
                #region q
                else if (t.Health < _q.GetDamage(t) && _q.IsReady())
                {
                    _q.Cast(t.ServerPosition);
                }
                #endregion
                #region eq
                else if (t.Health < (_q.GetDamage(t) + _e.GetDamage(t)) && _e.IsReady() && _q.IsReady())
                {
                    if (_e.Cast(t))
                    {
                        _q.Cast(t.ServerPosition, false);
                    }
                }
                #endregion
                #region eq ignite
                else if (t.Health < (_q.GetDamage(t) + _e.GetDamage(t) + _player.GetSummonerSpellDamage(t, LeagueSharp.Common.Damage.SummonerSpell.Ignite)) && _e.IsReady() && _q.IsReady() && IgniteSlot.IsReady() && IgniteSlot != SpellSlot.Unknown)
                {
                    _e.Cast(t);
                    if (!_e.IsCharging)
                    {
                        _q.Cast(t, false, true);
                    }
                    _player.Spellbook.CastSpell(IgniteSlot, t);
                }
                #endregion
                #region eq smite
                else if (t.Health < (_q.GetDamage(t) + _e.GetDamage(t) + Smitedamage()) && _e.IsReady() && _q.IsReady() && SmiteSlot.IsReady() && SmiteSlot != SpellSlot.Unknown)
                {
                    _e.Cast(t);
                    if (!_e.IsCharging)
                    {
                        _q.Cast(t, false, true);
                    }
                    _player.Spellbook.CastSpell(SmiteSlot, t);
                }
                #endregion
                #region eq smite R
                else if (ksMenu["RKS"].Cast <CheckBox>().CurrentValue&& t.Health < (_q.GetDamage(t) + _e.GetDamage(t) + Smitedamage() + _r.GetDamage(t)) && _e.IsReady() && _q.IsReady() && SmiteSlot.IsReady() && _r.IsReady() && SmiteSlot != SpellSlot.Unknown)
                {
                    _e.Cast(t);
                    if (!_e.IsCharging)
                    {
                        _q.Cast(t, false, true);
                    }
                    if (_player.LSDistance(t) < 500)
                    {
                        _player.Spellbook.CastSpell(SmiteSlot, t);
                    }

                    if (_player.LSDistance(t) < _r.Range && !_e.IsCharging && !_q.IsCharging)
                    {
                        _r.Cast();
                    }
                }
                #endregion
                #region eq ignite R
                else if (ksMenu["RKS"].Cast <CheckBox>().CurrentValue&& t.Health < (_q.GetDamage(t) + _e.GetDamage(t) + _player.GetSummonerSpellDamage(t, LeagueSharp.Common.Damage.SummonerSpell.Ignite) + _r.GetDamage(t)) && _e.IsReady() && _q.IsReady() && IgniteSlot.IsReady() && _r.IsReady() && IgniteSlot != SpellSlot.Unknown)
                {
                    _e.Cast(t);
                    if (!_e.IsCharging)
                    {
                        _q.Cast(t, false, true);
                    }
                    if (_player.LSDistance(t) < 600)
                    {
                        _player.Spellbook.CastSpell(IgniteSlot, t);
                    }

                    if (_player.LSDistance(t) < _r.Range && !_e.IsCharging && !_q.IsCharging)
                    {
                        _r.Cast();
                    }
                }
                #endregion
                else
                {
                    return;
                }
            }
        }
Esempio n. 58
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (Program.LagFree(0))
            {
                SetMana();
            }
            if (R.IsReady() && getCheckBoxItem(rMenu, "Rjungle"))
            {
                KsJungle();
            }
            else
            {
                DragonTime = 0;
            }

            if (E.IsReady())
            {
                if (Program.LagFree(0))
                {
                    LogicE();
                }

                if (getKeyBindItem(eMenu, "smartE"))
                {
                    Esmart = true;
                }
                if (getKeyBindItem(eMenu, "smartEW") && W.IsReady())
                {
                    CursorPosition = Game.CursorPos;
                    W.Cast(CursorPosition);
                }
                if (Esmart && Player.Position.LSExtend(Game.CursorPos, E.Range).CountEnemiesInRange(500) < 4)
                {
                    E.Cast(Player.Position.LSExtend(Game.CursorPos, E.Range), true);
                }

                if (!CursorPosition.IsZero)
                {
                    E.Cast(Player.Position.LSExtend(CursorPosition, E.Range), true);
                }
            }
            else
            {
                CursorPosition = Vector3.Zero;
                Esmart         = false;
            }

            if (Q.IsReady())
            {
                LogicQ();
            }

            if (Program.LagFree(3) && W.IsReady() && getCheckBoxItem(wMenu, "autoW"))
            {
                LogicW();
            }

            if (R.IsReady())
            {
                if (getKeyBindItem(rMenu, "useR"))
                {
                    var t = TargetSelector.GetTarget(R.Range, DamageType.Physical);
                    if (t.LSIsValidTarget())
                    {
                        R.Cast(t, true, true);
                    }
                }

                if (Program.LagFree(4))
                {
                    LogicR();
                }
            }
        }
Esempio n. 59
0
        public static void CastBestLine(bool forceUlt, Spell spell, Spell spell2, int midPointRange, Menu menu, float extraPrerange = 1, bool wallCheck = true)
        {
            if (!spell.IsReady())
                return;

            int maxHit = 0;
            Vector3 start = Vector3.Zero;
            Vector3 end = Vector3.Zero;

            //loop one
            foreach (var target in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range)))
            {
               //loop 2
                var target1 = target;
                var target2 = target;
                foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId
                    && x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position)))
                {
                    int hit = 2;

                    var targetPred = Prediction.GetPrediction(target, spell.Delay);
                    var enemyPred = Prediction.GetPrediction(enemy, spell.Delay);

                    var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2;

                    var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;
                    var endPos = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;

                    Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(startpos, endPos, spell.Width);

                    if (!rec1.Points.Exists(Util.IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2)
                    {
                        //loop 3
                        var target3 = target;
                        var enemy1 = enemy;
                        foreach (var enemy2 in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < 1000))
                        {
                            var enemy2Pred = Prediction.GetPrediction(enemy2, spell.Delay);
                            Object[] obj = Util.VectorPointProjectionOnLineSegment(startpos.To2D(), endPos.To2D(), enemy2Pred.CastPosition.To2D());
                            var isOnseg = (bool)obj[2];
                            var pointLine = (Vector2)obj[1];

                            if (pointLine.Distance(enemy2Pred.CastPosition.To2D()) < spell.Width && isOnseg)
                            {
                                hit++;
                            }
                        }
                    }

                    if (hit > maxHit && hit > 1 && !rec1.Points.Exists(Util.IsWall))
                    {
                        maxHit = hit;
                        start = startpos;
                        end = endPos;
                    }
                }
            }

            if (start != Vector3.Zero && end != Vector3.Zero && spell.IsReady())
            {
                spell2.UpdateSourcePosition(start, start);
                if (forceUlt)
                    CastLineSpell(start, end);
                if (menu.Item("ComboActive", true).GetValue<KeyBind>().Active && maxHit >= menu.Item("Line_If_Enemy_Count_Combo", true).GetValue<Slider>().Value)
                    CastLineSpell(start, end);
                if (maxHit >= menu.Item("Line_If_Enemy_Count", true).GetValue<Slider>().Value)
                    CastLineSpell(start, end);
            }

            //check if only one target
            if (forceUlt)
            {
                CastSingleLine(spell, spell2, wallCheck, extraPrerange);
            }
        }
Esempio n. 60
0
        private static void OnUpdate(EventArgs args)
        {
            if (Range && E.IsReady() && Utils.TickCount - Etick < 250 + Game.Ping)
            {
                E.Cast(EcastPos);
            }

            if (getKeyBindItem(miscMenu, "flee"))
            {
                FleeMode();
            }

            if (Range)
            {
                if (getCheckBoxItem(wMenu, "autoWmove") && Orbwalker.LastTarget != null &&
                    Player.HasBuff("jaycehyperchargevfx"))
                {
                    Orbwalker.DisableMovement = true;
                }
                else
                {
                    Orbwalker.DisableMovement = false;
                }

                if (Program.LagFree(1) && Q.IsReady() && getCheckBoxItem(qMenu, "autoQ"))
                {
                    LogicQ();
                }

                if (Program.LagFree(2) && W.IsReady() && getCheckBoxItem(wMenu, "autoW"))
                {
                    LogicW();
                }
            }
            else
            {
                if (Program.LagFree(1) && E2.IsReady() && getCheckBoxItem(eMenu, "autoEm"))
                {
                    LogicE2();
                }

                if (Program.LagFree(2) && Q2.IsReady() && getCheckBoxItem(qMenu, "autoQm"))
                {
                    LogicQ2();
                }
                if (Program.LagFree(3) && W2.IsReady() && getCheckBoxItem(wMenu, "autoWm"))
                {
                    LogicW2();
                }
            }

            if (Program.LagFree(4))
            {
                if (Program.None && getCheckBoxItem(miscMenu, "stack") && !Player.HasBuff("Recall") &&
                    Player.Mana > Player.MaxMana * 0.90 && (Items.HasItem(Tear) || Items.HasItem(Manamune)))
                {
                    if (Utils.TickCount - Q.LastCastAttemptT > 4200 && Utils.TickCount - W.LastCastAttemptT > 4200 &&
                        Utils.TickCount - E.LastCastAttemptT > 4200)
                    {
                        if (Range)
                        {
                            if (W.IsReady())
                            {
                                W.Cast();
                            }
                            else if (E.IsReady() && (Player.InFountain() || Player.IsMoving))
                            {
                                E.Cast(Player.ServerPosition);
                            }
                            else if (Q.IsReady() && !E.IsReady())
                            {
                                Q.Cast(Player.Position.Extend(Game.CursorPos, 500));
                            }
                            else if (R.IsReady() && Player.InFountain())
                            {
                                R.Cast();
                            }
                        }
                        else
                        {
                            if (W.IsReady())
                            {
                                W.Cast();
                            }
                            else if (R.IsReady() && Player.InFountain())
                            {
                                R.Cast();
                            }
                        }
                    }
                }

                SetValue();
                if (R.IsReady())
                {
                    LogicR();
                }
            }

            Jungle();
            LaneClearLogic();
        }