Beispiel #1
0
 public static void Interrupter_OnInterruptableSpell(Obj_AI_Base unit, Interrupter.InterruptableSpellEventArgs spell)
 {
     float getDist = EloBuddy.SDK.Extensions.Distance(_Player, unit) / 2.0f; // formula of swag
     if (Program.MiscMenu["interrupt"].Cast<CheckBox>().CurrentValue && Program.W.IsReady() && Program.Q.IsReady() && unit.IsValidTarget(Program.W.Range))
     {
         if (unit.IsValidTarget(220))
         {
             Program.W.Cast(unit);
             Program.Q.Cast();
         }
         else
         {
             Program.W.Cast(unit);
             EloBuddy.SDK.Core.DelayAction(() => { Program.Q.Cast(); }, (int)getDist);
         }
     }
     if (Program.MiscMenu["interrupt"].Cast<CheckBox>().CurrentValue && Program.Q.IsReady())
     {
         if (unit.Distance(_Player.ServerPosition, true) <= Program.Q.Range)
         {
             Program.Q.Cast(unit);
         }
     }
     if (Program.MiscMenu["interrupt"].Cast<CheckBox>().CurrentValue && Program.W.IsReady())
     {
         if (unit.Distance(_Player.ServerPosition, true) <= Program.W.Range)
         {
             Program.W.Cast(unit);
         }
     }
 }
Beispiel #2
0
        public static void doCombo(Obj_AI_Base target)
        {
            if (target == null || !target.IsValidTarget())
                return;

            if (target.Distance(Player) < 500)
            {
                sumItems.cast(SummonerItems.ItemIds.Ghostblade);
            }
            if (target.Distance(Player) < 500 && (Player.Health / Player.MaxHealth) * 100 < 85)
            {
                sumItems.cast(SummonerItems.ItemIds.BotRK, target);

            }
            if (isStealthed() && targIsKillabe(target) && enemiesNear() > 2)
            {
                Orbwalking.Attack = false;
            }
            else
            {
                useHydra(target);
                doQ(target);
                Orbwalking.Attack = true;
                doSmartW(target);
                if (target.Health < fullComboDmgOn(target) * 1.3f || isStealthed())
                    doSmartE(target, true);
                else
                    reachWithE(target);
            }
            doSmartR(target);
        }
Beispiel #3
0
 public static float GetGapcloseDamage(this Obj_AI_Base target, Obj_AI_Base gapclose)
 {
     var q = SpellManager.Q.IsReady() && gapclose.Distance(target) < SpellManager.Q.Range &&
             SpellManager.Q.IsActive(true);
     var w = SpellManager.W.IsReady() && gapclose.Distance(target) < SpellManager.W.Range &&
             SpellManager.W.IsActive(true);
     var r = IsRReady() && gapclose.Distance(target) < SpellManager.R.Range && SpellManager.R.IsActive(true);
     return GetComboDamage(target, q, w, false, r, true);
 }
Beispiel #4
0
        public static void CastR(Obj_AI_Base target)
        {
            if (R.IsReady())
            {
                if (Rstate == 1)
                {
                    if (target.IsValidTarget(R.Range))
                    {
                        R.Cast(target);
                    }
                }
                if (Rstate == 2)
                {
                    var t = Prediction.GetPrediction(target, 400).CastPosition;
                    float x = target.MoveSpeed;
                    float y = x * 400 / 1000;
                    var pos = target.Position;
                    if (target.Distance(t) <= y)
                    {
                        pos = t;
                    }
                    if (target.Distance(t) > y)
                    {
                        pos = target.Position.Extend(t, y - 50);
                    }
                    if (Player.Distance(pos) <= 600)
                    {
                        R.Cast(pos);
                    }
                    if (Player.Distance(pos) > 600)
                    {
                        if (target.Distance(t) > y)
                        {
                            var pos2 = target.Position.Extend(t, y);
                            if (Player.Distance(pos2) <= 600)
                            {
                                R.Cast(pos2);
                            }
                            else
                            {
                                var prediction = R.GetPrediction(target);
                                if (prediction.Hitchance >= HitChance.High)
                                {
                                    var pos3 = prediction.CastPosition;
                                    var pos4 = Player.Position.Extend(pos3, 600);
                                    R.Cast(pos4);
                                }
                            }
                        }

                    }
                }
            }
        }
Beispiel #5
0
        public static bool IsFleeing(this Obj_AI_Hero hero, Obj_AI_Base target)
        {
            if (hero == null || target == null)
            {
                return false;
            }

            if (hero.Path.Count()>0 && target.Distance(hero.Position) < target.Distance(hero.Path.Last()))
            {
                return true;
            }
            return false;
        }
Beispiel #6
0
        // Human W Logic
        internal static void CastBushwhack(Obj_AI_Base target,  string mode)
        {
            // if not harass mode ignore mana check
            if (!KL.CatForm() && KL.CanUse(KL.Spells["Bushwhack"], true, mode))
            {
                if (!target.IsValidTarget(KL.Spells["Bushwhack"].Range))
                    return;

                if (KL.Player.ManaPercent <= 75 && target.IsHunted())
                    return;

                if (mode == "ha" && KL.Player.ManaPercent < 65)
                    return;

                // try bushwhack prediction
                if (KN.Root.Item("ndhwforce").GetValue<StringList>().SelectedIndex == 0)
                {
                    if (target.IsChampion())
                        KL.Spells["Bushwhack"].CastIfHitchanceEquals(target, HitChance.VeryHigh);
                    else
                    {
                        if ((KL.CanUse(KL.Spells["Javelin"], true, "jg") ||
                             KL.SpellTimer["Javelin"] > 4f) && target.Distance(KL.Player.ServerPosition) > 165f)
                             KL.Spells["Bushwhack"].Cast(target.Position.Extend(KL.Player.ServerPosition, 305f));
                        else
                            KL.Spells["Bushwhack"].Cast(target.Position.Extend(KL.Player.ServerPosition, 100f));
                    }
                }

                // try bushwhack behind target
                if (KN.Root.Item("ndhwforce").GetValue<StringList>().SelectedIndex == 1)
                {
                    if (target.IsChampion())
                    {
                        var unitpos = KL.Spells["Bushwhack"].GetPrediction(target).UnitPosition;
                        KL.Spells["Bushwhack"].Cast(unitpos.Extend(KL.Player.ServerPosition, -75f));
                    }
                    else
                    {
                        if ((KL.CanUse(KL.Spells["Javelin"], true, "jg") ||
                             KL.SpellTimer["Javelin"] > 4f) && target.Distance(KL.Player.ServerPosition) > 265f)
                             KL.Spells["Bushwhack"].Cast(target.Position.Extend(KL.Player.ServerPosition, +305f));
                        else
                            KL.Spells["Bushwhack"].Cast(target.Position.Extend(KL.Player.ServerPosition, 100f));
                    }
                }
            }
        }
Beispiel #7
0
 internal static void L33TSmite(Obj_AI_Base unit, float smitedmg)
 {
     foreach (var hero in Smitdata.SpellList.Where(x => x.Name == Activator.Player.ChampionName))
     {
         if (Activator.Player.GetSpellDamage(unit, hero.Slot, hero.Stage) + smitedmg >= unit.Health)
         {
             if (unit.Distance(Activator.Player.ServerPosition) <= hero.CastRange + 
                 unit.BoundingRadius + Activator.Player.BoundingRadius)
             {
                 if (hero.HeroReqs(unit))
                 {
                     switch (hero.Type)
                     {
                         case SpellDataTargetType.Location:
                             Activator.Player.Spellbook.CastSpell(hero.Slot, unit.ServerPosition);
                             break;
                         case SpellDataTargetType.Unit:
                             Activator.Player.Spellbook.CastSpell(hero.Slot, unit);
                             break;
                         case SpellDataTargetType.Self:
                             Activator.Player.Spellbook.CastSpell(hero.Slot);
                             break;
                     }
                 }
             }
         }
     }
 }
Beispiel #8
0
        public static void doCombo(Obj_AI_Base target)
        {
            if (target == null)
                return;
            if (target.Distance(Player) < 500)
            {
                sumItems.cast(SummonerItems.ItemIds.Ghostblade);
            }
            if (target.Distance(Player) < 500 && (Player.Health/Player.MaxHealth)*100<85)
            {
                sumItems.cast(SummonerItems.ItemIds.BotRK, target);

            }

            igniteIfKIllable(target);
            rushDownQ =  RivenSharp.Config.Item("rush").GetValue<bool>() && rushDmgBasedOnDist(target) * 0.7f > target.Health;
            rushDown = rushDmgBasedOnDist(target)*1.1f > target.Health;
            if (RivenSharp.Config.Item("useR").GetValue<bool>())
                useRSmart(target);
            if (rushDown)
                sumItems.castIgnite((Obj_AI_Hero)target);
            useESmart(target);
            useWSmart(target);
            useHydra(target);
            gapWithQ(target);
        }
Beispiel #9
0
        public static float GetHealthPrediction(Obj_AI_Base unit, int time, int delay = 70)
        {
            var predictedDamage = 0f;

            foreach (var attack in ActiveAttacks.Values)
            {
                var attackDamage = 0f;
                if (!attack.Processed && attack.Source.IsValidTarget(float.MaxValue) &&
                    attack.Target.IsValidTarget(float.MaxValue) && attack.Target.NetworkId == unit.NetworkId)
                {
                    var landTime = attack.StartTick + attack.Delay +
                                   1000*Math.Max(0, unit.Distance(attack.Source) - attack.Source.BoundingRadius)/
                                   attack.ProjectileSpeed + delay;

                    if ( /*Utils.GameTimeTickCount < landTime - delay &&*/ landTime < Utils.GameTimeTickCount + time)
                    {
                        attackDamage = attack.Damage;
                    }
                }

                predictedDamage += attackDamage;
            }

            return unit.Health - predictedDamage;
        }
Beispiel #10
0
 public static void castQ(Obj_AI_Base target, bool useR, double predictionHitChance)
 {
     if (Q.IsReady() && target.IsValidTarget(Q.Range))
     {
         var pred = Q.GetPrediction(target);
         //No collisions we cast it directly
         if (pred.HitChancePercent >= predictionHitChance && !pred.Collision)
         {
             if (useR)
                 castR();
             Q.Cast(pred.CastPosition);
         }
         //Collisions : Damn we need to use something called the brain ...
         else
         {
             var collision = new Obj_AI_Base();
             if (pred.CollisionObjects.Length != 0)
             {
                 collision = pred.CollisionObjects[0];
                 if (collision.IsValidTarget() && target.Distance(collision.Position) < Q.Width)
                 {
                     if (useR)
                         castR();
                     Q.Cast(pred.CastPosition);
                     return;
                 }
             }
         }
     }
 }
        public static void OnProcessSpellcast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            #region Anti-Stealth
            if (args.SData.Name.ToLower().Contains("talonshadow")) //#TODO get the actual buff name
            {
                if (Items.HasItem((int)ItemId.Oracles_Lens_Trinket) && Items.CanUseItem((int)ItemId.Oracles_Lens_Trinket))
                {
                    Items.UseItem((int)ItemId.Oracles_Lens_Trinket, Heroes.Player.Position);
                }
                else if (Items.HasItem((int)ItemId.Vision_Ward, Heroes.Player))
                {
                    Items.UseItem((int)ItemId.Vision_Ward, Heroes.Player.Position.Randomize(0, 125));
                }
            }
            #endregion

            if (MyWizard.ShouldSaveCondemn()) return;
            if (sender.Distance(Heroes.Player) > 1500 || !args.Target.IsMe || args.SData == null)
                return;
            //how to milk alistar/thresh/everytoplaner
            var spellData = SpellDb.GetByName(args.SData.Name);
            if (spellData != null && !Heroes.Player.UnderTurret(true) && !Lists.UselessChamps.Contains(sender.CharData.BaseSkinName))
            {
                if (spellData.CcType == CcType.Knockup || spellData.CcType == CcType.Stun ||
                    spellData.CcType == CcType.Knockback || spellData.CcType == CcType.Suppression)
                {
                    Program.E.Cast(sender);
                }
            }
        }
