示例#1
0
        public static bool IsPositionSafe(Obj_AI_Base vTarget, Spell vSpell)
        {
            Vector2 predPos = vSpell.GetPrediction(vTarget).CastPosition.To2D();
            Vector2 myPos = ObjectManager.Player.Position.To2D();
            Vector2 newPos = (vTarget.Position.To2D() - myPos);
            newPos.Normalize();

            Vector2 checkPos = predPos + newPos * (vSpell.Range - Vector2.Distance(predPos, myPos));
            Obj_Turret closestTower = null;

            foreach (Obj_Turret tower in
                ObjectManager.Get<Obj_Turret>()
                    .Where(tower => tower.IsValid && !tower.IsDead && tower.Health != 0 && tower.IsEnemy))
            {
                if (Vector3.Distance(tower.Position, ObjectManager.Player.Position) < 1450)
                    closestTower = tower;
            }

            if (closestTower == null)
                return true;

            if (Vector2.Distance(closestTower.Position.To2D(), checkPos) <= 910)
                return false;

            return true;
        }
示例#2
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);
                }
            }
        }
示例#3
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;
                }
            }
        }
        // use underTurret and .Extend for this please
        public static bool IsPositionSafe(Obj_AI_Hero target, Spell spell)
        {
            var predPos = spell.GetPrediction(target).UnitPosition.To2D();
            var myPos = Player.Position.To2D();
            var newPos = (target.Position.To2D() - myPos);
            newPos.Normalize();

            var checkPos = predPos + newPos * (spell.Range - Vector2.Distance(predPos, myPos));
            Obj_Turret closestTower = null;

            foreach (var tower in ObjectManager.Get<Obj_Turret>()
                .Where(tower => tower.IsValid && !tower.IsDead && Math.Abs(tower.Health) > float.Epsilon)
                .Where(tower => Vector3.Distance(tower.Position, Player.Position) < 1450))
            {
                closestTower = tower;
            }

            if (closestTower == null)
                return true;

            if (Vector2.Distance(closestTower.Position.To2D(), checkPos) <= 910)
                return false;

            return true;
        }
示例#5
0
        // This is for sona only atm.
        public static Obj_AI_Hero GetEnemyHitByR(Spell R, int numHit) {
            int totalHit = 0;
            Obj_AI_Hero target = null;

            foreach (Obj_AI_Hero current in ObjectManager.Get<Obj_AI_Hero>()) {

                var prediction = R.GetPrediction(current, true);

                if (Vector3.Distance(ObjectManager.Player.Position, prediction.CastPosition) <= R.Range) {
                    
                    Vector2 extended = current.Position.To2D().Extend(ObjectManager.Player.Position.To2D(), -R.Range + Vector2.Distance(ObjectManager.Player.Position.To2D(), current.Position.To2D()));
                    rect = new Geometry.Rectangle(ObjectManager.Player.Position.To2D(), extended, R.Width);

                    if (!current.IsMe && current.IsEnemy) {
                        // SEt to 1 as the current target is hittable.
                        totalHit = 1;
                        foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>()) {
                            if (enemy.IsEnemy && current.ChampionName != enemy.ChampionName && !enemy.IsDead && !rect.ToPolygon().IsOutside(enemy.Position.To2D())) {
                                totalHit += 1;
                            }
                        }
                    }

                    if (totalHit >= numHit) {
                        target = current;
                        break;
                    }
                }

            }

            Console.WriteLine(Game.Time + " | Targets hit is: " + totalHit + " Out of " + numHit);
            return target;
        }
示例#6
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());
 }
示例#7
0
 public static Obj_AI_Hero GetTargetNoCollision(Spell spell,
     bool ignoreShields = true,
     Vector3 from = default(Vector3),
     IEnumerable<Obj_AI_Hero> ignoreChampions = null)
 {
     return
         GetTargets(spell.Range, Utils.ConvertDamageType(spell.DamageType), ignoreShields, from, ignoreChampions)
             .FirstOrDefault(t => spell.GetPrediction(t).Hitchance != HitChance.Collision);
 }
示例#8
0
 public static void CastSpell(Spell spell, Obj_AI_Base target, HitChance hitChance, bool packetCast)
 {
     Obj_AI_Hero Player = ObjectManager.Player;
     if (target.IsValidTarget(spell.Range) && spell.GetPrediction(target).Hitchance >= hitChance)
     {
         spell.Cast(target, packetCast);
         LastCastTime = Environment.TickCount;
         Orbwalking.ResetAutoAttackTimer();
     }
 }
示例#9
0
        private void LogicQ()
        {
            var t  = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
            var t2 = TargetSelector.GetTarget(1500, TargetSelector.DamageType.Magical);

            if (t.IsValidTarget() && t2.IsValidTarget() && t == t2 && !(Config.Item("separate", true).GetValue <bool>() && Program.LaneClear))
            {
                if (Q.IsCharging)
                {
                    Program.CastSpell(Q, t);
                    if (OktwCommon.GetPassiveTime(Player, "XerathArcanopulseChargeUp") < 1 || (Player.CountEnemiesInRange(800) > 0) || Player.Distance(t) > 1450)
                    {
                        Q.Cast(Q.GetPrediction(t).CastPosition);
                    }
                    else if (OktwCommon.GetPassiveTime(Player, "XerathArcanopulseChargeUp") < 2 || (Player.CountEnemiesInRange(1000) > 0))
                    {
                        Q.CastIfHitchanceEquals(t, HitChance.VeryHigh);
                    }

                    return;
                }
                else if (t.IsValidTarget(Q.Range - 300))
                {
                    if (t.Health < OktwCommon.GetKsDamage(t, Q))
                    {
                        Q.StartCharging();
                    }
                    else if (Program.Combo && Player.Mana > EMANA + QMANA)
                    {
                        Q.StartCharging();
                    }
                    else if (t.IsValidTarget(1200) && Program.Farm && Player.Mana > RMANA + EMANA + QMANA + QMANA && Config.Item("harras" + t.ChampionName).GetValue <bool>() && !Player.UnderTurret(true) && OktwCommon.CanHarras())
                    {
                        Q.StartCharging();
                    }
                    else if ((Program.Combo || Program.Farm) && Player.Mana > RMANA + WMANA)
                    {
                        foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(Q.Range) && !OktwCommon.CanMove(enemy)))
                        {
                            Q.StartCharging();
                        }
                    }
                }
            }
            else if (Program.LaneClear && Q.Range > 1000 && Player.CountEnemiesInRange(1450) == 0 && (Q.IsCharging || (Player.ManaPercent > Config.Item("Mana", true).GetValue <Slider>().Value&& Config.Item("farmQ", true).GetValue <bool>() && Player.Mana > RMANA + QMANA + WMANA)))
            {
                var allMinionsQ = Cache.GetMinions(Player.ServerPosition, Q.Range);
                var Qfarm       = Q.GetLineFarmLocation(allMinionsQ, Q.Width);
                if (Qfarm.MinionsHit > Config.Item("LCminions", true).GetValue <Slider>().Value || (Q.IsCharging && Qfarm.MinionsHit > 0))
                {
                    Q.Cast(Qfarm.Position);
                }
            }
        }
示例#10
0
        private static void CastQEnemy()
        {
            if (!_q.IsReady())
            {
                return;
            }
            var target = TargetSelector.GetTarget(_q.Range + _q.Width / 2, DamageType.Magical);

            if (!target.LSIsValidTarget(_q.Range))
            {
                return;
            }
            _q.CastIfHitchanceEquals(target, HitChance.High);
            if (_w.IsReady() && getCheckBoxItem(comboMenu, "useW_Passive"))
            {
                var pos = _q.GetPrediction(target).CastPosition;
                Utility.DelayAction.Add(50, () => _w.Cast(new Vector3(pos.X - 2, pos.Y - 2, pos.Z)));
                Utility.DelayAction.Add(150, () => _w.Cast(new Vector3(pos.X + 2, pos.Y + 2, pos.Z)));
            }
        }
示例#11
0
文件: Champion.cs 项目: lanyi777/CN
 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;
 }
示例#12
0
        static void CastE(Obj_AI_Base target)
        {
            if (!_spellE.IsReady() || target == null || !target.IsValidTarget())
            {
                return;
            }

            if (_spellE.GetPrediction(target).UnitPosition.Distance(ObjectManager.Player.ServerPosition) <= _spellE.Range)
            {
                _spellE.CastOnUnit(ObjectManager.Player);
            }
        }
示例#13
0
文件: Ahri.cs 项目: volder1/PortAIO
        static bool CastE()
        {
            if (!_spellE.IsReady() || !(ObjectManager.Player.Mana - _spellE.ManaCost > _spellR.ManaCost))
            {
                return(false);
            }

            var target = EloBuddy.SDK.TargetSelector.GetTarget(_spellE.Range, EloBuddy.DamageType.Magical);
            var predE  = _spellQ.GetPrediction(target);

            if (target != null && !target.CanMove && predE.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High && ObjectManager.Player.LSDistance(target) < Misc["charmRange"].Cast <Slider>().CurrentValue)
            {
                return(_spellE.Cast(target));
            }
            else if (target != null && predE.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High && _spellE.WillHit(target, predE.CastPosition) && ObjectManager.Player.LSDistance(target) < Misc["charmRange"].Cast <Slider>().CurrentValue)
            {
                return(_spellE.Cast(predE.CastPosition));
            }

            return(false);
        }