Beispiel #12
0
 public static Obj_AI_Base GetClosestETarget(Obj_AI_Base unit)
 {
     return
         GetETargets(unit.ServerPosition)
             .Where(o => o.NetworkId != unit.NetworkId && unit.Distance(o) < SpellManager.Q.Range)
             .MinOrDefault(o => o.Distance(unit));
 }
Beispiel #13
0
        //-------------------------------------Obj_AI_Base_OnProcessSpellCast--------------------------------------
        static void AIHeroClient_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (DodgeSpells.Any(el => el == args.SData.Name) && Menu[args.SData.Name].Cast<CheckBox>().CurrentValue)
            {
                if (args.SData.Name == "KatarinaR")
                {
                    if (Q.IsReady() && Q.IsInRange(sender)) Q.Cast();
                    else if (W.IsReady() && W.IsInRange(sender)) W.Cast(sender);
                    return;
                }

                if (args.SData.Name == "AbsoluteZero")
                {
                    if (Q.IsReady() && Q.IsInRange(sender)) Q.Cast();
                    else if (W.IsReady() && W.IsInRange(sender)) W.Cast(sender);
                    return;
                }

                if (args.SData.Name == "EzrealtrueShotBarrage")
                {
                    if (Q.IsReady() && Q.IsInRange(sender)) Q.Cast();
                    else if (W.IsReady() && W.IsInRange(sender)) W.Cast(sender);
                    return;
                }

                if (Q.IsReady() && Q.IsInRange(sender)) { Q.Cast(); return; }
                if (W.IsReady() && sender.Distance(Player) <= 300) { W.Cast(sender); return; }
            }

            return;
        }
        public static void ChargeOnTowerSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (ObjectManager.Player.IsDead || ObjectManager.Player.InFountain())
            {
                return;
            }

            if (sender.IsEnemy && sender.Type == GameObjectType.obj_AI_Turret
                && sender.Distance(ObjectManager.Player) < 2000f)
            {

                if (args.Target.IsMe)
                {
                    if (TowerIsOuter(sender))
                    {
                        if (WarmingUpStacks < 2)
                        {
                            WarmingUpStacks++;
                            //Console.WriteLine("Warming: " + WarmingUpStacks);
                        }
                        else if (HeatedUpStacks < 2)
                        {
                            HeatedUpStacks++;
                            //Console.WriteLine("Heated: " + HeatedUpStacks);
                        }
                    }
                    if (TowerIsInhib(sender))
                    {
                        if (HeatStacks < 120)
                        {
                            HeatStacks = HeatStacks + 6;
                            //Console.WriteLine("Heat: " + HeatStacks);
                        }
                    }

                }
                else if (args.Target.IsAlly && args.Target.Type == GameObjectType.obj_AI_Hero)
                {
                    ResetTowerWarming();
                }
                else
                {
                    ResetTowerStacks();
                }

            }
            //            if (!IncomingDamage.StackResetDelay)
            //            {
            //                Utility.DelayAction.ActionList.Clear();
            //                Utility.DelayAction.Add(1500, () => IncomingDamage.StackResetDelay = true);
            //            }

            //        else if (IncomingDamage.StackResetDelay)
            //        {
            //            IncomingDamage.ResetTowerStacks();
            //            IncomingDamage.StackResetDelay = false
            //        }
            //    }
            //}
        }
Beispiel #15
0
        private static void BlitzOnInterruptableSpell(Obj_AI_Base unit, InterruptableSpell spell)
        {
            if (_menu.Item("interruptq").GetValue<bool>() && _q.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _q.RangeSqr)
                {
                    var prediction = _q.GetPrediction(unit);
                    if (prediction.Hitchance >= HitChance.Low)
                    {
                        _q.Cast(prediction.CastPosition);
                    }
                }
            }

            if (_menu.Item("interruptr").GetValue<bool>() && _r.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _r.RangeSqr)
                {
                    _r.Cast();
                }
            }

            if (_menu.Item("interrupte").GetValue<bool>() && _e.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _e.RangeSqr)
                {
                    _e.CastOnUnit(Me);
                    Me.IssueOrder(GameObjectOrder.AttackUnit, unit);
                }
            }
        }
Beispiel #16
0
        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsEnemy && sender is Obj_AI_Hero && sender.Distance(Player.Position) < 800)
            {

                switch (args.SData.Name)
                {
                    case "akalismokebomb":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "deceive":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "khazixr":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "khazixrlong":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "talonshadowassault":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "monkeykingdecoy":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "RengarR":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "TwitchHideInShadows":
                        CastVisionWards(sender.ServerPosition);
                        break;
                }
            }
        }
Beispiel #17
0
 static void Interrupter_OnInterruptableSpell(Obj_AI_Base sender, Interrupter.InterruptableSpellEventArgs e)
 {
     if (Checker.AntiGapCloser && sender.IsEnemy && Spells.W.IsReady()
         && sender.Distance(Ryze.ServerPosition) < Spells.W.Range)
     {
         Spells.W.Cast(sender);
     }
 }
        public static void OnProcessSpellcast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {

                #region ward brush after E
                /*if (sender.IsMe && args.SData.Name.ToLower().Contains("condemn") && args.Target.IsValid<Obj_AI_Hero>())
                {
                    var target = (Obj_AI_Hero)args.Target;
                    if (NavMesh.IsWallOfGrass(args.End, 100))
                    {
                        var blueTrinket = ItemId.Scrying_Orb_Trinket;
                        if (Items.HasItem((int)ItemId.Farsight_Orb_Trinket, Heroes.Player) && Items.CanUseItem((int)ItemId.Farsight_Orb_Trinket)) blueTrinket = ItemId.Farsight_Orb_Trinket;

                        var yellowTrinket = ItemId.Warding_Totem_Trinket;
                        if (Items.HasItem((int)ItemId.Greater_Stealth_Totem_Trinket, Heroes.Player)) yellowTrinket = ItemId.Greater_Stealth_Totem_Trinket;

                        if (Items.CanUseItem((int)blueTrinket))
                            Items.UseItem((int)blueTrinket, args.End.Randomize(0, 100));
                        if (Items.CanUseItem((int)yellowTrinket))
                            Items.UseItem((int)yellowTrinket, args.End.Randomize(0, 100));
                    }
                }*/
                #endregion

                #region Anti-Stealth
                if (args.SData.Name.ToLower().Contains("talonshadow")) //#TODO get the actual buff name
                {
                    if (Items.HasItem((int)ItemId.Oracles_Lens_Trinket) && Items.CanUseItem((int)ItemId.Oracles_Lens_Trinket))
                    {
                        Items.UseItem((int)ItemId.Oracles_Lens_Trinket, Heroes.Player.Position);
                    }
                    else if (Items.HasItem((int)ItemId.Vision_Ward, Heroes.Player))
                    {
                        Items.UseItem((int)ItemId.Vision_Ward, Heroes.Player.Position.Randomize(0, 125));
                    }
                }
                #endregion

                if (MyWizard.ShouldSaveCondemn()) return;
                if (sender.Distance(Heroes.Player) > 1500 || !args.Target.IsMe || args.SData == null)
                    return;
                //how to milk alistar/thresh/everytoplaner
                var spellData = SpellDb.GetByName(args.SData.Name);
                if (spellData != null && !Heroes.Player.UnderTurret(true) && !Lists.UselessChamps.Contains(sender.CharData.BaseSkinName))
                {
                    if (spellData.CcType == CcType.Knockup || spellData.CcType == CcType.Stun ||
                        spellData.CcType == CcType.Knockback || spellData.CcType == CcType.Suppression)
                    {
                        Program.E.Cast(sender);
                    }
                }
            }
            catch (Exception exception)
            {
                //normal
            }
        }
Beispiel #19
0
        public static bool IsFacing(this Obj_AI_Base source, Obj_AI_Base target)
        {
            if (!source.IsValid || !target.IsValid)
                return false;

            if (source.Path.Count() > 0 && source.Path[0].Distance(target.ServerPosition) < target.Distance(source))
                return true;
            else
                return false;
        }
Beispiel #20
0
 private static void GapCloserino(Obj_AI_Base sender, Gapcloser.GapcloserEventArgs args)
 {
     if (sender.IsEnemy &&
         sender is AIHeroClient &&
         sender.Distance(Utils._Player) < Spells.E.Range &&
         Spells.E.IsReady())
     {
         Spells.E.Cast(sender);
     }
 }
Beispiel #21
0
 private static void OnGapCloser(Obj_AI_Base sender, Gapcloser.GapcloserEventArgs args)
 {
     if (sender.IsEnemy &&
         sender is AIHeroClient &&
         sender.Distance(_Player) <= Spells.E.Range &&
         Spells.E.IsReady() &&
         Utils.isChecked(MenuX.Misc, "gapCloser"))
     {
         Spells.E.Cast(sender);
     }
 }
Beispiel #22
0
        private static void OnInterruptableSpell(Obj_AI_Base sender, Interrupter.InterruptableSpellEventArgs e)
        {
            if (!sender.IsEnemy) return;

            if (Miscfig["Inter_Q"].Cast<CheckBox>().CurrentValue && Q.IsReady())
            {
                if (sender.Distance(Player.Instance.ServerPosition, true) <= Q.RangeSquared)
                    Q.Cast(sender);
            }
            if (Miscfig["Inter_E"].Cast<CheckBox>().CurrentValue && E.IsReady())
            {
                if (sender.Distance(Player.Instance.ServerPosition, true) <= E.RangeSquared)
                    E.Cast();
            }
            if (Miscfig["Inter_R"].Cast<CheckBox>().CurrentValue && R.IsReady())
            {
                if (sender.Distance(Player.Instance.ServerPosition, true) <= R.RangeSquared)
                    R.Cast();
            }
        }
        private static void BlitzOnInterruptableSpell(Obj_AI_Base unit, InterruptableSpell spell)
        {
            if (_menu.Item("interruptq").GetValue<bool>() && _q.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _q.RangeSqr)
                    _q.CastIfHitchanceEquals(unit, HitChance.Medium);
            }

            if (_menu.Item("interruptr").GetValue<bool>() && _r.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _r.RangeSqr)
                    _r.Cast();
            }

            if (_menu.Item("interrupte").GetValue<bool>() && _e.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _e.RangeSqr)
                    _e.CastOnUnit(Me);
            }
        }
Beispiel #24
0
 private static void Interrupterino(Obj_AI_Base sender, Interrupter.InterruptableSpellEventArgs args)
 {
     if (args.DangerLevel == DangerLevel.High &&
         sender.IsEnemy &&
         sender is AIHeroClient &&
         sender.Distance(Utils._Player) < Spells.Q.Range &&
         Spells.Q.IsReady())
     {
         Spells.Q.Cast(sender);
     }
 }
Beispiel #25
0
 private void Unit_OnDash(Obj_AI_Base sender, Dash.DashItem args)
 {
     if (sender.Distance(player.Position) > Q.Range || !Q.IsReady())
     {
         return;
     }
     if (orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo && config.Item("useq", true).GetValue<bool>() &&
         args.EndPos.Distance(player.Position) > Q.Range &&
         args.EndPos.Distance(player) > args.StartPos.Distance(player))
     {
         Q.CastOnUnit(sender, config.Item("packets").GetValue<bool>());
     }
 }
Beispiel #26
0
 static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (!sender.IsMe)
         return;
     if (args.SData.Name.ToLower().Contains("summonerflash"))
     {
         var target = TargetSelector.GetTarget(400, TargetSelector.DamageType.Physical);
         if (target == null)
             return;
         var pos = target.Position.Extend(sender.Position, sender.Distance(target) + 200);
         Spells[SpellSlot.E].Cast(pos);
     }
 }
Beispiel #27
0
 public void Reset(Obj_AI_Base myTower, Obj_AI_Base enemyTower, Lane ln)
 {
     Vector3 pingPos = AutoWalker.p.Distance(AutoWalker.MyNexus) - 100 > myTower.Distance(AutoWalker.MyNexus)
         ? enemyTower.Position
         : myTower.Position;
     Core.DelayAction(() => SafeFunctions.Ping(PingCategory.OnMyWay, pingPos.Randomized()), RandGen.r.Next(3000));
     lane = ln;
     currentWave = new Obj_AI_Minion[0];
     myTurret = myTower;
     enemyTurret = enemyTower;
     randomExtend = 0;
     currentLogic.SetLogic(LogicSelector.MainLogics.PushLogic);
 }
Beispiel #28
0
        public static float RDamage(Obj_AI_Base target)
        {
            if (!_r.IsReady()) return 0f;

            var distance = target.Distance(Player.Instance);
            var percentage = 0.1f + (distance < 100f ? 0f : distance/100*0.06f);
            var dmgPercentage = percentage > 1f ? 1f : percentage;

            return Player.Instance.CalculateDamageOnUnit(target, DamageType.Physical,
                new float[] {250, 350, 450}[_r.Level - 1]*dmgPercentage +
                new float[] {25, 30, 35}[_r.Level - 1]/100*(target.MaxHealth - target.Health) +
                dmgPercentage*Player.Instance.FlatPhysicalDamageMod);
        }
Beispiel #29
0
        internal static bool CanQ(Obj_AI_Base unit)
        {
            if (!unit.IsValidTarget() || unit.IsZombie ||
                TargetSelector.IsInvulnerable(unit, TargetSelector.DamageType.Physical))
            {
                return false;
            }

            if (KL.Player.Distance(unit.ServerPosition) < 175 ||
                Utils.GameTimeTickCount - LastGrabTimeStamp < 350)
            {
                return false;
            }

            if (KL.Spellbook["R"].IsReady() &&
                KL.Player.Mana - KL.Spellbook["Q"].ManaCost < KL.Spellbook["R"].ManaCost)
            {
                return false;
            }

            if (KL.Spellbook["W"].IsReady() && KL.WDmg(unit) >= unit.Health &&
                unit.Distance(KL.Player.ServerPosition) <= 200)
            {
                return false;
            }

            if (KL.Spellbook["W"].IsReady() && KL.Player.HasBuff("DariusNoxonTactictsONH") &&
                unit.Distance(KL.Player.ServerPosition) <= 225)
            {
                return false;
            }

            if (KL.Player.Distance(unit.ServerPosition) > KL.Spellbook["Q"].Range)
            {
                return false;
            }

            if (KL.Spellbook["R"].IsReady() && KL.Spellbook["R"].IsInRange(unit) &&
                KL.RDmg(unit, PassiveCount(unit)) - KL.Hemorrhage(unit, 1) >= unit.Health)
            {
                return false;
            }

            if (KL.Player.GetAutoAttackDamage(unit) * 2 + KL.Hemorrhage(unit, PassiveCount(unit)) >= unit.Health &&
                KL.Player.Distance(unit.ServerPosition) <= 180)
            {
                return false;
            }

            return true;
        }
Beispiel #30
0
 public static void Botrk(Obj_AI_Base unit)
 {
     if (Variables.AfterAttack && (unit.Distance(ObjectManager.Player) > 500f || (ObjectManager.Player.Health / ObjectManager.Player.MaxHealth) * 100 <= 95))
     {
         if (Item.HasItem(3144) && Item.CanUseItem(3144))
         {
             Item.UseItem(3144, unit);
         }
         if (Item.HasItem(3153) && Item.CanUseItem(3153))
         {
             Item.UseItem(3153, unit);
         }
     }
 }
Beispiel #31
0
        /// <summary>
        /// Returns the unit health after a set time milliseconds.
        /// </summary>
        /// <param name="unit">The unit.</param>
        /// <param name="time">The time.</param>
        /// <param name="delay">The delay.</param>
        /// <returns></returns>
        public static float GetHealthPrediction(Obj_AI_Base unit, int time, int delay = 70)
        {
            var predictedDamage = 0f;

            foreach (var attack in ActiveAttacks.Values)
            {
                var attackDamage = 0f;
                if (!attack.Processed && attack.Source.IsValidTarget(float.MaxValue, false) &&
                    attack.Target.IsValidTarget(float.MaxValue, false) && attack.Target.NetworkId == unit.NetworkId)
                {
                    var landTime = attack.StartTick + attack.Delay +
                                   1000 * Math.Max(0, unit.Distance(attack.Source) - attack.Source.BoundingRadius) / attack.ProjectileSpeed + delay;

                    if (/*Utils.GameTimeTickCount < landTime - delay &&*/ landTime < Utils.GameTimeTickCount + time)
                    {
                        attackDamage = attack.Damage;
                    }
                }

                predictedDamage += attackDamage;
            }

            return(unit.Health - predictedDamage);
        }
        /// <summary>
        /// Fired when the game processes a spell cast.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="GameObjectProcessSpellCastEventArgs"/> instance containing the event data.</param>
        private static void ObjAiBaseOnOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsValid || sender.Distance(ObjectManager.Player) > 3000 ||
                sender.Team != ObjectManager.Player.Team || sender is AIHeroClient ||
                args.SData.IsAutoAttack() || !(args.Target is Obj_AI_Base))
            {
                return;
            }

            var target = (Obj_AI_Base)args.Target;

            ActiveAttacks.Remove(sender.NetworkId);

            var attackData = new PredictedDamage(
                sender,
                target,
                Environment.TickCount - Game.Ping / 2,
                sender.AttackCastDelay * 1000,
                sender.AttackDelay * 1000 - (sender is Obj_AI_Turret ? 70 : 0),
                sender.IsMelee ? int.MaxValue : (int)args.SData.MissileSpeed,
                (float)sender.GetAutoAttackDamage(target, true));

            ActiveAttacks.Add(sender.NetworkId, attackData);
        }
Beispiel #33
0
        private void OnProcessSpellCast(Obj_AI_Base caster, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                if (caster.IsEnemy &&
                    (args.Target.IsMe ||
                     (args.End != null && args.End.Distance(ObjectManager.Player.ServerPosition) < 200)))
                {
                    if (caster is AIHeroClient && caster.Distance(ObjectManager.Player) < 900)
                    {
                        var enemy = caster as AIHeroClient;
                        if (Damage.GetSpellDamage(enemy, ObjectManager.Player, args.Slot) / ObjectManager.Player.Health *
                            100 >
                            Spell2Menu.UseWOnDangerousSpell)
                        {
                            W.Cast();
                        }
                    }

                    /*if (caster is Obj_AI_Turret && Spell2Menu.UseWOnTowerShots)
                     * {
                     *  DelayAction.Add(350, () =>
                     *  {
                     *      if (!ObjectManager.Player.IsUnderEnemyTurret())
                     *      {
                     *          Chat.Print(caster.Name + args.Slot);
                     *          W.Cast();
                     *      }
                     *  });
                     * }*/
                }
            }
            catch (NullReferenceException ex)
            {
            }
        }
Beispiel #34
0
        public void doCombo(Obj_AI_Base target)
        {
            if (target == null)
            {
                return;
            }

            RushDownQ = RushDmgBasedOnDist(target) * 0.7f > target.Health;
            RushDown  = RushDmgBasedOnDist(target) * 1.1f > target.Health;
            if (RushDown || player.CountEnemyHeroesInRangeWithPrediction(600) > 2)
            {
                UseRSmart(target);
            }
            if (RushDown || safeGap(target))
            {
                UseESmart(target);
            }
            useWSmart(target);

            if (Orbwalker.CanMove && (target.Distance(player) < 700 || RushDown))
            {
                gapWithQ(target);
            }
        }
Beispiel #35
0
        private void checkCastedQ(Obj_AI_Base target)
        {
            if (justQ && target.Distance(player) > Q.Range)
            {
                return;
            }
            var poly        = GetPoly(lastQPos);
            var heroes      = HeroManager.Enemies.Where(e => poly.IsInside(e.Position));
            var objAiHeroes = heroes as IList <Obj_AI_Hero> ?? heroes.ToList();

            if (objAiHeroes.Any())
            {
                var escaping =
                    objAiHeroes.Count(h => poly.IsOutside(Prediction.GetPrediction(h, 0.2f).UnitPosition.To2D()));
                var data = Program.IncDamages.GetAllyData(player.NetworkId);
                if ((escaping > 0 &&
                     (objAiHeroes.Count() == 1 ||
                      (objAiHeroes.Count() >= 2 && System.Environment.TickCount - qStart > 1000))) ||
                    data.DamageTaken > player.Health)
                {
                    Q.Cast(target.Position, true);
                }
            }
        }