示例#14
0
 private static void UseE(Obj_AI_Base enemy)
 {
     foreach (var orb in OrbManager.GetOrbs(true))
         if (Player.LSDistance(orb) < E.Range + 100)
         {
             var startPoint = orb.LSTo2D().LSExtend(Player.ServerPosition.LSTo2D(), 100);
             var endPoint = Player.ServerPosition.LSTo2D()
                 .LSExtend(orb.LSTo2D(), Player.LSDistance(orb) > 200 ? 1300 : 1000);
             Eq.Delay = E.Delay + Player.LSDistance(orb) / E.Speed;
             Eq.From = orb;
             var enemyPred = Eq.GetPrediction(enemy);
             if (enemyPred.Hitchance >= HitChance.High
                 && enemyPred.UnitPosition.LSTo2D().LSDistance(startPoint, endPoint, false)
                 < Eq.Width + enemy.BoundingRadius)
             {
                 E.Cast(orb, true);
                 W.LastCastAttemptT = Utils.TickCount;
                 return;
             }
         }
 }
示例#15
0
文件: Helper.cs 项目: riwalry1/AIO
        internal bool UseQ(AIHeroClient target, HitChance minhc = HitChance.Medium, bool UseQ1 = true, bool UseQ2 = true)
        {
            if (target == null)
            {
                return(false);
            }

            if (Yasuo.LSIsDashing() || InDash)
            {
                return(false);
            }

            var tready = TornadoReady;

            if ((tready && !UseQ2) || !tready && !UseQ1)
            {
                return(false);
            }

            if (GetMode() == Modes.Beta && !ShouldNormalQ(target))
            {
                if (tready && GetBool("Combo.UseEQ", YasuoMenu.ComboM))
                {
                    if (Spells[E].IsReady() && target.IsDashable(500))
                    {
                        var dashPos = GetDashPos(target);
                        if (dashPos.To3D().CountEnemiesInRange(QRadius) >= 1)
                        {
                            //Cast E to trigger EQ
                            if (GetBool("Misc.saveQ4QE", YasuoMenu.MiscM) && isHealthy && GetBool("Combo.UseE", YasuoMenu.ComboM) &&
                                (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) ||
                                 !GetDashPos(target).PointUnderEnemyTurret()))
                            {
                                return(Spells[E].CastOnUnit(target));
                            }
                        }
                    }
                }
            }

            else
            {
                LeagueSharp.Common.Spell sp   = tready ? Spells[Q2] : Spells[Q];
                PredictionOutput         pred = sp.GetPrediction(target);

                if (pred.Hitchance >= minhc)
                {
                    return(sp.Cast(pred.CastPosition));
                }
            }

            return(false);
        }
示例#16
0
        public static void useQSmart(AIHeroClient target, bool onlyEmp = false)
        {
            if (!Q.IsReady() || target == null)
            {
                return;
            }
            if (isQEmpovered())
            {
                if (canCastFarQ())
                {
                    PredictionOutput po = QEmp.GetPrediction(target); //QEmp.GetPrediction(target, true);
                    if (po.Hitchance >= HitChance.Medium)
                    {
//                        SmoothMouse.addMouseEvent(po.CastPosition);
                        QEmp.Cast(po.CastPosition);
                        return;
                    }
                }
                else//dashing
                {
                    Vector3 endPos = getDashEndPos();
                    if (Player.Distance(endPos) < 40 && target.Distance(endPos) < QCir.Range)
                    {
                        QCir.Cast(target.Position);
                        return;
                    }
                }
            }
            else if (!onlyEmp)
            {
                if (canCastFarQ())
                {
                    PredictionOutput po = Q.GetPrediction(target);
                    if (po.Hitchance >= HitChance.Medium)
                    {
//                        SmoothMouse.addMouseEvent(po.CastPosition);
                        Q.Cast(po.CastPosition);
                    }
                    return;
                }
                else//dashing
                {
                    float   trueRange = QCir.Range - 10;
                    Vector3 endPos    = getDashEndPos();
                    if (Player.Distance(endPos) < 40 && target.Distance(endPos) < QCir.Range)
                    {
                        QCir.Cast(target.Position);
                        return;
                    }
                }
            }
        }
示例#17
0
        static void CastQ(Obj_AI_Base t)
        {
            if (Q.CanCast(t))
            {
                var qPrediction = Q.GetPrediction(t);
                var hithere     = qPrediction.CastPosition.LSExtend(ObjectManager.Player.Position, -100);

                if (qPrediction.Hitchance >= Q.GetHitchance())
                {
                    Q.Cast(hithere);
                }
            }
        }