Beispiel #36
0
        static bool CanHitSkillShot(Obj_AI_Base target, GameObjectProcessSpellCastEventArgs args)
        {
            if (args.Target == null && target.IsValidTarget(float.MaxValue))
            {
                int Collide = 0;
                if (args.SData.LineMissileEndsAtTargetPoint)
                {
                    Collide = 0;
                }
                else
                {
                    Collide = 1;
                }
                var pred = Prediction.Position.PredictLinearMissile(target, args.SData.CastRange, (int)args.SData.CastRadius, (int)args.SData.CastTime, args.SData.MissileSpeed, Collide).CastPosition;
                if (pred == null)
                {
                    return(false);
                }

                if (args.SData.LineWidth > 0)
                {
                    var powCalc = Math.Pow(args.SData.LineWidth + target.BoundingRadius, 2);
                    if (pred.To2D().Distance(args.End.To2D(), args.Start.To2D(), true, true) <= powCalc ||
                        target.ServerPosition.To2D().Distance(args.End.To2D(), args.Start.To2D(), true, true) <= powCalc)
                    {
                        return(true);
                    }
                }
                else if (target.Distance(args.End) < 50 + target.BoundingRadius ||
                         pred.Distance(args.End) < 50 + target.BoundingRadius)
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #37
0
        private void dragonStealerino()
        {
            var         originalPosition = new Vector2(8567, 4231);
            var         stealPosition    = new Vector2(8949, 4207);
            SpellSlot   smite            = player.GetSpellSlot("SummonerSmite");
            Obj_AI_Base minion           =
                MinionManager.GetMinions(player.Position, 1500, MinionTypes.All, MinionTeam.NotAlly).FirstOrDefault(
                    i =>
                    i.Name == "Worm12.1.1" || i.Name == "Dragon6.1.1" || i.Name == "SRU_Dragon" ||
                    i.Name == "SRU_Baron");

            if (E.IsReady() && player.Distance(originalPosition) > 10 && jumpStage == FizzJump.PLAYFUL)
            {
                sendMovementPacket(originalPosition);
            }

            if (E.IsReady() && player.Distance(originalPosition) < 10 && jumpStage == FizzJump.PLAYFUL)
            {
                E.Cast(stealPosition, true);
            }

            if (E2.IsReady() && player.Distance(stealPosition) < 10 && jumpStage == FizzJump.TRICKSTER &&
                player.SummonerSpellbook.CanUseSpell(smite) == SpellState.Cooldown)
            {
                E2.Cast(originalPosition, true);
            }

            if (minion != null && minion.Distance(player) <= 625)
            {
                if (smite != SpellSlot.Unknown && player.SummonerSpellbook.CanUseSpell(smite) == SpellState.Ready &&
                    player.GetSummonerSpellDamage(minion, Damage.SummonerSpell.Smite) >= minion.Health)
                {
                    player.SummonerSpellbook.CastSpell(smite, minion);
                }
            }
        }
Beispiel #38
0
            /// <summary>
            ///     Execute Last Hit On Unkillable Minion
            /// </summary>
            /// <param name="target">The Target</param>
            /// <param name="args">The Args</param>
            public static void ExecuteUnkillableLastHit(Obj_AI_Base target, Orbwalker.UnkillableMinionArgs args)
            {
                try
                {
                    if (!Config.LastHit.GetBool("Enabled"))
                    {
                        return;
                    }

                    if (target == null)
                    {
                        return;
                    }

                    foreach (var Spell in SpellList)
                    {
                        if (!Spell.IsReady())
                        {
                            continue;
                        }

                        if (Spell.Slot.Equals(SpellSlot.Q) && Config.LastHit.GetBool("Q.Use") && Extensions.Player.EnoughMana(Config.LastHit.GetSlider("Q.Mana")))
                        {
                            if (target.Distance(Extensions.Player.ServerPosition) <= Q.Range && target.TotalShieldHealth() < Q.GetCustomSpellDamage(target))
                            {
                                Q.CastMinimumHitchance(target, HitChance.High);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Logging.AddEntry(LoggingEntryType.Error, "@Modes.cs: LastHit -> Can't execute unkillable last hit - {0}", e);
                    throw;
                }
            }
Beispiel #39
0
        /// <summary>
        ///     Calculates the default prediction of the unit.
        /// </summary>
        /// <param name="unit">
        ///     The unit
        /// </param>
        /// <param name="time">
        ///     The time
        /// </param>
        /// <param name="delay">
        ///     The delay
        /// </param>
        /// <returns>
        ///     The <see cref="float" />
        /// </returns>
        private static float GetPredictionDefault(Obj_AI_Base unit, int time, int delay = 70)
        {
            var predictedDamage = 0f;

            foreach (var attack in ActiveAttacks.Values)
            {
                var attackDamage = 0f;
                if (attack.Source.IsValidTarget(float.MaxValue, false) &&
                    attack.Target.IsValidTarget(float.MaxValue, false) && attack.Target.NetworkId == unit.NetworkId)
                {
                    var landTime = attack.StartTick + attack.Delay
                                   + (1000 * unit.Distance(attack.Source) / attack.ProjectileSpeed) + delay;

                    if (Variables.TickCount < landTime - delay && landTime < Variables.TickCount + time)
                    {
                        attackDamage = attack.Damage;
                    }
                }

                predictedDamage += attackDamage;
            }

            return(unit.Health - predictedDamage);
        }
Beispiel #40
0
        public static Vector3 GetPassivePosition(this Obj_AI_Base target)
        {
            // Console.WriteLine("SEARCH PASSIVE " + target.Name);
            var passive = target.GetNearestPassive();

            if (passive == null || target.Distance(passive.Position) == 0)
            {
                return(Vector3.Zero);
            }

            var pos = Prediction.GetPrediction(target, Program.Q.Delay).UnitPosition.To2D();
            var d   = passive.PassiveDistance;

            //var d = target.Distance(passive.Position) + 50;
            if (passive.Name.Contains("NE"))
            {
                pos.Y += d;
            }

            if (passive.Name.Contains("SE"))
            {
                pos.X -= d;
            }

            if (passive.Name.Contains("NW"))
            {
                pos.X += d;
            }

            if (passive.Name.Contains("SW"))
            {
                pos.Y -= d;
            }

            return(pos.To3D());
        }
Beispiel #41
0
        public static void castQPred(Obj_AI_Hero target)
        {
            if (isHammer)
            {
                return;
            }
            PredictionOutput po = Q1.GetPrediction(target);

            if (po.Hitchance == HitChance.Collision && JayceSharp.Config.Item("useMunions").GetValue <bool>())
            {
                Obj_AI_Base fistCol = po.CollisionObjects.OrderBy(unit => unit.Distance(Player.ServerPosition)).First();
                if (fistCol.Distance(po.UnitPosition) < (180 - fistCol.BoundingRadius / 2) && fistCol.Distance(target.ServerPosition) < (100 - fistCol.BoundingRadius / 2))
                {
                    if (Q1.Cast(po.CastPosition))
                    {
                        castedQon = target;
                    }
                }
            }
            else
            {
                Q1.Cast(target);
            }
        }
Beispiel #42
0
        private static void UseHarass(Obj_AI_Base target)
        {
            var actualHeroManaPercent = (int)((Me.Mana / Me.MaxMana) * 100);
            var minPercent            = MainMenu.Item("humanqpct").GetValue <Slider>().Value;

            if (!CougarForm && HQ == 0 && MainMenu.Item("usehumanq2").GetValue <bool>())
            {
                var prediction = javelin.GetPrediction(target);
                if (target.Distance(Me.ServerPosition, true) <= javelin.RangeSqr && actualHeroManaPercent > minPercent)
                {
                    switch (MainMenu.Item("seth").GetValue <StringList>().SelectedIndex)
                    {
                    case 0:
                        if (prediction.Hitchance >= HitChance.Low)
                        {
                            PacketCast(javelin, prediction.CastPosition, Packets());
                        }
                        break;

                    case 1:
                        if (prediction.Hitchance >= HitChance.Medium)
                        {
                            PacketCast(javelin, prediction.CastPosition, Packets());
                        }
                        break;

                    case 2:
                        if (prediction.Hitchance >= HitChance.High)
                        {
                            PacketCast(javelin, prediction.CastPosition, Packets());
                        }
                        break;
                    }
                }
            }
        }
Beispiel #43
0
        public static void Orbwalk(Vector3 goalPosition, Obj_AI_Base target)
        {
            if (target != null && CanAttack() && !PUC.Menu.Item("orb_noattack").GetValue <bool>())
            {
                _disableNextAttack = false;
                FireBeforeAttack(target);
                if (!_disableNextAttack)
                {
                    if (!Player.IssueOrder(GameObjectOrder.AttackUnit, target))
                    {
                        Utility.DelayAction.Add(250, ResetAutoAttackTimer);
                    }
                    else
                    {
                        _lastAATick = Environment.TickCount + Game.Ping / 2;
                    }

                    return;
                }
            }
            if (!CanMove() || PUC.Menu.Item("orb_nomove").GetValue <bool>())
            {
                return;
            }
            if (Player.IsMelee() && target != null && target.Distance(Player) < GetAutoAttackRangeto(target) &&
                PUC.Menu.Item("orb_MeleePrediction").GetValue <bool>() && target is Obj_AI_Hero && Game.CursorPos.Distance(target.Position) < 300)
            {
                _movementPrediction.Delay = Player.BasicAttack.SpellCastTime;
                _movementPrediction.Speed = Player.BasicAttack.MissileSpeed;
                MoveTo(_movementPrediction.GetPrediction(target).UnitPosition, 1);
            }
            else
            {
                MoveTo(goalPosition);
            }
        }
Beispiel #44
0
        //------------------------------------AIHeroClient_OnProcessSpellCast-------------------------------------

        static void AIHeroClient_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsEnemy)
            {
                if (Q.IsReady() && args.SData.Name.ToLower() == "summonerflash" && args.End.Distance(Player) <= Q.Range && Menu["AutoQFlash"].Cast <CheckBox>().CurrentValue)
                {
                    //Chat.Print("{0} detected, Q on args.End", args.SData.Name);
                    var rectangle = new Geometry.Polygon.Rectangle(Player.Position, args.End, Q.Width + 20);

                    if (!EntityManager.MinionsAndMonsters.EnemyMinions.Any(it => rectangle.IsInside(it)))
                    {
                        Q.Cast(args.End);
                    }
                    return;
                }

                if (E.IsReady() && EMenu["UseShield?"].Cast <CheckBox>().CurrentValue&& MenuSpells.Any(it => it == args.SData.Name))
                {
                    if (EMenu[args.SData.Name].Cast <CheckBox>().CurrentValue)
                    {
                        List <AIHeroClient> Allies = new List <AIHeroClient>();

                        //Division
                        if (args.Target != null)
                        {
                            if (args.Target.IsAlly || args.Target.IsMe)
                            {
                                var target = EntityManager.Heroes.Allies.FirstOrDefault(it => it.NetworkId == args.Target.NetworkId);

                                //Chat.Print(args.Target.Name);

                                if (target != null)
                                {
                                    int delay = (int)((sender.Distance(target) / ((args.SData.MissileMaxSpeed + args.SData.MissileMinSpeed) / 2)) * 1000 + args.SData.SpellCastTime - 300 - Game.Ping);

                                    Core.DelayAction(() => E.Cast(target), delay);
                                    //Chat.Print("Targetted detection");
                                }
                                return;
                            }
                        }

                        //Division

                        var rectangle = new Geometry.Polygon.Rectangle(args.Start, args.End, args.SData.LineWidth);

                        foreach (var ally in EntityManager.Heroes.Allies)
                        {
                            if (rectangle.IsInside(ally))
                            {
                                Allies.Add(ally); continue;
                            }

                            foreach (var point in rectangle.Points)
                            {
                                if (ally.Distance(point) <= 90)
                                {
                                    Allies.Add(ally);
                                }
                            }
                        }

                        if (Allies.Any())
                        {
                            //Chat.Print("Rectangle Detection");

                            PriorityCast(sender, args, Allies, rectangle);
                            return;
                        }

                        //Division

                        var circle = new Geometry.Polygon.Circle(args.End, args.SData.CastRadius);

                        foreach (var ally in EntityManager.Heroes.Allies)
                        {
                            if (circle.IsInside(ally))
                            {
                                Allies.Add(ally); continue;
                            }

                            foreach (var point in circle.Points)
                            {
                                if (ally.Distance(point) <= 90)
                                {
                                    Allies.Add(ally);
                                }
                            }
                        }

                        if (Allies.Any())
                        {
                            //Chat.Print("Circle Detection");

                            PriorityCast(sender, args, Allies, circle);
                            return;
                        }
                    }
                }
            }

            return;
        }
Beispiel #45
0
 public static List<Barrel> GetBarrelsThatWillHit(Obj_AI_Base target)
 {
     return Barrels.Where(x => target.Distance(x.Object) <= SpellManager.ExplosionRadius).OrderBy(x => x.Object.Distance(Utility.Player)).ToList();
 }
Beispiel #46
0
        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy || sender.Type != GameObjectType.AIHeroClient)
            {
                return;
            }


            if (sender.Distance(Player.Position) > 1600)
            {
                return;
            }

            if (Zhonya.IsReady() && getCheckBoxItem("Zhonya"))
            {
                if (Sub["spellZ" + args.SData.Name] != null && getCheckBoxItem("spellZ" + args.SData.Name))
                {
                    if (args.Target != null && args.Target.NetworkId == Player.NetworkId)
                    {
                        Zhonya.Cast();
                    }
                    else
                    {
                        var castArea = Player.Distance(args.End) * (args.End - Player.ServerPosition).Normalized() +
                                       Player.ServerPosition;
                        if (castArea.Distance(Player.ServerPosition) < Player.BoundingRadius / 2)
                        {
                            Zhonya.Cast();
                        }
                    }
                }
            }

            if (CanUse(exhaust) && getCheckBoxItem("Exhaust"))
            {
                foreach (
                    var ally in
                    Program.Allies.Where(
                        ally =>
                        ally.IsValid && !ally.IsDead && ally.HealthPercent < 51 &&
                        Player.Distance(ally.ServerPosition) < 700))
                {
                    double dmg = 0;
                    if (args.Target != null && args.Target.NetworkId == ally.NetworkId)
                    {
                        dmg = dmg + sender.LSGetSpellDamage(ally, args.SData.Name);
                    }
                    else
                    {
                        var castArea = ally.Distance(args.End) * (args.End - ally.ServerPosition).Normalized() +
                                       ally.ServerPosition;
                        if (castArea.Distance(ally.ServerPosition) < ally.BoundingRadius / 2)
                        {
                            dmg = dmg + sender.LSGetSpellDamage(ally, args.SData.Name);
                        }
                        else
                        {
                            continue;
                        }
                    }

                    if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 40)
                    {
                        Player.Spellbook.CastSpell(exhaust, sender);
                    }
                }
            }
        }