示例#18
0
        private static void Combo()
        {
            var useQ   = getCheckBoxItem(comboMenu, "UseQC");
            var useE   = getCheckBoxItem(comboMenu, "UseEC");
            var useR   = getCheckBoxItem(comboMenu, "UseRC");
            var Qdelay = Environment.TickCount - Qcast;
            var Rdelay = Environment.TickCount - Rcast;

            if (useQ && _q.IsReady() && Rdelay >= getSliderItem(miscMenu, "delaycombo"))
            {
                var t = TargetSelector.GetTarget(_q.Range, DamageType.Magical);
                if (t.LSIsValidTarget(_q.Range) && _q.GetPrediction(t).HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
                {
                    _q.Cast(t, false, true);
                }
                Qcast = Environment.TickCount;
            }

            if (useE && _e.IsReady())
            {
                var t = TargetSelector.GetTarget(_e.Range, DamageType.Magical);
                if (t.LSIsValidTarget(_e.Range) && _e.GetPrediction(t).HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
                {
                    _e.Cast(t, false, true);
                }
            }

            if (useR && _r.IsReady() && Qdelay >= getSliderItem(miscMenu, "delaycombo"))
            {
                var t = TargetSelector.GetTarget(_r.Range, DamageType.Magical);
                if (t.LSIsValidTarget(_r.Range) && _r.GetPrediction(t).HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
                {
                    _r.Cast(t, false, true);
                }
                Rcast = Environment.TickCount;
            }

            UseItemes();
        }
示例#19
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;
 }
示例#20
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;
 }
示例#21
0
        static void CastQ(AIHeroClient target)
        {
            if (!Q.IsReady() || target == null || Helper.EnemyHasShield(target) || !target.LSIsValidTarget())
            {
                return;
            }

            var Catched        = IsPulling().Item1;
            var CatchedQtarget = IsPulling().Item2;

            if (!Catched && qTimer == 0)
            {
                if (!E.IsReady() || (E.IsReady() &&
                                     E.Range < Player.LSDistance(target.Position)))
                {
                    var Mode = getBoxItem(Qmenu, "Predict");

                    switch (Mode)
                    {
                        #region L# Predict
                    case 0:
                    {
                        var b = Q.GetPrediction(target);

                        if (b.Hitchance >= HitChance.High &&
                            Player.LSDistance(target.ServerPosition) < Q.Range)
                        {
                            Q.Cast(target);
                        }
                    }
                    break;
                        #endregion

                        #region L# Predict2
                    case 1:
                    {
                        if (Player.LSDistance(target.ServerPosition) < Q.Range)
                        {
                            Q.CastIfHitchanceEquals(target, HitChance.High);
                        }
                    }
                    break;
                        #endregion
                    }
                }
            }
            else if (Catched && Environment.TickCount > qTimer - 200 && CastQ2() && CatchedQtarget.Type == GameObjectType.AIHeroClient && getCheckBoxItem(Qmenu, "C-UseQ2"))
            {
                Q.Cast();
            }
        }
示例#22
0
文件: Shen.cs 项目: yashine59fr/Port
        private static void HandleQ(AIHeroClient target)
        {
            Q.UpdateSourcePosition(blade);
            var pred = Q.GetPrediction(target);
            var poly = CombatHelper.GetPoly(blade.Extend(player.Position, 30).To3DWorld(), player.Distance(blade), 150);

            if (((pred.Hitchance >= HitChance.VeryHigh && poly.IsInside(pred.UnitPosition)) ||
                 (target.Distance(blade) < 100) || (target.Distance(blade) < 500 && poly.IsInside(target.Position)) ||
                 player.Distance(target) < Orbwalking.GetRealAutoAttackRange(target) || player.Spellbook.IsAutoAttacking) &&
                CheckQDef())
            {
                Q.Cast();
            }
        }
示例#23
0
文件: Yasuo.cs 项目: volder1/PortAIO
 public static void useQSmart(AIHeroClient target, bool onlyEmp = false)
 {
     if (!Q.IsReady() || target == null)
     {
         return;
     }
     if (isQEmpovered())
     {
         if (canCastFarQ())
         {
             var po = QEmp.GetPrediction(target); //QEmp.GetPrediction(target, true);
             if (po.HitChance >= EloBuddy.SDK.Enumerations.HitChance.Medium)
             {
                 QEmp.Cast(po.CastPosition);
                 return;
             }
         }
         else//dashing
         {
             Vector3 endPos = getDashEndPos();
             if (Player.LSDistance(endPos) < 40 && target.LSDistance(endPos) < QCir.Range)
             {
                 QCir.Cast(target.Position);
                 return;
             }
         }
     }
     else if (!onlyEmp)
     {
         if (canCastFarQ())
         {
             var po = Q.GetPrediction(target);
             if (po.HitChance >= EloBuddy.SDK.Enumerations.HitChance.Medium)
             {
                 Q.Cast(po.CastPosition);
             }
             return;
         }
         else//dashing
         {
             float   trueRange = QCir.Range - 10;
             Vector3 endPos    = getDashEndPos();
             if (Player.LSDistance(endPos) < 40 && target.LSDistance(endPos) < QCir.Range)
             {
                 QCir.Cast(target.Position);
                 return;
             }
         }
     }
 }
示例#24
0
        private static void CastQ(AIHeroClient t)
        {
            var Qpredict = Q.GetPrediction(t);
            var hithere  = Qpredict.CastPosition.LSExtend(ObjectManager.Player.Position, -20);

            if (Qpredict.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High)
            {
                if (W.IsReady())
                {
                    W.Cast();
                }
                Q.Cast(hithere);
            }
        }
示例#25
0
        private static void HandleQ(AIHeroClient target)
        {
            Q.UpdateSourcePosition(blade);
            var pred = Q.GetPrediction(target);
            var poly = CombatHelper.GetPoly(blade.LSExtend(player.Position, 30), player.LSDistance(blade), 150);

            if (((pred.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High && poly.IsInside(pred.UnitPosition)) ||
                 (target.LSDistance(blade) < 100) || (target.LSDistance(blade) < 500 && poly.IsInside(target.Position)) ||
                 player.LSDistance(target) < Orbwalking.GetRealAutoAttackRange(target) || ObjectManager.Player.Spellbook.IsAutoAttacking) &&
                CheckQDef())
            {
                Q.Cast();
            }
        }
示例#26
0
 private static void CastE(Obj_AI_Base t, HitChance hitchance)
 {
     if (Player.ServerPosition.Distance(t.ServerPosition) < ECastRange)
     {
         E.UpdateSourcePosition(t.ServerPosition, t.ServerPosition);
         var pred = E.GetPrediction(t, true);
         if (pred.Hitchance >= hitchance)
         {
             EloBuddy.Player.CastSpell(SpellSlot.E, pred.CastPosition, t.ServerPosition);
             //E.Cast(t.ServerPosition, pred.CastPosition);
         }
     }
     else if (Player.ServerPosition.Distance(t.ServerPosition) < ECastRange + E.Range)
     {
         var castStartPos = Player.ServerPosition.Extend(t.ServerPosition, ECastRange).To3DWorld();
         E.UpdateSourcePosition(castStartPos, castStartPos);
         var pred = E.GetPrediction(t, true);
         if (pred.Hitchance >= hitchance)
         {
             EloBuddy.Player.CastSpell(SpellSlot.E, pred.CastPosition, castStartPos);
             //E.Cast(castStartPos, pred.CastPosition);
         }
     }
 }
示例#27
0
文件: Program.cs 项目: riwalry1/AIO
 private static void CastE(bool push, Obj_AI_Base target)
 {
     if (push)
     {
         var eCastPosition = E.GetPrediction(target).CastPosition;
         E.Cast(eCastPosition);
     }
     else
     {
         var eCastPosition = Epush.GetPrediction(target).CastPosition;
         var distance      = Player.LSDistance(eCastPosition);
         var ext           = Player.Position.LSExtend(eCastPosition, -distance);
         E.Cast(ext);
     }
 }
示例#28
0
        private static void Mixed()
        {
            var useq = GetBool("useqh", typeof(bool));
            var usew = GetBool("usewh", typeof(bool));

            var target = TargetSelector.GetTarget(Player, _q.Range, TargetSelector.DamageType.Magical);

            if (!target.IsValidTargetLS())
            {
                return;
            }

            var wpred = _w.GetPrediction(target);

            if (CanUse(_q, target) && useq)
            {
                _q.Cast(target);
            }

            if (CanUse(_w, target) && usew && wpred.Hitchance >= HitChance.High)
            {
                _w.Cast(wpred.CastPosition);
            }
        }
示例#29
0
        private static void Mixed()
        {
            var useq = getCheckBoxItem(MenuConfig.harassMenu, "useqh");
            var usew = getCheckBoxItem(MenuConfig.harassMenu, "usewh");

            var target = TargetSelector.GetTarget(_q.Range, DamageType.Magical);

            if (!target.LSIsValidTarget())
            {
                return;
            }

            var wpred = _w.GetPrediction(target);

            if (CanUse(_q, target) && useq)
            {
                _q.Cast(target);
            }

            if (CanUse(_w, target) && usew && wpred.Hitchance >= HitChance.High)
            {
                _w.Cast(wpred.CastPosition);
            }
        }
示例#30
0
        private static void LogicE()
        {
            var t = TargetSelector.GetTarget(1300, DamageType.Physical);

            if (getCheckBoxItem(eMenu, "EAntiMelee"))
            {
                if (Program.Enemies.Any(target => target.IsValidTarget(1000) && target.IsMelee && Player.LSDistance(LeagueSharp.Common.Prediction.GetPrediction(target, 0.2f).CastPosition) < 250))
                {
                    var dashPos = Dash.CastDash(true);
                    if (!dashPos.IsZero)
                    {
                        E.Cast(dashPos);
                    }
                }
            }

            if (t.IsValidTarget() && Program.Combo && getCheckBoxItem(eMenu, "EKsCombo") && Player.HealthPercent > 40 && t.LSDistance(Game.CursorPos) + 300 < t.Position.LSDistance(Player.Position) && !SebbyLib.Orbwalking.InAutoAttackRange(t) && !Player.UnderTurret(true) && (Game.Time - OverKill > 0.3))
            {
                var dashPosition = Player.Position.LSExtend(Game.CursorPos, E.Range);

                if (dashPosition.CountEnemiesInRange(900) < 3)
                {
                    var dmgCombo = 0f;

                    if (t.IsValidTarget(950))
                    {
                        dmgCombo = (float)Player.GetAutoAttackDamage(t) + E.GetDamage(t);
                    }

                    if (Q.IsReady() && Player.Mana > QMANA + EMANA && Q.WillHit(dashPosition, Q.GetPrediction(t).UnitPosition))
                    {
                        dmgCombo = Q.GetDamage(t);
                    }

                    if (W.IsReady() && Player.Mana > QMANA + EMANA + WMANA)
                    {
                        dmgCombo += W.GetDamage(t);
                    }

                    if (dmgCombo > t.Health && OktwCommon.ValidUlt(t))
                    {
                        E.Cast(dashPosition);
                        OverKill = Game.Time;
                        Program.debug("E ks combo");
                    }
                }
            }
        }
示例#31
0
        private void LogicE()
        {
            var t = TargetSelector.GetTarget(1300, TargetSelector.DamageType.Physical);

            if (Config.Item("EAntiMelee", true).GetValue <bool>())
            {
                if (HeroManager.Enemies.Any(target => target.IsValidTargetLS(1000) && target.IsMelee && Player.Distance(LeagueSharp.Common.Prediction.GetPrediction(target, 0.2f).CastPosition) < 250))
                {
                    var dashPos = Dash.CastDash(true);
                    if (!dashPos.IsZero)
                    {
                        E.Cast(dashPos);
                    }
                }
            }

            if (t.IsValidTargetLS() && Program.Combo && Config.Item("EKsCombo", true).GetValue <bool>() && Player.HealthPercent > 40 && t.Distance(Game.CursorPos) + 300 < t.Position.Distance(Player.Position) && !EloBuddy.Player.Instance.IsInAutoAttackRange(t) && !Player.UnderTurret(true) && (Game.Time - OverKill > 0.3))
            {
                var dashPosition = Player.Position.Extend(Game.CursorPos, E.Range).To3DWorld();

                if (dashPosition.CountEnemiesInRange(900) < 3)
                {
                    var dmgCombo = 0f;

                    if (t.IsValidTargetLS(950))
                    {
                        dmgCombo = (float)Player.GetAutoAttackDamage(t) + E.GetDamage(t);
                    }

                    if (Q.IsReady() && Player.Mana > QMANA + EMANA && Q.WillHit(dashPosition, Q.GetPrediction(t).UnitPosition))
                    {
                        dmgCombo = Q.GetDamage(t);
                    }

                    if (W.IsReady() && Player.Mana > QMANA + EMANA + WMANA)
                    {
                        dmgCombo += W.GetDamage(t);
                    }

                    if (dmgCombo > t.Health && OktwCommon.ValidUlt(t))
                    {
                        E.Cast(dashPosition);
                        OverKill = Game.Time;
                        Program.debug("E ks combo");
                    }
                }
            }
        }
示例#32
0
 private static void CastQ(AIHeroClient target)
 {
     var ext = 0;
     if (player.LSDistance(target.ServerPosition) > 400)
     {
         ext = 100;
     }
     var pred = Q.GetPrediction(target, true);
     var pos = player.Position.LSExtend(pred.CastPosition, player.LSDistance(pred.CastPosition) + ext);
     if (pred.CastPosition.IsValid() && target.LSDistance(pos) < player.LSDistance(target) &&
         pred.Hitchance >= HitChance.Medium)
     {
         //Console.WriteLine(2 + " - " + " - " + pred.Hitchance);
         Q.Cast(pos);
     }
 }
        public static bool DoCast(Spell spell, Obj_AI_Hero target, HitChance minHitChance, bool colisionCheck=false)
        {
            //  Data.Static.Objects.ProjectLogger.WriteLog("DoCast Call");
            if ((PredictionMethod==0)||((PredictionMethod==1)&&colisionCheck)) //Sebby Colision is broken...lol
            {
                var output=spell.GetPrediction(target);

                if (colisionCheck)
                    if (CheckColision(output))
                        return false;

                if (minHitChance>output.Hitchance)
                    return false;

                spell.Cast(output.CastPosition);
                return true;
            }

            if (PredictionMethod==1)
            {
                var output=SebbyLib.Prediction.Prediction.GetPrediction(target, spell.Delay);

                if (minHitChance>(HitChance)output.Hitchance)
                    return false;

                spell.Cast(output.CastPosition);
                return true;
            }

            if (PredictionMethod==2)
            {
                var output=spell.GetSPrediction(target);

                if (colisionCheck)
                    if (CheckColision(output))
                        return false;

                if (minHitChance>output.HitChance)
                    return false;

                spell.Cast(output.CastPosition);
                return true;
            }

            return false;
        }
示例#34
0
        internal bool UseQ(AIHeroClient target, HitChance minhc = HitChance.Medium, bool UseQ1 = true, bool UseQ2 = true)
        {
            if (target == null)
            {
                return(false);
            }

            var tready = TornadoReady;

            if ((tready && !UseQ2) || !tready && !UseQ1)
            {
                return(false);
            }

            if (tready)
            {
                //Avoid casting Q if E in range and Tornado ready :o
                if (Spells[E].IsReady() && target.IsDashable() && GetBool("Misc.saveQ4QE", YasuoMenu.MiscM) && GetBool("Combo.UseEQ", YasuoMenu.ComboM) &&
                    isHealthy &&
                    (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) && GetBool("Combo.UseE", YasuoMenu.ComboM) &&
                     ((GetBool("Combo.ETower", YasuoMenu.ComboM) && GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM)) ||
                      !GetDashPos(target).PointUnderEnemyTurret())))
                {
                    return(Spells[E].CastOnUnit(target));
                }

                if (Yasuo.LSIsDashing())
                {
                    if (GetBool("Combo.NoQ2Dash", YasuoMenu.ComboM) || !(ETarget is AIHeroClient))
                    {
                        return(false);
                    }
                }
            }

            LeagueSharp.Common.Spell sp   = tready ? Spells[Q2] : Spells[Q];
            PredictionOutput         pred = sp.GetPrediction(target);

            if (pred.Hitchance >= minhc)
            {
                return(sp.Cast(pred.CastPosition));
            }

            return(false);
        }