Beispiel #47
0
        private static void OnProcess(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (E.IsReady())
            {
                if (sender.IsAlly && sender.IsValid <AIHeroClient>() && Config.Item("e.engage." + args.SData.Name).GetValue <bool>() &&
                    Config.Item("e." + sender.CharData.BaseSkinName).GetValue <bool>() && sender.Distance(ObjectManager.Player.Position) <= E.Range &&
                    !sender.IsDead && !sender.IsZombie && sender.IsValid)
                {
                    E.CastOnUnit(sender);
                }

                if (sender.IsValid <AIHeroClient>() && sender.IsEnemy && args.Target.IsAlly && args.Target.Type == GameObjectType.AIHeroClient &&
                    args.SData.IsAutoAttack() && ObjectManager.Player.ManaPercent >= Config.Item("min.mana.for.e").GetValue <Slider>().Value &&
                    Config.Item("e." + ((AIHeroClient)args.Target).ChampionName).GetValue <bool>() && ((AIHeroClient)args.Target).Distance(ObjectManager.Player.Position) < E.Range)
                {
                    E.Cast((AIHeroClient)args.Target);
                }

                if (sender.IsValid <AIHeroClient>() && args.Target.IsAlly && args.Target.Type == GameObjectType.AIHeroClient &&
                    !args.SData.IsAutoAttack() && (Config.Item("e.protect." + args.SData.Name).GetValue <bool>() || Config.Item("e.protect.targetted." + args.SData.Name).GetValue <bool>()) &&
                    sender.IsEnemy && sender.GetSpellDamage(((AIHeroClient)args.Target), args.SData.Name) > ((AIHeroClient)args.Target).Health)
                {
                    E.Cast((AIHeroClient)args.Target);
                }

                if (sender.IsValid <AIHeroClient>() && sender.IsEnemy && args.Target.IsAlly && args.Target.Type == GameObjectType.obj_AI_Turret &&
                    args.SData.IsAutoAttack() && ObjectManager.Player.ManaPercent >= Config.Item("min.mana.for.e").GetValue <Slider>().Value &&
                    ((AIHeroClient)args.Target).Distance(ObjectManager.Player.Position) < E.Range &&
                    ((AIHeroClient)args.Target).HealthPercent < Config.Item("turret.hp.percent").GetValue <Slider>().Value)
                {
                    E.Cast((AIHeroClient)args.Target);
                }
            }
        }
Beispiel #48
0
        internal static void SwitchForm(Obj_AI_Base target, string mode)
        {
            if (target == null)
            {
                return;
            }
            // catform -> human
            if (KL.CatForm() && KL.CanUse(KL.Spells["Aspect"], false, mode))
            {
                if (!target.IsValidTarget(KL.Spells["Javelin"].Range))
                {
                    return;
                }

                // get hitbox
                var radius = KL.Player.AttackRange + KL.Player.Distance(KL.Player.BBox.Minimum) + 1;

                // dont switch if have Q buff and near target
                if (KL.CanUse(KL.Spells["Takedown"], true, mode) && KL.Player.HasBuff("Takedown") &&
                    target.Distance(KL.Player.ServerPosition) <= KL.Spells["Takedown"].Range + 65f)
                {
                    return;
                }

                // change form if Q is ready and meets hitchance
                if (target.IsChampion())
                {
                    if (KL.SpellTimer["Javelin"].IsReady())
                    {
                        var poutput = KL.Spells["Javelin"].GetPrediction(target);
                        if (poutput.Hitchance >= HitChance.High)
                        {
                            KL.Spells["Aspect"].Cast();
                        }
                    }
                }
                else
                {
                    // change to human if out of pounce range and can die
                    if (!KL.SpellTimer["Pounce"].IsReady(3) && target.Distance(KL.Player.ServerPosition) <= 525)
                    {
                        if (target.Distance(KL.Player.ServerPosition) > radius)
                        {
                            if (KL.Player.GetAutoAttackDamage(target, true) * 3 >= target.Health)
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                        }
                    }
                }

                // is jungling
                if (mode == "jg")
                {
                    if (KL.CanUse(KL.Spells["Bushwhack"], true, mode) ||
                        KL.CanUse(KL.Spells["Javelin"], true, mode))
                    {
                        if ((!KL.SpellTimer["Pounce"].IsReady(2) || !KL.CanUse(KL.Spells["Pounce"], false, mode)) &&
                            (!KL.SpellTimer["Swipe"].IsReady() || !KL.CanUse(KL.Spells["Swipe"], false, mode)) &&
                            (!KL.SpellTimer["Takedown"].IsReady() || !KL.CanUse(KL.Spells["Takedown"], false, mode)) ||

                            !(KL.Player.Distance(target.ServerPosition) <= 355) ||
                            !KN.Root.Item("jgaacount").GetValue <KeyBind>().Active)
                        {
                            if (KL.Spells["Javelin"].Cast(target) != Spell.CastStates.Collision &&
                                KL.SpellTimer["Javelin"].IsReady())
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                            else if (!KL.CanUse(KL.Spells["Javelin"], true, mode))
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                        }
                    }
                }
            }

            // human -> catform
            if (!KL.CatForm() && KL.CanUse(KL.Spells["Aspect"], true, mode))
            {
                switch (mode)
                {
                case "jg":
                    if (KL.Counter < KN.Root.Item("aareq").GetValue <Slider>().Value&&
                        KN.Root.Item("jgaacount").GetValue <KeyBind>().Active)
                    {
                        return;
                    }
                    break;

                case "gap":
                    if (target.IsValidTarget(375))
                    {
                        KL.Spells["Aspect"].Cast();
                        return;
                    }
                    break;

                case "wc":
                    if (target.IsValidTarget(375) && target.IsMinion)
                    {
                        KL.Spells["Aspect"].Cast();
                        return;
                    }
                    break;
                }

                if (target.IsHunted())
                {
                    // force switch no swipe/takedown req
                    if (!KN.Root.Item("ndhrcreq").GetValue <bool>() && mode == "co" ||
                        !KN.Root.Item("ndhrjreq").GetValue <bool>() && mode == "jg")
                    {
                        KL.Spells["Aspect"].Cast();
                        return;
                    }

                    if (target.Distance(KL.Player) > KL.Spells["Takedown"].Range + 50 &&
                        !KL.CanUse(KL.Spells["Pounce"], false, mode))
                    {
                        return;
                    }

                    // or check if pounce timer is ready before switch
                    if (KL.Spells["Aspect"].IsReady() && target.IsValidTarget(KL.Spells["ExPounce"].Range))
                    {
                        // dont change form if swipe or takedown isn't ready
                        if ((KL.SpellTimer["Takedown"].IsReady() || KL.SpellTimer["Swipe"].IsReady()) &&
                            KL.SpellTimer["Pounce"].IsReady(1))
                        {
                            KL.Spells["Aspect"].Cast();
                        }
                    }
                }
                else
                {
                    // check if in pounce range
                    if (target.IsValidTarget(KL.Spells["Pounce"].Range + 55))
                    {
                        if (mode != "jg")
                        {
                            // switch to cougar if can kill target
                            if (KL.CatDamage(target) * 3 >= target.Health)
                            {
                                if (mode == "co" && target.IsValidTarget(KL.Spells["Pounce"].Range + 200))
                                {
                                    if (!KL.CanUse(KL.Spells["Javelin"], true, "co") ||
                                        KL.Spells["Javelin"].Cast(target) == Spell.CastStates.Collision)
                                    {
                                        KL.Spells["Aspect"].Cast();
                                    }
                                }
                            }

                            // switch if Q disabled in menu
                            if (!KL.CanUse(KL.Spells["Javelin"], true, mode) ||

                                // delay the cast .5 seconds
                                Utils.GameTimeTickCount - (int)(KL.TimeStamp["Javelin"] * 1000) +
                                ((6 + (6 * KL.PercentCooldownMod)) * 1000) >= 500 &&

                                // if Q is not ready in 2 seconds
                                !KL.SpellTimer["Javelin"].IsReady(2))
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                        }
                        else
                        {
                            if (KL.Spells["Javelin"].Cast(target) == Spell.CastStates.Collision &&
                                KN.Root.Item("spcol").GetValue <bool>())
                            {
                                if (KL.Spells["Aspect"].IsReady())
                                {
                                    KL.Spells["Aspect"].Cast();
                                }
                            }

                            if ((!KL.SpellTimer["Bushwhack"].IsReady() || !KL.CanUse(KL.Spells["Bushwhack"], true, mode)) &&
                                (!KL.SpellTimer["Javelin"].IsReady(3) || !KL.CanUse(KL.Spells["Javelin"], true, mode)))
                            {
                                if (KL.Spells["Aspect"].IsReady())
                                {
                                    KL.Spells["Aspect"].Cast();
                                }
                            }
                        }
                    }


                    if (KN.Target.IsValidTarget(KL.Spells["Javelin"].Range) && target.IsChampion())
                    {
                        if (KL.SpellTimer["Javelin"].IsReady())
                        {
                            // check if in pounce range.
                            if (target.Distance(KL.Player.ServerPosition) <= KL.Spells["Pounce"].Range + 100f)
                            {
                                // if we dont meet hitchance on Q target pounce nearest target
                                var poutput = KL.Spells["Javelin"].GetPrediction(KN.Target);
                                if (poutput.Hitchance < (HitChance)(KN.Root.Item("ndhqch").GetValue <StringList>().SelectedIndex + 3))
                                {
                                    if (KL.Spells["Aspect"].IsReady())
                                    {
                                        KL.Spells["Aspect"].Cast();
                                    }
                                }
                            }
                        }

                        if (KN.Target.IsHunted() && KN.Target.Distance(KL.Player.ServerPosition) > KL.Spells["ExPounce"].Range + 100)
                        {
                            if (target.Distance(KL.Player.ServerPosition) <= KL.Spells["Pounce"].Range + 25)
                            {
                                if (KL.Spells["Aspect"].IsReady())
                                {
                                    KL.Spells["Aspect"].Cast();
                                }
                            }
                        }

                        if (!KL.SpellTimer["Javelin"].IsReady())
                        {
                            if (target.Distance(KL.Player.ServerPosition) <= KL.Spells["Pounce"].Range + 125)
                            {
                                KL.Spells["Aspect"].Cast();
                            }
                        }
                    }
                }
            }
        }