示例#35
0
        private static void CastSpell(Spell spell, BuffType x, Obj_AI_Hero target, float lastpostime)
        {
            if (x == BuffType.Stun || x == BuffType.Snare || x == BuffType.Knockup || x == BuffType.Fear)
            {
                if (Game.Time <= lastpostime)
                {
                    spell.Cast(target.ServerPosition);
                }
            }
            else
            {

                var pred = spell.GetPrediction(target);
                if (pred != null && Game.Time <= lastpostime)
                {
                    spell.Cast(pred.CastPosition);
                }
            }
        }
示例#36
0
        /// <summary>
        ///     Spell extension for cast spell with SPrediction
        /// </summary>
        /// <param name="s">Spell to cast</param>
        /// <param name="t">Target for spell</param>
        /// <param name="hc">Minimum HitChance to cast</param>
        /// <param name="reactionIgnoreDelay">Delay to ignore target's reaction time</param>
        /// <param name="minHit">Minimum Hit Count to cast</param>
        /// <param name="rangeCheckFrom">Position where spell will be casted from</param>
        /// <param name="filterHPPercent">Minimum HP Percent to cast (for target)</param>
        /// <returns>true if spell has casted</returns>
        public static bool SPredictionCast(this Spell s, AIHeroClient t, HitChance hc, int reactionIgnoreDelay = 0,
                                           byte minHit = 1, Vector3?rangeCheckFrom = null, float filterHPPercent = 100)
        {
            if (rangeCheckFrom == null)
            {
                rangeCheckFrom = ObjectManager.Player.ServerPosition;
            }

            if (t == null)
            {
                return(s.Cast());
            }

            if (!s.IsSkillshot)
            {
                return(s.Cast(t) == Spell.CastStates.SuccessfullyCasted);
            }

            #region if common prediction selected

            var pout = s.GetPrediction(t, minHit > 1);

            if (minHit > 1)
            {
                if (pout.AoeTargetsHitCount >= minHit)
                {
                    return(s.Cast(pout.CastPosition));
                }
                else
                {
                    return(false);
                }
            }

            if (pout.Hitchance >= hc)
            {
                return(s.Cast(pout.CastPosition));
            }
            return(false);

            #endregion
        }
示例#37
0
        private static void KSQ()
        {
            foreach (AIHeroClient hero in ObjectManager.Get <AIHeroClient>().Where(unit => unit.LSIsValidTarget(Q.Range)))
            {
                var target = TargetSelector.GetTarget(Q.Range, DamageType.Magical);
                if (target == null)
                {
                    return;
                }

                var prediction = Q.GetPrediction(target);

                if (Q.IsReady())
                {
                    if (target.Health < GetQDamage(target))
                    {
                        Q.Cast(prediction.CastPosition);
                    }
                }
            }
        }
示例#38
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);
            }
        }
示例#39
0
 private void CastQHero(AIHeroClient target)
 {
     if (Program.IsSPrediction)
     {
         var pred = Q.GetSPrediction(target);
         if (pred.CollisionResult.Units.Count < 2)
         {
             Q.Cast(pred.CastPosition);
         }
     }
     else
     {
         var targQ     = Q.GetPrediction(target, true);
         var collision = Q.GetCollision(
             player.Position.To2D(), new List <Vector2>()
         {
             targQ.CastPosition.To2D()
         });
         if (Q.Range - 100 > targQ.CastPosition.Distance(player.Position) && collision.Count < 2)
         {
             Q.CastIfHitchanceEquals(target, HitChance.High);
         }
     }
 }
示例#40
0
 private static void CircleFarm(Spell spell, List<Obj_AI_Base> minions, int min, float overrideWidth = -1f)
 {
     var spellWidth = overrideWidth > 0 ? overrideWidth : spell.Width;
     var points = (from minion in minions
         select spell.GetPrediction(minion)
         into pred
         where pred.Hitchance >= HitChance.Medium
         select pred.UnitPosition.To2D()).ToList();
     if (points.Any())
     {
         var possibilities = ListExtensions.ProduceEnumeration(points).Where(p => p.Count >= min).ToList();
         if (possibilities.Any())
         {
             var hits = 0;
             var radius = float.MaxValue;
             var pos = Vector3.Zero;
             foreach (var possibility in possibilities)
             {
                 var mec = MEC.GetMec(possibility);
                 if (mec.Radius < spellWidth * 0.95f)
                 {
                     if (possibility.Count > hits || possibility.Count == hits && radius > mec.Radius)
                     {
                         hits = possibility.Count;
                         radius = mec.Radius;
                         pos = mec.Center.To3D();
                     }
                 }
             }
             if (hits >= min && !pos.Equals(Vector3.Zero))
             {
                 spell.Cast(pos);
             }
         }
     }
 }
示例#41
0
 private static void LineFarm(Spell spell, List<Obj_AI_Base> minions, int min, float overrideWidth = -1f)
 {
     var spellWidth = overrideWidth > 0 ? overrideWidth : spell.Width;
     var totalHits = 0;
     var castPos = Vector3.Zero;
     foreach (var minion in minions)
     {
         var lMinion = minion;
         var pred = spell.GetPrediction(minion);
         if (pred.Hitchance < HitChance.Medium)
         {
             continue;
         }
         var rect = new Geometry.Polygon.Rectangle(
             ObjectManager.Player.Position.To2D(),
             ObjectManager.Player.Position.Extend(pred.CastPosition, spell.Range).To2D(), spellWidth);
         var count = 1 + (from minion2 in minions.Where(m => m.NetworkId != lMinion.NetworkId)
             let pred2 = spell.GetPrediction(minion2)
             where pred2.Hitchance >= HitChance.Medium
             where
                 new Geometry.Polygon.Circle(pred2.UnitPosition, minion2.BoundingRadius * 0.8f).Points.Any(
                     p => rect.IsInside(p))
             select 1).Sum();
         if (count > totalHits)
         {
             totalHits = count;
             castPos = pred.CastPosition;
         }
         if (totalHits == minions.Count)
         {
             break;
         }
         if (!castPos.Equals(Vector3.Zero) && totalHits >= min)
         {
             spell.Cast(castPos);
         }
     }
 }
示例#42
0
 public static bool SmiteCollision(Obj_AI_Hero target, Spell Skill)
 {
     var Col1 = CheckingCollision(Player, target, Skill);
     if (Col1.Count == 0 || Col1.Count > 1) return false;
     if (Skill.InRange(target.Position) && Col1.Count == 1 && (Col1.First() is Obj_AI_Minion))
     {
         if (CastSmite(Col1.First()))
         {
             Skill.Cast(Skill.GetPrediction(target).CastPosition, PacketCast);
             return true;
         }
     }
     return false;
 }
示例#43
0
        private static void OnGameUpdate(EventArgs args)
        {
            try
            {
                if (Player.IsDead)
                {
                    return;
                }
                var QTarget = TargetSelector.GetTarget(_Q.Range, DamageType.Magical);
                var WTarget = TargetSelector.GetTarget(1500, DamageType.Physical);
                var RTarget = TargetSelector.GetTarget(_R.Range, DamageType.Magical);

                if (getCheckBoxItem(MiscMenu, "Blitzcrank_GrabDash") && _Q.IsReady())
                {
                    if (QTarget != null && _Q.GetPrediction(QTarget).Hitchance == HitChance.Dashing)
                    {
                        _Q.CastIfHitchanceEquals(QTarget, HitChance.Dashing, true);
                    }
                }

                //killsteal
                if (getCheckBoxItem(KSMenu, "Blitzcran_KUse_Q") && QTarget != null &&
                    QTarget.Health < _Q.GetDamage(QTarget) && _Q.IsReady())
                {
                    _Q.CastIfHitchanceEquals(QTarget, HitChance.VeryHigh, true);
                    return;
                }
                if (getCheckBoxItem(KSMenu, "Blitzcran_KUse_R") && RTarget != null &&
                    RTarget.Health < _E.GetDamage(RTarget) && _R.IsReady())
                {
                    _R.Cast(true);
                    return;
                }

                if (QTarget == null)
                {
                    return;                  // auto grab
                }
                foreach (var enemy in ObjectManager.Get <AIHeroClient>())
                {
                    if (enemy.Team != Player.Team && QTarget != null &&
                        getSliderItem(MiscMenu, "Blitzcrank_GrabSelect" + enemy.ChampionName) == 2 && _Q.IsReady() &&
                        QTarget.ChampionName == enemy.ChampionName)
                    {
                        if (QTarget.CanMove && QTarget.Distance(Player.Position) < _Q.Range * 0.9)
                        {
                            _Q.CastIfHitchanceEquals(QTarget, FreshCommon.Hitchance("Blitzcrank_CUseQ_Hit"), true);
                        }
                        if (!QTarget.CanMove)
                        {
                            _Q.CastIfHitchanceEquals(QTarget, FreshCommon.Hitchance("Blitzcrank_CUseQ_Hit"), true);
                        }
                    }
                }

                // Combo
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                {
                    if (getCheckBoxItem(ComboMenu, "Blitzcrank_CUse_Q") && _Q.IsReady() && QTarget != null &&
                        getSliderItem(MiscMenu, "Blitzcrank_GrabSelect" + QTarget.ChampionName) != 1)
                    {
                        _Q.CastIfHitchanceEquals(QTarget, FreshCommon.Hitchance("Blitzcrank_CUseQ_Hit"), true);
                    }
                    if (getCheckBoxItem(ComboMenu, "Blitzcrank_CUse_W") && _W.IsReady() && WTarget != null)
                    {
                        _W.Cast(Player, true);
                    }
                    if (getCheckBoxItem(ComboMenu, "Blitzcrank_CUse_E") && _E.IsReady() &&
                        QTarget.Distance(Player.ServerPosition) < 230)
                    {
                        _E.Cast(Player);
                    }
                    if (getCheckBoxItem(ComboMenu, "Blitzcrank_CUse_R") && _R.IsReady() && RTarget != null)
                    {
                        _R.Cast();
                    }
                }

                // Harass
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass) &&
                    getSliderItem(HarassMenu, "Blitzcrank_AManarate") < Player.ManaPercent)
                {
                    if (getCheckBoxItem(HarassMenu, "Blitzcrank_HUse_Q") && _Q.IsReady() && QTarget != null &&
                        getSliderItem(MiscMenu, "Blitzcrank_GrabSelect" + QTarget.ChampionName) != 1)
                    {
                        _Q.CastIfHitchanceEquals(QTarget, FreshCommon.Hitchance("Blitzcrank_CUseQ_Hit"), true);
                    }
                    if (getCheckBoxItem(HarassMenu, "Blitzcrank_HUse_W") && _W.IsReady() && WTarget != null)
                    {
                        _W.Cast(Player, true);
                    }
                    if (getCheckBoxItem(HarassMenu, "Blitzcrank_HUse_E") && _E.IsReady() &&
                        QTarget.Distance(Player.ServerPosition) < 230)
                    {
                        _E.Cast(Player);
                    }
                }
            }
            catch (Exception)
            {
                if (FreshCommon.NowTime() > ErrorTime)
                {
                    Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 06");
                    ErrorTime = FreshCommon.TickCount(10000);
                }
            }
        }
示例#44
0
 private static void CollisionObjectCheckCast(Spell spell, AIHeroClient unit, int count)
 {
     if (spell.GetPrediction(unit).CollisionObjects.Count < count)
     {
         if ((spell.GetPrediction(unit).CollisionObjects.Any(x => x.IsChampion() && x.IsEnemy)))
         {
             spell.Cast(Game.CursorPos);
         }
     }
 }
示例#45
0
        private static void CastSpell(Spell QWER, Obj_AI_Hero target, int HitChanceNum)
        {
            //HitChance 0 - 2
            // example CastSpell(Q, ts, 2);
            var poutput = QWER.GetPrediction(target);
            var col = poutput.CollisionObjects.Count(ColObj => ColObj.IsEnemy && ColObj.IsMinion && !ColObj.IsDead);
            if (QWER.Collision && col > 0)
                return;
            if (HitChanceNum == 0)
                QWER.Cast(target, true);
            else if (HitChanceNum == 1)
            {
                if ((int)poutput.Hitchance > 4)
                    QWER.Cast(poutput.CastPosition);
            }
            else if (HitChanceNum == 2)
            {
                if ((target.IsFacing(ObjectManager.Player) && (int)poutput.Hitchance == 5) || (target.Path.Count() == 0 && target.Position == target.ServerPosition))
                {
                    if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed) + (target.BoundingRadius * 2)))
                    {
                        QWER.Cast(poutput.CastPosition);
                    }
                }
                else if ((int)poutput.Hitchance == 5)
                {
                    QWER.Cast(poutput.CastPosition);
                }
            }
            else if (HitChanceNum == 3)
            {
                List<Vector2> waypoints = target.GetWaypoints();
                float SiteToSite = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed)) * 6 - QWER.Width;
                float BackToFront = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed));
                if (ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) < SiteToSite || ObjectManager.Player.Distance(target.Position) < SiteToSite)
                    QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                else if (target.Path.Count() < 2
                    && (target.ServerPosition.Distance(waypoints.Last<Vector2>().To3D()) > SiteToSite
                    || Math.Abs(ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) - ObjectManager.Player.Distance(target.Position)) > BackToFront
                    || target.HasBuffOfType(BuffType.Slow) || target.HasBuff("Recall")
                    || (target.Path.Count() == 0 && target.Position == target.ServerPosition)
                    ))
                {
                    if (target.IsFacing(ObjectManager.Player) || target.Path.Count() == 0)
                    {
                        if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed) + (target.BoundingRadius * 2)))
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
            else if (HitChanceNum == 4 && (int)poutput.Hitchance > 4)
            {

                List<Vector2> waypoints = target.GetWaypoints();
                float SiteToSite = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed)) * 6 - QWER.Width;
                float BackToFront = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed));
                if (ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) < SiteToSite || ObjectManager.Player.Distance(target.Position) < SiteToSite)
                    QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                else if (target.Path.Count() < 2
                    && (target.ServerPosition.Distance(waypoints.Last<Vector2>().To3D()) > SiteToSite
                    || Math.Abs(ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) - ObjectManager.Player.Distance(target.Position)) > BackToFront
                    || target.HasBuffOfType(BuffType.Slow) || target.HasBuff("Recall")
                    || (target.Path.Count() == 0 && target.Position == target.ServerPosition)
                    ))
                {
                    // max range fix
                    if (target.IsFacing(ObjectManager.Player) || target.Path.Count() == 0)
                    {
                        if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed) + (target.BoundingRadius * 2)))
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
        }
示例#46
0
 public static bool IsSpellHeroCollision(Obj_AI_Hero t, Spell QWER, int extraWith = 50)
 {
     foreach (var hero in HeroManager.Enemies.FindAll( hero => hero.IsValidTarget(QWER.Range + QWER.Width, true, QWER.RangeCheckFrom) && t.NetworkId != hero.NetworkId))
     {
         var prediction = QWER.GetPrediction(hero);
         var powCalc = Math.Pow((QWER.Width + extraWith + hero.BoundingRadius), 2);
         if (prediction.UnitPosition.To2D().Distance(QWER.From.To2D(), QWER.GetPrediction(t).CastPosition.To2D(), true, true) <= powCalc)
         {
             return true;
         }
         else if (prediction.UnitPosition.To2D().Distance(QWER.From.To2D(), t.ServerPosition.To2D(), true, true) <= powCalc)
         {
             return true;
         }
            
     }
     return false;
 }