Beispiel #49
0
        private void UseCombo(Obj_AI_Base target)
        {
            var ignote    = Me.GetSpellSlot("summonerdot");
            var minPounce = Config.Item("pouncerange").GetValue <Slider>().Value;
            var hitchance = Config.Item("hitchance").GetValue <StringList>().SelectedIndex;

            if (Kitty)
            {
                // dfg, botrk, hydra, tiamat
                if ((Items.CanUseItem(3128) && Items.HasItem(3128) || Items.CanUseItem(3144) && Items.HasItem(3144) ||
                     Items.CanUseItem(3153) && Items.HasItem(3153)) && TargetHunted(target) && pounce.IsReady() && ComboDamage(target) > target.Health)
                {
                    if (Config.Item("usedfg").GetValue <bool>())
                    {
                        Items.UseItem(3128, target);
                    }
                    if (Config.Item("useignote").GetValue <bool>())
                    {
                        Me.SummonerSpellbook.CastSpell(ignote, target);
                    }
                    if (Config.Item("usebork").GetValue <bool>())
                    {
                        Items.UseItem(3153);
                    }
                    if (Config.Item("usebw").GetValue <bool>())
                    {
                        Items.UseItem(3144);
                    }
                }
                else if (TargetHunted(target) && pounce.IsReady() && ComboDamage(target) > target.Health)
                {
                    if (Config.Item("useignote").GetValue <bool>())
                    {
                        Me.SummonerSpellbook.CastSpell(ignote, target);
                    }
                }

                // frost claim
                if (Items.CanUseItem(3092) && Items.HasItem(3092) && Config.Item("useclaim").GetValue <bool>())
                {
                    Items.UseItem(3092, target.Position);
                }
                if (takedown.IsReady() && Config.Item("usecougarq").GetValue <bool>() && target.Distance(Me.Position) < takedown.Range)
                {
                    takedown.CastOnUnit(Me, Packets());
                }
                if (pounce.IsReady() && Config.Item("usecougarw").GetValue <bool>() && target.Distance(Me.Position) < 750f && target.Distance(Me.Position) > minPounce)
                {
                    pounce.Cast(target.Position, Packets());
                }
                if (swipe.IsReady() && Config.Item("usecougare").GetValue <bool>())
                {
                    var prediction = swipe.GetPrediction(target);
                    if (prediction.Hitchance >= HitChance.Medium && target.Distance(Me.Position) <= swipe.Range)
                    {
                        swipe.Cast(prediction.CastPosition, Packets());
                    }
                }
                if (target.Distance(Me.Position) > pounce.Range && Config.Item("usecougarr").GetValue <bool>())
                {
                    if (aspectofcougar.IsReady())
                    {
                        aspectofcougar.Cast();
                    }
                }
                if (!pounce.IsReady() && javelin.IsReady() && target.Distance(Me.Position) < pounce.Range && Config.Item("usecougarr").GetValue <bool>())
                {
                    if (aspectofcougar.IsReady())
                    {
                        aspectofcougar.Cast();
                    }
                }
            }
            else
            {
                if (javelin.IsReady() && target.Distance(Me.Position) < javelin.Range && Config.Item("usehumanq").GetValue <bool>())
                {
                    var prediction = javelin.GetPrediction(target);

                    switch (hitchance)
                    {
                    case 0:
                        if (prediction.Hitchance >= HitChance.Low)
                        {
                            javelin.Cast(prediction.CastPosition, Packets());
                        }
                        break;

                    case 1:
                        if (prediction.Hitchance >= HitChance.Medium)
                        {
                            javelin.Cast(prediction.CastPosition, Packets());
                        }
                        break;

                    case 2:
                        if (prediction.Hitchance >= HitChance.High)
                        {
                            javelin.Cast(prediction.CastPosition, Packets());
                        }
                        break;
                    }
                }

                if (bushwack.IsReady() && Config.Item("usehumanw").GetValue <bool>() && target.Distance(Me.Position) <= bushwack.Range)
                {
                    bushwack.Cast(target.Position, Packets());
                }
            }
        }
Beispiel #50
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            if (Player.HasBuff("Recall"))
            {
                return;
            }

            HaveStun = Player.HasBuff("pyromania_particle");

            SetMana();

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

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

                foreach (var enemy in HeroManager.Enemies.Where(enemy => enemy.IsValidTarget(realRange) && OktwCommon.ValidUlt(enemy)))
                {
                    if (enemy.IsValidTarget(R.Range))
                    {
                        int Rmode = MainMenu.Item("UM" + enemy.ChampionName, true).GetValue <StringList>().SelectedIndex;

                        if (Rmode == 2)
                        {
                            continue;
                        }

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

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

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

                        if (aoeCount >= MainMenu.Item("rCount", true).GetValue <Slider>().Value&& MainMenu.Item("rCount", true).GetValue <Slider>().Value > 0)
                        {
                            R.Cast(poutput.CastPosition);
                        }
                        else if (Program.Combo && HaveStun && MainMenu.Item("autoRcombo", true).GetValue <bool>())
                        {
                            R.Cast(poutput.CastPosition);
                        }
                        else if (MainMenu.Item("autoRks", true).GetValue <bool>())
                        {
                            var comboDmg = OktwCommon.GetKsDamage(enemy, R);

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

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

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

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

            if (t.IsValidTarget() && Program.LagFree(2))
            {
                if (Q.IsReady() && MainMenu.Item("autoQ", true).GetValue <bool>())
                {
                    if (Program.Combo && RMANA + WMANA < Player.Mana)
                    {
                        Q.Cast(t);
                    }
                    else if (Program.Harass && RMANA + WMANA + QMANA < Player.Mana && MainMenu.Item("harassQ", true).GetValue <bool>() && MainMenu.Item("Harass" + t.ChampionName).GetValue <bool>())
                    {
                        Q.Cast(t);
                    }
                    else
                    {
                        var qDmg = OktwCommon.GetKsDamage(t, Q);
                        var wDmg = W.GetDamage(t);
                        if (qDmg > t.Health)
                        {
                            Q.Cast(t);
                        }
                        else if (qDmg + wDmg > t.Health && Player.Mana > QMANA + WMANA)
                        {
                            Q.Cast(t);
                        }
                    }
                }
                if (W.IsReady() && MainMenu.Item("autoW", true).GetValue <bool>() && t.IsValidTarget(W.Range))
                {
                    var poutput  = W.GetPrediction(t, true);
                    var aoeCount = poutput.AoeTargetsHitCount;

                    if (Program.Combo && RMANA + WMANA < Player.Mana)
                    {
                        W.Cast(poutput.CastPosition);
                    }
                    else if (Program.Harass && RMANA + WMANA + QMANA < Player.Mana && MainMenu.Item("harassW", true).GetValue <bool>())
                    {
                        W.Cast(poutput.CastPosition);
                    }
                    else
                    {
                        var wDmg = OktwCommon.GetKsDamage(t, W);
                        var qDmg = Q.GetDamage(t);
                        if (wDmg > t.Health)
                        {
                            W.Cast(poutput.CastPosition);
                        }
                        else if (qDmg + wDmg > t.Health && Player.Mana > QMANA + WMANA)
                        {
                            W.Cast(poutput.CastPosition);
                        }
                    }
                }
            }
            else if (Q.IsReady() || W.IsReady())
            {
                if (MainMenu.Item("farmQ", true).GetValue <bool>())
                {
                    if (MainMenu.Item("supportMode", true).GetValue <bool>())
                    {
                        if (Program.LaneClear && Player.Mana > RMANA + QMANA)
                        {
                            farm();
                        }
                    }
                    else
                    {
                        if ((!HaveStun || Program.LaneClear) && Program.Harass)
                        {
                            farm();
                        }
                    }
                }
            }

            if (Program.LagFree(3))
            {
                if (!HaveStun)
                {
                    if (E.IsReady() && !Program.LaneClear && MainMenu.Item("autoE", true).GetValue <bool>() && Player.Mana > RMANA + EMANA + QMANA + WMANA)
                    {
                        E.Cast();
                    }
                    else if (W.IsReady() && Player.InFountain())
                    {
                        W.Cast(Player.Position);
                    }
                }
                if (R.IsReady())
                {
                    if (MainMenu.Item("tibers", true).GetValue <bool>() && HaveTibers && Tibbers != null && Tibbers.IsValid)
                    {
                        var enemy = HeroManager.Enemies.Where(x => x.IsValidTarget() && Tibbers.Distance(x.Position) < 1000 && !x.UnderTurret(true)).OrderBy(x => x.Distance(Tibbers)).FirstOrDefault();
                        if (enemy != null)
                        {
                            if (Tibbers.Distance(enemy.Position) > 200)
                            {
                                R.Cast(enemy);
                            }
                            else
                            {
                                R.Cast(enemy);
                            }
                        }
                        else
                        {
                            var annieTarget = Orbwalker.GetTarget() as Obj_AI_Base;
                            if (annieTarget != null)
                            {
                                if (Tibbers.Distance(annieTarget.Position) > 200)
                                {
                                    R.Cast(annieTarget);
                                }

                                else
                                {
                                    R.Cast(annieTarget);
                                }
                            }
                            else if (Tibbers.UnderTurret(true))
                            {
                                R.Cast(Player);
                            }
                        }
                    }
                    else
                    {
                        Tibbers = null;
                    }
                }
            }
        }
 public static bool CanHit(this Spell spell, Obj_AI_Base T, float Drag = 0f)
 {
     return(T.IsValidTarget(spell.Range + Drag - ((T.Distance(ObjectManager.Player.ServerPosition) - spell.Range) / spell.Speed + spell.Delay) * T.MoveSpeed));
 }
Beispiel #52
0
        public static void doJayceInj(Obj_AI_Hero target)
        {
            if (lockedTarg != null)
            {
                target = lockedTarg;
            }
            else
            {
                lockedTarg = target;
            }


            if (isHammer)
            {
                castIgnite(target);

                if (/*inMyTowerRange(posAfterHammer(target)) &&*/ E2.IsReady())
                {
                    E2.Cast(target);
                }

                //If not in flash range  Q to get in it
                if (Player.Distance(target) > 400 && targetInRange(target, 600f))
                {
                    Q2.Cast(target);
                }

                if (!E2.IsReady() && !Q2.IsReady())
                {
                    R2.Cast();
                }
                Obj_AI_Base tower = ObjectManager.Get <Obj_AI_Turret>().Where(tur => tur.IsAlly && tur.Health > 0).OrderBy(tur => Player.Distance(tur)).First();
                if (Player.Distance(getBestPosToHammer(target.ServerPosition)) < 400 && tower.Distance(target) < 1500)
                {
                    Player.Spellbook.CastSpell(Player.GetSpellSlot("SummonerFlash"), getBestPosToHammer(target.ServerPosition));
                }
                Player.IssueOrder(GameObjectOrder.AttackUnit, target);
            }
            else
            {
                if (E1.IsReady() && Q1.IsReady() && gotManaFor(true, false, true))
                {
                    PredictionOutput po = QEmp1.GetPrediction(target);
                    var dist            = Player.Distance(po.UnitPosition);
                    if (dist <= E1.Range && getJayceEQDmg(target) < target.Health)
                    {
                        // if (JayceSharp.Config.Item("useExploit").GetValue<bool>())
                        //     doExploit(target);
                        // else
                        if (shootQE(po.CastPosition, dist > 550))
                        {
                            castedQon = target;
                        }
                    }
                    else
                    {
                        if (po.Hitchance >= HitChance.Medium && Player.Distance(po.UnitPosition) < (QEmp1.Range + target.BoundingRadius))
                        {
                            castQon   = po.CastPosition;
                            castedQon = target;
                        }
                    }

                    // QEmp1.CastIfHitchanceEquals(target, Prediction.HitChance.HighHitchance);
                }
                else if (Q1.IsReady() && gotManaFor(true) && !E1.IsReady(1000))
                {
                    if (Q1.Cast(target.Position))
                    {
                        castedQon = target;
                    }
                }
                else if (W1.IsReady() && gotManaFor(false, true) && targetInRange(getClosestEnem(), 1000f))
                {
                    W1.Cast();
                }
            }
        }
Beispiel #53
0
        public static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }

            /*
             * if (!didq)
             * {
             *  var targ = (AttackableUnit)args.Target;
             *  if (targ != null)
             *  {
             *      didaa = true;
             *  }
             * }
             * //*/
            var a = EntityManager.Heroes.Enemies.Where(x => x.IsValidTarget(player.AttackRange + 360));

            var targets = a as AIHeroClient[] ?? a.ToArray();

            foreach (var target in targets)
            {
                if ((target.HasBuff("FioraW") || target.HasBuff("PopyW")) && Qcount == 2)
                {
                    return;
                }
            }

            switch (args.SData.Name)
            {
            case "ItemTiamatCleave":
                lasthd = Core.GameTickCount;
                didhd  = true;
                didaa  = false;

                if (qtarg != null && (!SpellManager.W.IsReady() || !getCheckBoxItem(comboMenu, "usecombow")))
                {
                    if (getKeyBindItem(comboMenu, "combokey") ||
                        Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear) && !qtarg.UnderTurret(true))
                    {
                        if (!getKeyBindItem(miscMenu, "shycombo"))
                        {
                            if (SpellManager.Q.IsReady() && qtarg.Distance(player.ServerPosition) <= 350)
                            {
                                Core.DelayAction(() => EventManager.DoOneQ(qtarg.ServerPosition), 250);
                            }
                        }
                    }
                }

                if (getBoxItem(comboMenu, "wsmode") == 1 || getKeyBindItem(miscMenu, "shycombo"))
                {
                    if (getKeyBindItem(comboMenu, "combokey") ||
                        getKeyBindItem(miscMenu, "shycombo"))
                    {
                        if (canburst() && EventManager.CheckUlt())
                        {
                            if (EventManager.riventarget().IsValidTarget() && !EventManager.riventarget().IsZombie&& !EventManager.riventarget().HasBuff("kindredrnodeathbuff"))
                            {
                                if (!EventManager.fightingLogic || getCheckBoxItem(comboMenu, "r" + EventManager.riventarget().ChampionName) ||
                                    EventManager.fightingLogic && !EventManager.rrektAny() || getKeyBindItem(miscMenu, "shycombo"))
                                {
                                    Core.DelayAction(() =>
                                    {
                                        if (EventManager.riventarget().HasBuffOfType(BuffType.Stun))
                                        {
                                            SpellManager.R2.Cast(EventManager.riventarget().ServerPosition);
                                        }
                                        else
                                        {
                                            SpellManager.R2.Cast(EventManager.riventarget());
                                        }
                                    }, 240 - Game.Ping / 2);
                                }
                            }
                        }
                    }
                }
                break;

            case "RivenTriCleave":
                Qcount += 1;
                didq    = true;
                didaa   = false;
                lastq   = Core.GameTickCount;
                break;

            case "RivenMartyr":
                didw  = true;
                lastw = Core.GameTickCount;

                break;

            case "RivenFeint":
                dide  = true;
                didaa = false;
                laste = Core.GameTickCount;

                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Flee))
                {
                    if (EventManager.CheckUlt() && SpellManager.R.IsReady() && Qcount == 2 && SpellManager.Q.IsReady())
                    {
                        var btarg = TargetSelector.GetTarget(SpellManager.R2.Range, DamageType.Physical);
                        if (btarg.IsValidTarget())
                        {
                            SpellManager.R2.Cast(btarg);
                        }
                        else
                        {
                            SpellManager.R2.Cast(Game.CursorPos);
                        }
                    }
                }

                if (getKeyBindItem(miscMenu, "shycombo"))
                {
                    if (Qcount == 2 && !EventManager.CheckUlt() && SpellManager.R.IsReady() && EventManager.riventarget() != null)
                    {
                        EventManager.checkr();
                        Core.DelayAction(() => SpellManager.Q.Cast(EventManager.riventarget().ServerPosition), 240 - Game.Ping);
                    }
                }

                if (getKeyBindItem(comboMenu, "combokey"))
                {
                    if (Qcount == 2 && SpellManager.R.IsReady() && EventManager.riventarget() != null &&
                        (!EventManager.CheckUlt() || Core.GameTickCount - laste < 1000))
                    {
                        Core.DelayAction(EventManager.checkr, 100);
                    }
                }

                break;

            case "RivenFengShuiEngine":
                doFlash();

                if (getKeyBindItem(comboMenu, "combokey"))
                {
                    if (Qcount == 2 && SpellManager.R.IsReady() && EventManager.riventarget() != null && Core.GameTickCount - laste < 1000)
                    {
                        Core.DelayAction(() => Player.CastSpell(SpellSlot.Q, EventManager.riventarget().ServerPosition), 200 - Game.Ping / 2);
                    }
                }

                break;

            case "RivenIzunaBlade":
                didws = true;

                if (Qcount == 2 && SpellManager.Q.IsReady() && EventManager.riventarget().IsValidTarget(SpellManager.R2.Range))
                {
                    Player.CastSpell(SpellSlot.Q, EventManager.riventarget().ServerPosition);
                }


                if (SpellManager.W.IsReady() && EventManager.riventarget().IsValidTarget(SpellManager.W.Range + 35))
                {
                    SpellManager.W.Cast();
                }

                else if (SpellManager.Q.IsReady() && EventManager.riventarget().IsValidTarget(SpellManager.E.Range + SpellManager.Q.Range))
                {
                    Player.CastSpell(SpellSlot.Q, EventManager.riventarget().ServerPosition);
                }

                break;
            }
        }
Beispiel #54
0
 public static bool IsValidAlly(this Obj_AI_Base unit, float range = float.MaxValue)
 {
     return(unit.Distance(ObjectManager.Player) < range && unit.IsValid <Obj_AI_Hero>() && unit.IsAlly &&
            !unit.IsDead && unit.IsTargetable);
 }
Beispiel #55
0
        private static void GodHand(Obj_AI_Base target)
        {
            if (!target.IsValidTarget() || !q.IsReady())
            {
                return;
            }

            if (!_menu.Item("combokey").GetValue <KeyBind>().Active)
            {
                return;
            }

            if ((target.Distance(_player.Position) > _menu.Item("dneeded").GetValue <Slider>().Value) &&
                (target.Distance(_player.Position) < _menu.Item("dneeded2").GetValue <Slider>().Value))
            {
                var prediction = q.GetPrediction(target);
                if (_menu.Item("dograb" + target.SkinName).GetValue <StringList>().SelectedIndex != 0)
                {
                    if (prediction.Hitchance >= HitChance.High &&
                        _menu.Item("hitchance").GetValue <StringList>().SelectedIndex == 2)
                    {
                        q.Cast(prediction.CastPosition);
                    }

                    else if (prediction.Hitchance >= HitChance.Medium &&
                             _menu.Item("hitchance").GetValue <StringList>().SelectedIndex == 1)
                    {
                        q.Cast(prediction.CastPosition);
                    }

                    else if (prediction.Hitchance >= HitChance.Low &&
                             _menu.Item("hitchance").GetValue <StringList>().SelectedIndex == 0)
                    {
                        q.Cast(prediction.CastPosition);
                    }
                }
            }



            foreach (
                var unit in
                ObjectManager.Get <Obj_AI_Hero>()
                .Where(
                    hero =>
                    hero.IsValidTarget(q.Range) &&
                    _menu.Item("dograb" + hero.SkinName).GetValue <StringList>().SelectedIndex == 2))

            {
                if (unit.Distance(_player.Position) > _menu.Item("dneeded").GetValue <Slider>().Value)
                {
                    var prediction = q.GetPrediction(unit);
                    if (prediction.Hitchance == HitChance.Immobile &&
                        _menu.Item("immobile").GetValue <bool>())
                    {
                        q.Cast(prediction.CastPosition);
                    }

                    if (prediction.Hitchance == HitChance.Dashing &&
                        _menu.Item("dashing").GetValue <bool>())
                    {
                        q.Cast(prediction.CastPosition);
                    }
                }
            }
        }
Beispiel #56
0
        //-----------------------------------------------PriorityCast---------------------------------------------

        static void PriorityCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args, List <AIHeroClient> Allies, Geometry.Polygon polygon)
        {
            int delay = new int();

            Allies.OrderBy(it => it.Distance(args.Start));

            var ally = Allies.First();

            if (Allies.Count == 1)
            {
                delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 300 - Game.Ping);

                Core.DelayAction(delegate
                {
                    if (polygon.IsInside(ally) && E.IsInRange(ally))
                    {
                        E.Cast(ally);
                    }
                    return;
                }, delay);

                //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());
                return;
            }
            else
            {
                if (CollisionSpells.Any(it => it == args.SData.Name))
                {
                    delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 300 - Game.Ping);

                    Core.DelayAction(delegate
                    {
                        foreach (var Ally in Allies)
                        {
                            if (polygon.IsInside(Ally) && E.IsInRange(Ally))
                            {
                                E.Cast(Ally); return;
                            }
                        }
                        return;
                    }, delay);

                    //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());

                    return;
                }

                else
                {
                    IEnumerable <AIHeroClient> priorities = from aliado in EntityManager.Heroes.Allies orderby EMenu[aliado.BaseSkinName].Cast <Slider>().CurrentValue descending select aliado;

                    delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 200 - Game.Ping);

                    Core.DelayAction(delegate
                    {
                        foreach (var Ally in priorities)
                        {
                            if (polygon.IsInside(Ally) && E.IsInRange(Ally))
                            {
                                E.Cast(Ally); return;
                            }
                        }
                        return;
                    }, delay);

                    //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());
                    return;
                }
            }
        }