示例#47
0
        private static void Combo(bool useq, bool usee, bool user)
        {
            if (!Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                return;
            }

            if (useq && Q.IsReady())
            {
                var QT = TargetSelector.GetTarget(getSliderItem(qsmenu, "maxq"), DamageType.Magical);
                if (QT != null && getCheckBoxItem(qsmenu, "blq" + QT.NetworkId))
                {
                    return;
                }

                if (!(Player.HealthPercent < getSliderItem(qsmenu, "grabhp")))
                {
                    if (QT.LSIsValidTarget() && QT.LSDistance(Player.ServerPosition) > getSliderItem(qsmenu, "minq"))
                    {
                        if (!QT.IsZombie && !QT.IsInvulnerable)
                        {
                            var poutput = Q.GetPrediction(QT); // prediction output
                            if (Utils.GameTimeTickCount - LastFlash < 1500)
                            {
                                if (poutput.Hitchance == (HitChance)getSliderItem(qsmenu, "fpred") + 2)
                                {
                                    Q.Cast(poutput.CastPosition);
                                }
                            }

                            if (poutput.Hitchance == (HitChance)getSliderItem(qsmenu, "pred") + 2)
                            {
                                Q.Cast(poutput.CastPosition);
                            }
                        }
                    }
                }
            }

            if (usee && E.IsReady())
            {
                var ET =
                    HeroManager.Enemies.FirstOrDefault(
                        x => x.HasBuff("rocketgrab2") || x.LSDistance(Player.ServerPosition) <= E.Range + 200);

                if (ET != null)
                {
                    if (!ET.IsZombie && !ET.IsInvulnerable)
                    {
                        E.Cast();
                    }
                }
            }

            if (user && R.IsReady())
            {
                var RT = TargetSelector.GetTarget(R.Range, DamageType.Magical);
                if (RT.LSIsValidTarget() && !RT.IsZombie)
                {
                    if (!RT.IsInvulnerable)
                    {
                        if (RT.Health > R.GetDamage(RT) && !E.IsReady() && RT.HasBuffOfType(BuffType.Knockup))
                        {
                            R.Cast();
                        }
                    }
                }
            }
        }
示例#48
0
 public static void CastSpell(Spell spell, Obj_AI_Base target, HitChance hitChance)
 {
     if (target.IsValidTarget(spell.Range) && spell.GetPrediction(target).Hitchance >= hitChance)
         spell.Cast(target);
 }
示例#49
0
文件: Champion.cs 项目: Imatation/LS-
        public void Cast_BasicCircleSkillshot_Enemy(Spell spell, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, float extrarange = 0)
		{
			if(!spell.IsReady() || !ManaManagerAllowCast(spell))
				return;
            var target = SimpleTs.GetTarget(spell.Range + extrarange, damageType);
			if(target == null)
				return;
            if (target.IsValidTarget(spell.Range + extrarange) && spell.GetPrediction(target).Hitchance >= HitChance.High)
				spell.Cast(target, Packets());
		}
示例#50
0
文件: Champion.cs 项目: Imatation/LS-
		public void Cast_BasicLineSkillshot_Enemy(Spell spell, Vector3 sourcePosition, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
		{
			if(!spell.IsReady() || !ManaManagerAllowCast(spell))
				return;
			spell.UpdateSourcePosition(sourcePosition, sourcePosition);
            foreach (var hero in Program.Helper.EnemyTeam
				.Where(hero => (hero.Distance(sourcePosition) < spell.Range) && hero.IsValidTarget()).Where(hero => spell.GetPrediction(hero).Hitchance >= HitChance.High))
			{
				spell.Cast(hero, Packets());
				return;
			}
		}
示例#51
0
文件: Champion.cs 项目: Imatation/LS-
		public Obj_AI_Hero Cast_BasicLineSkillshot_Enemy(Spell spell, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
		{
			if(!spell.IsReady() || !ManaManagerAllowCast(spell))
				return null;
			var 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, Packets());
			return target;
		}
 public static Obj_AI_Hero GetTargetNoCollision(Spell spell,
     bool ignoreShields = true,
     Vector3 from = default(Vector3),
     IEnumerable<Obj_AI_Hero> ignoreChampions = null)
 {
     return
         GetTargets(
             spell.Range,
             (spell.DamageType == LeagueSharp.Common.TargetSelector.DamageType.True
                 ? DamageType.True
                 : (spell.DamageType == LeagueSharp.Common.TargetSelector.DamageType.Physical
                     ? DamageType.Physical
                     : DamageType.Magical)), ignoreShields, from, ignoreChampions)
             .FirstOrDefault(t => spell.GetPrediction(t).Hitchance != HitChance.Collision);
 }
示例#53
0
文件: LeeSin.cs 项目: volder1/PortAIO
        private static void OnGameUpdate(EventArgs args)
        {
            try
            {
                if (Player.IsDead)
                {
                    return;
                }
                //킬스틸 타겟
                var KTarget = ObjectManager.Get <AIHeroClient>().OrderByDescending(x => x.Health).FirstOrDefault(x => x.IsEnemy && x.LSDistance(Player) < 375);
                if (KTarget != null && getCheckBoxItem(miscMenu, "LeeSin_KUse_R") && KTarget.Health < _R.GetDamage(KTarget) && _R.IsReady())
                {
                    _R.Cast(KTarget, true);
                }
                if (InsecTime < Environment.TickCount)
                {
                    InsecType = "Wait";                                    // 인섹킥 초기화
                }
                if (Ward_Time < Environment.TickCount)
                {
                    WW = true;                                      // 와드방호 초기화
                }
                if (getSliderItem(miscMenu, "LeeSin_AutoKick") != 0 && _R.Level > 0 && _R.IsReady() && !getKeyBindItem(miscMenu, "LeeSin_InsecKick"))
                {
                    AutoKick();                                                      // 오토 킥
                }
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo)) // Combo
                {
                    var QTarget = TargetSelector.GetTarget(_Q.Range, DamageType.Physical);
                    var ETarget = TargetSelector.GetTarget(_E.Range, DamageType.Physical);
                    if (QTarget != null && _Q.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).Name == "BlindMonkQOne" && getCheckBoxItem(comboMenu, "LeeSin_CUse_Q") && QTime < Environment.TickCount)
                    {
                        var HC = EloBuddy.SDK.Enumerations.HitChance.Medium;
                        switch (getSliderItem(comboMenu, "LeeSin_CUseQ_Hit"))
                        {
                        case 1:
                            HC = EloBuddy.SDK.Enumerations.HitChance.Low;
                            break;

                        case 2:
                            HC = EloBuddy.SDK.Enumerations.HitChance.Medium;
                            break;

                        case 3:
                            HC = EloBuddy.SDK.Enumerations.HitChance.High;
                            break;
                        }
                        var prediction = _Q.GetPrediction(QTarget);
                        if (prediction.HitChance >= HC)
                        {
                            _Q.Cast(prediction.CastPosition);
                        }
                        QTime = TickCount(2000);
                    }

                    if (QTarget != null && QTarget.HasBuff("BlindMonkSonicWave") && _Q.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).Name != "BlindMonkQOne" && getCheckBoxItem(comboMenu, "LeeSin_CUse_Q"))
                    {
                        _Q.Cast();
                    }

                    if (ETarget != null && _E.IsReady() && !Orbwalker.CanAutoAttack && Orbwalker.CanMove && ETime < Environment.TickCount && getCheckBoxItem(comboMenu, "LeeSin_CUse_E"))
                    {
                        _E.Cast(true);
                        ETime = TickCount(1000);
                    }
                    if (!_Q.IsReady() && !_E.IsReady() && !Orbwalker.CanAutoAttack && Orbwalker.CanMove && WTime < Environment.TickCount && getCheckBoxItem(comboMenu, "LeeSin_CUse_W"))
                    {
                        _W.Cast(Player, true);
                        WTime = TickCount(1000);
                    }
                }
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass)) // Hafass
                {
                    var QTarget = TargetSelector.GetTarget(_Q.Range, DamageType.Physical);
                    var ETarget = TargetSelector.GetTarget(_E.Range, DamageType.Physical);
                    if (QTarget != null && _Q.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).Name == "BlindMonkQOne" && getCheckBoxItem(harassMenu, "LeeSin_HUse_Q") && QTime < Environment.TickCount)
                    {
                        var HC = EloBuddy.SDK.Enumerations.HitChance.Medium;
                        _Q.CastIfHitchanceEquals(QTarget, HC, true);
                        QTime = TickCount(2000);
                    }
                    if (ETarget != null && _E.IsReady() && !Orbwalker.CanAutoAttack && Orbwalker.CanMove && ETime < Environment.TickCount && getCheckBoxItem(harassMenu, "LeeSin_HUse_E"))
                    {
                        _E.Cast(true);
                        ETime = TickCount(1000);
                    }
                    if (!_Q.IsReady() && !_E.IsReady() && !Orbwalker.CanAutoAttack && Orbwalker.CanMove && WTime < Environment.TickCount && getCheckBoxItem(harassMenu, "LeeSin_HUse_W"))
                    {
                        _W.Cast(Player, true);
                        WTime = TickCount(1000);
                    }
                }
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear)) // LaneClear
                {
                    var JungleTarget = MinionManager.GetMinions(1100, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);
                    foreach (var minion in JungleTarget)
                    {
                        if (_Q.IsReady() && getCheckBoxItem(jungleClearMenu, "LeeSin_JUse_Q") && minion != null && Environment.TickCount > QTime)
                        {
                            _Q.CastIfHitchanceEquals(minion, EloBuddy.SDK.Enumerations.HitChance.Medium, true);
                            QTime = TickCount(1500);
                        }
                        if (_E.IsReady() && getCheckBoxItem(jungleClearMenu, "LeeSin_JUse_E") && minion != null && Environment.TickCount > ETime &&
                            !Orbwalker.CanAutoAttack && Orbwalker.CanMove)
                        {
                            _E.Cast(true);
                            ETime = TickCount(1500);
                        }
                        if (_W.IsReady() && getCheckBoxItem(jungleClearMenu, "LeeSin_JUse_W") && minion != null && Environment.TickCount > WTime &&
                            !Orbwalker.CanAutoAttack && Orbwalker.CanMove)
                        {
                            _W.Cast(Player, true);
                            WTime = TickCount(1500);
                        }
                    }

                    var MinionTarget = MinionManager.GetMinions(1100, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health);
                    foreach (var minion in MinionTarget)
                    {
                        if (_Q.IsReady() && getCheckBoxItem(laneClearMenu, "LeeSin_LUse_Q") && minion != null && Environment.TickCount > QTime)
                        {
                            _Q.CastIfHitchanceEquals(minion, EloBuddy.SDK.Enumerations.HitChance.Medium, true);
                            QTime = TickCount(1000);
                        }
                        if (_E.IsReady() && getCheckBoxItem(laneClearMenu, "LeeSin_LUse_E") && minion != null && Environment.TickCount > ETime &&
                            !Orbwalker.CanAutoAttack && Orbwalker.CanMove)
                        {
                            _E.Cast(true);
                            ETime = TickCount(1000);
                        }
                        if (_W.IsReady() && getCheckBoxItem(laneClearMenu, "LeeSin_LUse_W") && minion != null && Environment.TickCount > WTime && !Orbwalker.CanAutoAttack && Orbwalker.CanMove)
                        {
                            _W.Cast(Player, true);
                            WTime = TickCount(1000);
                        }
                    }
                }
                if (getKeyBindItem(miscMenu, "LeeSin_InsecKick"))    // 인섹킥
                {
                    EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);

                    var GetTarget = TargetSelector.SelectedTarget;

                    if (GetTarget == null || GetTarget.IsDead)
                    {
                        return;
                    }

                    if (_Q.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).Name == "BlindMonkQOne" && _Q.GetPrediction(GetTarget).HitChance >= EloBuddy.SDK.Enumerations.HitChance.Low)
                    {
                        _Q.Cast(GetTarget);
                    }
                    else if (_Q.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).Name != "BlindMonkQOne" && GetTarget.HasBuff("BlindMonkSonicWave"))
                    {
                        _Q.Cast();
                    }

                    var Turrets = ObjectManager.Get <Obj_Turret>()
                                  .OrderBy(obj => obj.Position.LSDistance(Player.Position))
                                  .FirstOrDefault(obj => obj.IsAlly && obj.Health > 1);
                    var AllyChampion = ObjectManager.Get <AIHeroClient>().FirstOrDefault(obj => obj.IsAlly && !obj.IsMe && !obj.IsDead && obj.LSDistance(Player.Position) < 2000);
                    if (Turrets == null && AllyChampion == null)
                    {
                        return;
                    }
                    if (AllyChampion != null)
                    {
                        InsecST = AllyChampion.Position;
                    }
                    else
                    {
                        InsecST = Turrets.Position;
                    }
                    InsecED  = GetTarget.Position;
                    InsecPOS = InsecST.LSExtend(InsecED, +InsecED.LSDistance(InsecST) + 230);
                    MovingPlayer(InsecPOS);
                    if (!_R.IsReady())
                    {
                        return;
                    }

                    if (getCheckBoxItem(miscMenu, "LeeSin_KickAndFlash") && InsecPOS.LSDistance(Player.Position) < 425 &&
                        GetTarget.LSDistance(Player.Position) < 375 && InsecType == "Wait" && _R.Level > 0 && _R.IsReady() &&
                        InsecType != "WF" && InsecType != "WF1" && Player.GetSpellSlot("SummonerFlash").IsReady())
                    {
                        InsecTime = TickCount(2000);
                        InsecType = "RF";
                        _R.Cast(GetTarget, true);
                        return;
                    }
                    if (InsecPOS.LSDistance(Player.Position) < 625 && _R.Level > 0 && _R.IsReady() && InsecType != "RF")
                    {
                        if (InsecType == "Wait" && InsecType != "WF" && InsecType != "WF1" && _W.IsReady())
                        {
                            if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name == "blindmonkwtwo")
                            {
                                return;
                            }
                            InsecTime = TickCount(2000);
                            InsecType = "WF";
                            var Ward = Items.GetWardSlot();
                            Player.Spellbook.CastSpell(Ward.SpellSlot, InsecPOS);
                        }
                        if (InsecType == "WF" && _W.IsReady())
                        {
                            if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name == "blindmonkwtwo")
                            {
                                return;
                            }
                            var WardObj = ObjectManager.Get <Obj_AI_Base>()  // 커서근처 와드 유무
                                          .OrderBy(obj => obj.LSDistance(InsecPOS))
                                          .FirstOrDefault(obj => obj.IsAlly && !obj.IsMe &&
                                                          obj.LSDistance(InsecPOS) <= 110 && obj.Name.ToLower().Contains("ward"));
                            if (WardObj != null)
                            {
                                InsecType = "WF1";
                                _W.Cast(WardObj, true);
                            }
                        }
                        if (InsecType == "WF1")
                        {
                            if (GetTarget.LSDistance(Player.Position) < 375)
                            {
                                _R.Cast(GetTarget, true);
                            }
                            else
                            {
                                EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
                            }
                        }
                        return;
                    }

                    // 플 425, 와드 625
                }
                if (getKeyBindItem(miscMenu, ("LeeSin_Ward_W")))   // 와드 방호
                {
                    //와드방호는 WW로 정의
                    var Cursor = Game.CursorPos;
                    var Ward   = Items.GetWardSlot();
                    EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, Cursor);
                    //Console.WriteLine(ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name);
                    if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name.ToLower() == "blindmonkwtwo")
                    {
                        return;
                    }
                    if (Player.LSDistance(Cursor) > 700)
                    {
                        Cursor = Game.CursorPos.LSExtend(Player.Position, +Player.LSDistance(Game.CursorPos) - 700);
                    }
                    //Render.Circle.DrawCircle(Cursor, 50, Color.Black, 2);
                    //Drawing.DrawText(200, 200, Color.White, "WW is: " + WW.ToString());
                    if (_W.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name.ToLower() == "blindmonkwone")
                    {
                        var Object  = ObjectManager.Get <AIHeroClient>().FirstOrDefault(obj => obj.IsAlly && !obj.IsMe && obj.LSDistance(Cursor) < 110); // 커서근처 챔프유무
                        var Minion  = MinionManager.GetMinions(Cursor, 110, MinionTypes.All, MinionTeam.Ally);                                           // 아군 미니언 유무
                        var WardObj = ObjectManager.Get <Obj_AI_Base>()                                                                                  // 커서근처 와드 유무
                                      .OrderBy(obj => obj.LSDistance(Cursor))
                                      .FirstOrDefault(obj => obj.IsAlly && !obj.IsMe &&
                                                      obj.LSDistance(Cursor) <= 110 && obj.Name.ToLower().Contains("ward"));
                        if (WardObj != null && WTime < Environment.TickCount)
                        {
                            _W.Cast(WardObj, true);
                            Ward_Time = TickCount(2000);
                            WW        = true;
                            WTime     = TickCount(2000);
                            return;
                        }
                        if (Object != null && WTime < Environment.TickCount)
                        {
                            _W.Cast(Object, true);
                            Ward_Time = TickCount(2000);
                            WW        = true;
                            WTime     = TickCount(2000);
                            return;
                        }
                        if (Minion != null && WTime < Environment.TickCount)
                        {
                            foreach (var minion in Minion)
                            {
                                if (minion != null)
                                {
                                    _W.Cast(minion, true);
                                    Ward_Time = TickCount(2000);
                                    WW        = true;
                                    WTime     = TickCount(2000);
                                    return;
                                }
                            }
                        }
                        if (Player.LSDistance(Cursor) > 625)
                        {
                            Cursor = Game.CursorPos.LSExtend(Player.Position, +Player.LSDistance(Game.CursorPos) - 625);
                        }
                        //Render.Circle.DrawCircle(Cursor, 50, Color.Black, 2);
                        if (WW && Ward != null && Ward_Time < Environment.TickCount)
                        {
                            Player.Spellbook.CastSpell(Ward.SpellSlot, Cursor);
                            WW        = false;
                            Ward_Time = TickCount(2000);
                        }
                        WardObj = ObjectManager.Get <Obj_AI_Base>()  // 커서근처 와드 유무
                                  .OrderBy(obj => obj.LSDistance(Cursor))
                                  .FirstOrDefault(obj => obj.IsAlly && !obj.IsMe &&
                                                  obj.LSDistance(Cursor) <= 110 && obj.Name.ToLower().Contains("ward"));
                        if (WardObj != null && WTime < Environment.TickCount)
                        {
                            _W.Cast(WardObj, true);
                            Ward_Time = TickCount(2000);
                            WW        = true;
                            WTime     = TickCount(2000);
                            return;
                        }
                    }
                }
            }
            catch (Exception)
            {
                if (NowTime() > ErrorTime)
                {
                    //Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 06");
                    ErrorTime = TickCount(10000);
                }
            }
        }
示例#54
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 && target.LSDistance(ObjectManager.Player) <= _r.Range - 50)
                            {
                                _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);
                                }
                            }
                        }
                    }
                }
            }
        }