Beispiel #57
0
        public void UltLogic_OnSpellcast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsEnemy)
            {
                if (R.IsReady())
                {
                    if (SoulboundAlly != null)
                    {
                        var sdata = SpellDatabase.GetByName(args.SData.Name);
                        if (UseRCounterEngageBool && sdata != null &&
                            (args.End.Distance(ObjectManager.Player.ServerPosition) < 550 || args.Target.IsMe) &&
                            sdata.SpellTags != null &&
                            sdata.SpellTags.Any(st => st == LeagueSharp.SDK.SpellTags.Dash || st == LeagueSharp.SDK.SpellTags.Blink))
                        {
                            R.Cast();
                        }
                        if (UseRInterruptBool && sdata != null && sdata.SpellTags != null &&
                            sdata.SpellTags.Any(st => st == LeagueSharp.SDK.SpellTags.Interruptable) && sender.Distance(ObjectManager.Player.ServerPosition) < sdata.Range)
                        {
                            R.Cast();
                        }
                        if (UseRAllySaverBool)
                        {
                            if (args.Target != null &&
                                args.Target.NetworkId == SoulboundAlly.NetworkId)
                            {
                                if (args.SData.ConsideredAsAutoAttack)
                                {
                                    IncomingDamageToSoulboundAlly.Add(
                                        SoulboundAlly.ServerPosition.Distance(sender.ServerPosition) /
                                        args.SData.MissileSpeed +
                                        Game.Time, (float)sender.GetAutoAttackDamage(SoulboundAlly));
                                    return;
                                }
                                if (sender is AIHeroClient)
                                {
                                    var attacker = (AIHeroClient)sender;
                                    var slot     = attacker.GetSpellSlot(args.SData.Name);

                                    if (slot != SpellSlot.Unknown)
                                    {
                                        var igniteSlot = attacker.GetSpellSlot("SummonerDot");
                                        if (slot == igniteSlot && args.Target != null &&
                                            args.Target.NetworkId == SoulboundAlly.NetworkId)
                                        {
                                            InstantDamageOnSoulboundAlly.Add(Game.Time + 2,
                                                                             (float)
                                                                             attacker.LSGetSpellDamage(SoulboundAlly,
                                                                                                       attacker.GetSpellSlot("SummonerDot")));
                                            return;
                                        }
                                        if (slot.HasFlag(SpellSlot.Q | SpellSlot.W | SpellSlot.E | SpellSlot.R))
                                        {
                                            InstantDamageOnSoulboundAlly.Add(Game.Time + 2,
                                                                             (float)attacker.LSGetSpellDamage(SoulboundAlly, slot));
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #58
0
        // Cougar W Logic
        internal static void CastPounce(Obj_AI_Base target, string mode)
        {
            if (target == null)
            {
                return;
            }
            // check the actual spell timer and if we have it enabled in our menu
            if (!KL.CatForm() || !KL.CanUse(KL.Spells["Pounce"], false, mode))
            {
                return;
            }

            // check if target is hunted in 750 range
            if (!target.IsValidTarget(KL.Spells["ExPounce"].Range))
            {
                return;
            }

            if (target.IsHunted())
            {
                // get hitbox
                var radius = KL.Player.AttackRange + KL.Player.Distance(KL.Player.BBox.Minimum) + 1;

                // force pounce if menu item enabled
                if (target.IsHunted() && KN.Root.Item("ndcwhunt").GetValue <bool>() ||

                    // or of target is greater than my attack range
                    target.Distance(KL.Player.ServerPosition) > radius ||

                    // or is jungling or waveclearing (without farm distance check)
                    mode == "jg" || mode == "wc" && !KN.Root.Item("ndcwdistwc").GetValue <bool>() ||

                    // or combo mode and ignoring distance check
                    !target.IsHunted() && mode == "co" && !KN.Root.Item("ndcwdistco").GetValue <bool>())
                {
                    if (KN.Root.Item("kitejg").GetValue <bool>() && mode == "jg" &&
                        target.Distance(Game.CursorPos) > 600 && target.Distance(KL.Player.ServerPosition) <= 300)
                    {
                        KL.Spells["Pounce"].Cast(Game.CursorPos);
                        return;
                    }

                    KL.Spells["Pounce"].Cast(target.ServerPosition);
                }
            }

            // if target is not hunted
            else
            {
                // check if in the original pounce range
                if (target.Distance(KL.Player.ServerPosition) > KL.Spells["Pounce"].Range)
                {
                    return;
                }

                // get hitbox
                var radius = KL.Player.AttackRange + KL.Player.Distance(KL.Player.BBox.Minimum) + 1;

                // check minimum distance before pouncing
                if (target.Distance(KL.Player.ServerPosition) > radius ||

                    // or is jungling or waveclearing (without distance checking)
                    mode == "jg" || mode == "wc" && !KN.Root.Item("ndcwdistwc").GetValue <bool>() ||

                    // or combo mode with no distance checking
                    mode == "co" && !KN.Root.Item("ndcwdistco").GetValue <bool>())
                {
                    if (target.IsChampion())
                    {
                        if (KN.Root.Item("ndcwcheck").GetValue <bool>())
                        {
                            var voutout = KL.Spells["Pounce"].GetPrediction(target);
                            if (voutout.Hitchance >= (HitChance)KN.Root.Item("ndcwch").GetValue <StringList>().SelectedIndex + 3)
                            {
                                KL.Spells["Pounce"].Cast(voutout.CastPosition);
                            }
                        }
                        else
                        {
                            KL.Spells["Pounce"].Cast(target.ServerPosition);
                        }
                    }
                    else
                    {
                        // check pouncing near enemies
                        if (mode == "wc" && KN.Root.Item("ndcwene").GetValue <bool>() &&
                            target.ServerPosition.CountEnemiesInRange(550) > 0)
                        {
                            return;
                        }

                        // check pouncing under turret
                        if (mode == "wc" && KN.Root.Item("ndcwtow").GetValue <bool>() &&
                            target.ServerPosition.UnderTurret(true))
                        {
                            return;
                        }

                        KL.Spells["Pounce"].Cast(target.ServerPosition);
                    }
                }
            }
        }
Beispiel #59
0
 public static float TravelTime(this Spell.SpellBase spell, Obj_AI_Base target)
 {
     return(((target.Distance(Player.Instance) / spell.Handle.SData.MissileSpeed) * 1000) + spell.CastDelay + (Game.Ping / 2));
 }
Beispiel #60
0
        private void CastE(Obj_AI_Base target)
        {
            if (_isBallMoving)
            {
                return;
            }

            if (menu.Item("saveEMana", true).GetValue <bool>() && Player.Mana - ESpell.ManaCost < QSpell.ManaCost + WSpell.ManaCost)
            {
                return;
            }

            Obj_AI_Hero etarget = Player;

            switch (_ballStatus)
            {
            case 0:
                if (target != null)
                {
                    float travelTime    = target.Distance(Player.ServerPosition) / Q.Speed;
                    float minTravelTime = 10000f;

                    foreach (
                        Obj_AI_Hero ally in
                        ObjectManager.Get <Obj_AI_Hero>()
                        .Where(x => x.IsAlly && Player.Distance(x.ServerPosition) <= E.Range && !x.IsMe))
                    {
                        //dmg enemy with E
                        if (menu.Item("UseEDmg", true).GetValue <bool>())
                        {
                            PredictionOutput prediction3 = Util.GetP(Player.ServerPosition, E, target, true);
                            Object[]         obj         = Util.VectorPointProjectionOnLineSegment(Player.ServerPosition.To2D(),
                                                                                                   ally.ServerPosition.To2D(), prediction3.UnitPosition.To2D());
                            var isOnseg   = (bool)obj[2];
                            var pointLine = (Vector2)obj[1];

                            if (E.IsReady() && isOnseg &&
                                prediction3.UnitPosition.Distance(pointLine.To3D()) < E.Width)
                            {
                                //Console.WriteLine("Dmg 1");
                                E.CastOnUnit(ally);
                                return;
                            }
                        }

                        float allyRange = target.Distance(ally.ServerPosition) / Q.Speed +
                                          ally.Distance(Player.ServerPosition) / E.Speed;
                        if (allyRange < minTravelTime)
                        {
                            etarget       = ally;
                            minTravelTime = allyRange;
                        }
                    }

                    if (minTravelTime < travelTime && Player.Distance(etarget.ServerPosition) <= E.Range &&
                        E.IsReady())
                    {
                        E.CastOnUnit(etarget);
                    }
                }
                break;

            case 1:
                //dmg enemy with E
                if (menu.Item("UseEDmg", true).GetValue <bool>())
                {
                    PredictionOutput prediction = Util.GetP(_currentBallPosition, E, target, true);
                    Object[]         obj        = Util.VectorPointProjectionOnLineSegment(_currentBallPosition.To2D(),
                                                                                          Player.ServerPosition.To2D(), prediction.UnitPosition.To2D());
                    var isOnseg   = (bool)obj[2];
                    var pointLine = (Vector2)obj[1];

                    if (E.IsReady() && isOnseg && prediction.UnitPosition.Distance(pointLine.To3D()) < E.Width)
                    {
                        //Console.WriteLine("Dmg 2");
                        E.CastOnUnit(Player);
                        return;
                    }
                }

                float travelTime2    = target.Distance(_currentBallPosition) / Q.Speed;
                float minTravelTime2 = target.Distance(Player.ServerPosition) / Q.Speed +
                                       Player.Distance(_currentBallPosition) / E.Speed;

                if (minTravelTime2 < travelTime2 && target.Distance(Player.ServerPosition) <= Q.Range + Q.Width &&
                    E.IsReady())
                {
                    E.CastOnUnit(Player);
                }

                break;

            case 2:
                float travelTime3    = target.Distance(_currentBallPosition) / Q.Speed;
                float minTravelTime3 = 10000f;

                foreach (
                    Obj_AI_Hero ally in
                    ObjectManager.Get <Obj_AI_Hero>()
                    .Where(x => x.IsAlly && Player.Distance(x.ServerPosition) <= E.Range && !x.IsMe))
                {
                    //dmg enemy with E
                    if (menu.Item("UseEDmg", true).GetValue <bool>())
                    {
                        PredictionOutput prediction2 = Util.GetP(_currentBallPosition, E, target, true);
                        Object[]         obj         = Util.VectorPointProjectionOnLineSegment(_currentBallPosition.To2D(),
                                                                                               ally.ServerPosition.To2D(), prediction2.UnitPosition.To2D());
                        var isOnseg   = (bool)obj[2];
                        var pointLine = (Vector2)obj[1];

                        if (E.IsReady() && isOnseg &&
                            prediction2.UnitPosition.Distance(pointLine.To3D()) < E.Width)
                        {
                            Console.WriteLine("Dmg 3");
                            E.CastOnUnit(ally);
                            return;
                        }
                    }

                    float allyRange2 = target.Distance(ally.ServerPosition) / Q.Speed +
                                       ally.Distance(_currentBallPosition) / E.Speed;

                    if (allyRange2 < minTravelTime3)
                    {
                        etarget        = ally;
                        minTravelTime3 = allyRange2;
                    }
                }

                if (minTravelTime3 < travelTime3 && Player.Distance(etarget.ServerPosition) <= E.Range &&
                    E.IsReady())
                {
                    E.CastOnUnit(etarget);
                }

                break;
            }
        }