示例#55
0
        private void CastR(Spell R , Obj_AI_Hero t)
        {
            Program.CastSpell(R, t);
            if (Config.Item("minionR").GetValue<bool>())
            {
                // collision + predictio R
                var poutput = R.GetPrediction(t);
                var col = poutput.CollisionObjects.Count(ColObj => ColObj.IsEnemy && ColObj.IsMinion && !ColObj.IsDead);

                //hitchance
                var prepos = Prediction.GetPrediction(t, 0.4f);

                if (col == 0 && (int)prepos.Hitchance < 5)
                    return;

                float rSplash = 140;
                if (bonusR)
                    rSplash = 290f;

                var minions = MinionManager.GetMinions(Player.ServerPosition, R.Range - rSplash, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.MaxHealth);
                foreach (var minion in minions.Where(minion => minion.Distance(poutput.CastPosition) < rSplash))
                {
                    R.Cast(minion);
                    return;
                }
            }
        }
示例#56
0
 public static List<Obj_AI_Base> CheckingCollision(Obj_AI_Base from, Obj_AI_Base target, Spell Skill)
 {
     var ListCol = new List<Obj_AI_Base>();
     foreach (var Col in ObjectManager.Get<Obj_AI_Base>().Where(i => i.IsValidTarget(Skill.Range) && !(i is Obj_AI_Turret) && Skill.GetPrediction(i).Hitchance >= HitChance.Medium && i != target))
     {
         var Segment = Col.Position.To2D().ProjectOn(from.Position.To2D(), (from.Position + Vector3.Normalize(target.Position - from.Position) * Skill.Range).To2D());
         if (Segment.IsOnSegment && Col.Position.Distance(new Vector3(Segment.SegmentPoint.X, Col.Position.Y, Segment.SegmentPoint.Y)) <= Col.BoundingRadius + Skill.Width) ListCol.Add(Col);
     }
     return ListCol.Distinct().ToList();
 }
示例#57
0
        private static void Combo()
        {
            var target = TargetSelector.GetTarget(1000, DamageType.Magical);

            if (getCheckBoxItem(comboMenu, "usee") && !VorpalSpikes && E.GetHitCount() > 0 &&
                (Environment.Turret.countTurretsInRange(player) < 1 || target.Health < 150))
            {
                E.Cast();
            }

            if (target == null)
            {
                return;
            }

            if (getCheckBoxItem(comboMenu, "selected"))
            {
                target = CombatHelper.SetTarget(target, TargetSelector.SelectedTarget);
            }

            var combodmg = ComboDamage(target);

            var hasFlash  = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerFlash")) == SpellState.Ready;
            var hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;
            var ignitedmg = (float)player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);

            if (hasIgnite && ignitedmg > target.Health && !R.CanCast(target) && !W.CanCast(target) && !Q.CanCast(target))
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }

            if (hasIgnite && combodmg > target.Health && R.CanCast(target) &&
                (float)player.LSGetSpellDamage(target, SpellSlot.R) < target.Health)
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
            }

            flashRblock = hasIgnite;

            if (getCheckBoxItem(comboMenu, "useq") && Q.IsReady())
            {
                var qHit = getSliderItem(comboMenu, "qHit");
                var hitC = HitChance.VeryHigh;
                switch (qHit)
                {
                case 1:
                    hitC = HitChance.Low;
                    break;

                case 2:
                    hitC = HitChance.Medium;
                    break;

                case 3:
                    hitC = HitChance.High;
                    break;

                case 4:
                    hitC = HitChance.VeryHigh;
                    break;
                }
                var pred = Q.GetPrediction(target);
                if (pred.Hitchance >= hitC)
                {
                    Q.Cast(pred.CastPosition);
                }
                else
                {
                    Q.CastIfHitchanceEquals(target, hitC);
                }
            }

            if (getCheckBoxItem(comboMenu, "usew") && W.CanCast(target))
            {
                W.Cast(target, getCheckBoxItem(config, "packets"));
            }

            if (getCheckBoxItem(comboMenu, "UseFlashC") && !flashRblock && R.IsReady() && hasFlash &&
                !CombatHelper.CheckCriticalBuffs(target) && player.GetSpell(SpellSlot.R).SData.Mana <= player.Mana &&
                player.LSDistance(target.Position) >= 400 && player.LSGetSpellDamage(target, SpellSlot.R) > target.Health &&
                !Q.IsReady() && !W.IsReady() && player.LSDistance(target.Position) <= RFlash.Range &&
                !player.Position.LSExtend(target.Position, 400).IsWall())
            {
                player.Spellbook.CastSpell(player.GetSpellSlot("SummonerFlash"), player.Position.LSExtend(target.Position, 400));
                Utility.DelayAction.Add(50, () => R.Cast(target, getCheckBoxItem(config, "packets")));
            }

            var rtarget = HeroManager.Enemies.Where(e => e.LSIsValidTarget() && R.CanCast(e)).OrderByDescending(TargetSelector.GetPriority).FirstOrDefault();

            if (getCheckBoxItem(comboMenu, "user") && rtarget != null && player.LSGetSpellDamage(target, SpellSlot.R) > rtarget.Health)
            {
                R.Cast(rtarget, getCheckBoxItem(config, "packets"));
            }
        }
示例#58
0
        public static Obj_AI_Hero GetTargetNoCollision(Spell spell,
            bool ignoreShield = true,
            IEnumerable<Obj_AI_Hero> ignoredChamps = null,
            Vector3? rangeCheckFrom = null)
        {
            var t = GetTarget(ObjectManager.Player, spell.Range,
                spell.DamageType, ignoreShield, ignoredChamps, rangeCheckFrom);

            if (spell.Collision && spell.GetPrediction(t).Hitchance != HitChance.Collision)
            {
                return t;
            }

            return null;
        }
示例#59
0
        private static void CastSpell(Spell QWER, Obj_AI_Hero target, int HitChanceNum)
        {
            //HitChance 0 - 2
            // example CastSpell(Q, ts, 2);
            if (HitChanceNum == 0)
                QWER.Cast(target, true);
            else if (HitChanceNum == 1)
                QWER.CastIfHitchanceEquals(target, HitChance.VeryHigh, true);
            else if (HitChanceNum == 2)
            {
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);
                if (target.Path.Count() < 2)
                    QWER.CastIfHitchanceEquals(target, HitChance.VeryHigh, true);
            }
            else if (HitChanceNum == 3)
            {
                List<Vector2> waypoints = target.GetWaypoints();
                //debug("" + target.Path.Count() + " " + (target.Position == target.ServerPosition) + (waypoints.Last<Vector2>().To3D() == target.ServerPosition));
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);

                float SiteToSite = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed)) * 6 - QWER.Width;
                float BackToFront = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed));
                if (ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) < SiteToSite || ObjectManager.Player.Distance(target.Position) < SiteToSite)
                    QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                else if (target.Path.Count() < 2
                    && (target.ServerPosition.Distance(waypoints.Last<Vector2>().To3D()) > SiteToSite
                    || Math.Abs(ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) - ObjectManager.Player.Distance(target.Position)) > BackToFront
                    || target.HasBuffOfType(BuffType.Slow) || target.HasBuff("Recall")
                    || (target.Path.Count() == 0 && target.Position == target.ServerPosition)
                    ))
                {
                    if (target.IsFacing(ObjectManager.Player) || target.Path.Count() == 0)
                    {
                        if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed)))
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
            else if (HitChanceNum == 4 && (int)QWER.GetPrediction(target).Hitchance > 4)
            {
                List<Vector2> waypoints = target.GetWaypoints();
                //debug("" + target.Path.Count() + " " + (target.Position == target.ServerPosition) + (waypoints.Last<Vector2>().To3D() == target.ServerPosition));
                if (QWER.Delay < 0.3)
                    QWER.CastIfHitchanceEquals(target, HitChance.Dashing, true);
                QWER.CastIfHitchanceEquals(target, HitChance.Immobile, true);
                QWER.CastIfWillHit(target, 2, true);

                float SiteToSite = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed)) * 6 - QWER.Width;
                float BackToFront = ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.ServerPosition) / QWER.Speed));
                if (ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) < SiteToSite || ObjectManager.Player.Distance(target.Position) < SiteToSite)
                    QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                else if (target.Path.Count() < 2
                    && (target.ServerPosition.Distance(waypoints.Last<Vector2>().To3D()) > SiteToSite
                    || Math.Abs(ObjectManager.Player.Distance(waypoints.Last<Vector2>().To3D()) - ObjectManager.Player.Distance(target.Position)) > BackToFront
                    || target.HasBuffOfType(BuffType.Slow) || target.HasBuff("Recall")
                    || (target.Path.Count() == 0 && target.Position == target.ServerPosition)
                    ))
                {
                    if (target.IsFacing(ObjectManager.Player) || target.Path.Count() == 0)
                    {
                        if (ObjectManager.Player.Distance(target.Position) < QWER.Range - ((target.MoveSpeed * QWER.Delay) + (Player.Distance(target.Position) / QWER.Speed)))
                            QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                    else
                    {
                        QWER.CastIfHitchanceEquals(target, HitChance.High, true);
                    }
                }
            }
        }
示例#60
0
 public Obj_AI_Hero Cast_BasicSkillshot_Enemy(Spell spell, SimpleTs.DamageType prio = SimpleTs.DamageType.True, float extrarange = 0)
 {
     if(!spell.IsReady())
         return null;
     var target = SimpleTs.GetTarget(spell.Range + extrarange, prio);
     if(target == null)
         return null;
     if(!target.IsValidTarget(spell.Range + extrarange) || spell.GetPrediction(target).Hitchance < HitChance.Medium)
         return null;
     spell.UpdateSourcePosition();
     spell.Cast(target, UsePackets());
     return target;
 }