Пример #1
0
        /// <summary>
        ///     Fired when the game is updated.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        public static void Clear(EventArgs args)
        {
            if (Bools.HasSheenBuff())
            {
                return;
            }

            /// <summary>
            ///     The Q Clear Logics.
            /// </summary>
            if (Vars.Q.IsReady() &&
                GameObjects.Player.ManaPercent
                > ManaManager.GetNeededMana(Vars.Q.Slot, Vars.Menu["spells"]["q"]["clear"]) &&
                Vars.Menu["spells"]["q"]["clear"].GetValue <MenuSliderButton>().BValue)
            {
                /// <summary>
                ///     The Q LaneClear Logic.
                /// </summary>
                if (
                    Vars.Q.GetLineFarmLocation(
                        Targets.Minions.Where(m => m.Health < (float)GameObjects.Player.GetSpellDamage(m, SpellSlot.Q))
                        .ToList(),
                        Vars.Q.Width).MinionsHit >= 3)
                {
                    Vars.Q.Cast(
                        Vars.Q.GetLineFarmLocation(
                            Targets.Minions.Where(
                                m => m.Health < (float)GameObjects.Player.GetSpellDamage(m, SpellSlot.Q)).ToList(),
                            Vars.Q.Width).Position);
                }

                /// <summary>
                ///     The Q JungleClear Logic.
                /// </summary>
                else if (Targets.JungleMinions.Any())
                {
                    Vars.Q.Cast(Targets.JungleMinions[0].ServerPosition);
                }
            }

            /// <summary>
            ///     The E LaneClear Logics.
            /// </summary>
            if (Vars.E.IsReady() &&
                GameObjects.Player.ManaPercent
                > ManaManager.GetNeededMana(Vars.E.Slot, Vars.Menu["spells"]["e"]["laneclear"]) &&
                Vars.Menu["spells"]["e"]["laneclear"].GetValue <MenuSliderButton>().BValue)
            {
                if (
                    Targets.Minions.Count(
                        m =>
                        Kalista.IsPerfectRendTarget(m) &&
                        Vars.GetRealHealth(m)
                        < (float)GameObjects.Player.GetSpellDamage(m, SpellSlot.E)
                        + (float)GameObjects.Player.GetSpellDamage(m, SpellSlot.E, DamageStage.Buff)) >= 2)
                {
                    Vars.E.Cast();
                }
            }
        }
Пример #2
0
        /// <summary>
        ///     Called when the game updates itself.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        public static void Killsteal(EventArgs args)
        {
            /// <summary>
            ///     The KillSteal Q Logic.
            /// </summary>
            if (Vars.Q.IsReady() && Vars.Menu["spells"]["q"]["killsteal"].GetValue <MenuBool>().Value)
            {
                foreach (var target in
                         GameObjects.EnemyHeroes.Where(
                             t =>
                             !Invulnerable.Check(t) && !Kalista.IsPerfectRendTarget(t) && t.IsValidTarget(Vars.Q.Range) &&
                             !t.IsValidTarget(GameObjects.Player.GetRealAutoAttackRange()) &&
                             Vars.GetRealHealth(t) < (float)GameObjects.Player.GetSpellDamage(t, SpellSlot.Q)))
                {
                    if (!Vars.Q.GetPrediction(target).CollisionObjects.Any() ||
                        Vars.Q.GetPrediction(target)
                        .CollisionObjects.Count(
                            c =>
                            Targets.Minions.Contains(c) &&
                            c.Health < (float)GameObjects.Player.GetSpellDamage(c, SpellSlot.Q))
                        == Vars.Q.GetPrediction(target).CollisionObjects.Count(c => Targets.Minions.Contains(c)))
                    {
                        Vars.Q.Cast(Vars.Q.GetPrediction(target).UnitPosition);
                    }
                }
            }

            /// <summary>
            ///     The KillSteal E Logic.
            /// </summary>
            if (Vars.E.IsReady() && Vars.Menu["spells"]["e"]["killsteal"].GetValue <MenuBool>().Value)
            {
                if (
                    GameObjects.EnemyHeroes.Any(
                        t =>
                        Kalista.IsPerfectRendTarget(t) &&
                        Vars.GetRealHealth(t)
                        < (float)GameObjects.Player.GetSpellDamage(t, SpellSlot.E)
                        + (float)GameObjects.Player.GetSpellDamage(t, SpellSlot.E, DamageStage.Buff)))
                {
                    Vars.E.Cast();
                }
            }
        }
Пример #3
0
        /// <summary>
        ///     Loads the drawings.
        /// </summary>
        public static void Initialize()
        {
            Drawing.OnDraw += delegate
            {
                if (!Vars.E.IsReady() || !Vars.Menu["drawings"]["edmg"].GetValue <MenuBool>().Value)
                {
                    return;
                }

                ObjectManager.Get <Obj_AI_Base>()
                .Where(
                    h =>
                    h.IsValidTarget() && Kalista.IsPerfectRendTarget(h) &&
                    (h is Obj_AI_Hero || Vars.JungleList.Contains(h.CharData.BaseSkinName)))
                .ToList()
                .ForEach(
                    unit =>
                {
                    var heroUnit = (Obj_AI_Hero)unit;
                    /// <summary>
                    ///     Defines what HPBar Offsets it should display.
                    /// </summary>
                    var mobOffset =
                        Drawings.JungleHpBarOffsetList.FirstOrDefault(
                            x => x.BaseSkinName.Equals(unit.CharData.BaseSkinName));

                    var width = Vars.JungleList.Contains(unit.CharData.BaseSkinName)
                                                    ? mobOffset?.Width ?? Drawings.SWidth
                                                    : Drawings.SWidth;
                    var height = Vars.JungleList.Contains(unit.CharData.BaseSkinName)
                                                     ? mobOffset?.Height ?? Drawings.SHeight
                                                     : Drawings.SHeight;
                    var xOffset = Vars.JungleList.Contains(unit.CharData.BaseSkinName)
                                                      ? mobOffset?.XOffset ?? Drawings.SxOffset(heroUnit)
                                                      : Drawings.SxOffset(heroUnit);
                    var yOffset = Vars.JungleList.Contains(unit.CharData.BaseSkinName)
                                                      ? mobOffset?.YOffset ?? Drawings.SyOffset(heroUnit)
                                                      : Drawings.SyOffset(heroUnit);
                    var barPos = unit.HPBarPosition;
                    {
                        barPos.X += xOffset;
                        barPos.Y += yOffset;
                    }
                    var drawEndXPos   = barPos.X + width * (unit.HealthPercent / 100);
                    var drawStartXPos = barPos.X
                                        + (Vars.GetRealHealth(unit)
                                           > (float)GameObjects.Player.GetSpellDamage(unit, SpellSlot.E)
                                           + (float)
                                           GameObjects.Player.GetSpellDamage(
                                               unit,
                                               SpellSlot.E,
                                               DamageStage.Buff)
                                                               ? width
                                           * ((Vars.GetRealHealth(unit)
                                               - ((float)
                                                  GameObjects.Player.GetSpellDamage(
                                                      unit,
                                                      SpellSlot.E)
                                                  + (float)
                                                  GameObjects.Player.GetSpellDamage(
                                                      unit,
                                                      SpellSlot.E,
                                                      DamageStage.Buff))) / unit.MaxHealth * 100
                                              / 100)
                                                               : 0);
                    Drawing.DrawLine(
                        drawStartXPos,
                        barPos.Y,
                        drawEndXPos,
                        barPos.Y,
                        height,
                        Vars.GetRealHealth(unit)
                        < (float)GameObjects.Player.GetSpellDamage(unit, SpellSlot.E)
                        + (float)GameObjects.Player.GetSpellDamage(unit, SpellSlot.E, DamageStage.Buff)
                                            ? Color.Blue
                                            : Color.Orange);
                    Drawing.DrawLine(
                        drawStartXPos,
                        barPos.Y,
                        drawStartXPos,
                        barPos.Y + height + 1,
                        1,
                        Color.Lime);
                });
            };
        }
Пример #4
0
        /// <summary>
        ///     Called when the game updates itself.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        public static void Automatic(EventArgs args)
        {
            /// <summary>
            ///     The Soulbound declaration.
            /// </summary>
            if (Kalista.SoulBound == null)
            {
                Kalista.SoulBound =
                    GameObjects.AllyHeroes.Find(
                        a => a.Buffs.Any(b => b.Caster.IsMe && b.Name.Contains("kalistacoopstrikeally")));
            }
            else
            {
                /// <summary>
                ///     The Automatic R Logic.
                /// </summary>
                if (Vars.R.IsReady() &&
                    Health.GetPrediction(Kalista.SoulBound, (int)(250 + Game.Ping / 2f))
                    <= Kalista.SoulBound.MaxHealth / 4 && Kalista.SoulBound.CountEnemyHeroesInRange(800f) > 0 &&
                    Kalista.SoulBound.IsValidTarget(Vars.R.Range, false) &&
                    Vars.Menu["spells"]["r"]["lifesaver"].GetValue <MenuBool>().Value)
                {
                    Vars.R.Cast();
                }
            }

            /// <summary>
            ///     The Automatic W Logic.
            /// </summary>
            if (Vars.W.IsReady() && !GameObjects.Player.IsRecalling() && !GameObjects.Player.IsUnderEnemyTurret() &&
                Variables.Orbwalker.ActiveMode == OrbwalkingMode.None &&
                GameObjects.Player.CountEnemyHeroesInRange(1500f) == 0 &&
                GameObjects.Player.ManaPercent
                > ManaManager.GetNeededMana(Vars.W.Slot, Vars.Menu["spells"]["w"]["logical"]) &&
                Vars.Menu["spells"]["w"]["logical"].GetValue <MenuSliderButton>().BValue)
            {
                foreach (var loc in
                         Kalista.Locations.Where(
                             l =>
                             GameObjects.Player.Distance(l) < Vars.W.Range &&
                             !ObjectManager.Get <Obj_AI_Minion>()
                             .Any(m => m.Distance(l) < 1000f && m.BaseSkinName.Equals("kalistaspawn"))))
                {
                    Vars.W.Cast(loc);
                }
            }

            /// <summary>
            ///     The Automatic E Logics.
            /// </summary>
            if (Vars.E.IsReady())
            {
                /// <summary>
                ///     The E Before death Logic.
                /// </summary>
                if (Health.GetPrediction(GameObjects.Player, (int)(1000 + Game.Ping / 2f)) <= 0 &&
                    Vars.Menu["spells"]["e"]["ondeath"].GetValue <MenuBool>().Value)
                {
                    Vars.E.Cast();
                }

                var validMinions =
                    Targets.Minions.Where(
                        m =>
                        Kalista.IsPerfectRendTarget(m) &&
                        Vars.GetRealHealth(m)
                        < (float)GameObjects.Player.GetSpellDamage(m, SpellSlot.E)
                        + (float)GameObjects.Player.GetSpellDamage(m, SpellSlot.E, DamageStage.Buff));

                var validTargets = GameObjects.EnemyHeroes.Where(Kalista.IsPerfectRendTarget);

                var objAiMinions = validMinions as IList <Obj_AI_Minion> ?? validMinions.ToList();
                var objAiHeroes  = validTargets as IList <AIHeroClient> ?? validTargets.ToList();

                /// <summary>
                ///     The E Minion Harass Logic.
                /// </summary>
                if (objAiMinions.Any() && objAiHeroes.Any() &&
                    Vars.Menu["spells"]["e"]["harass"].GetValue <MenuSliderButton>().BValue)
                {
                    if (objAiMinions.Count == 1)
                    {
                        /// <summary>
                        ///     Check for Mana Manager if not in combo mode and the killable minion is only one, else do not use it.
                        /// </summary>
                        if (Variables.Orbwalker.ActiveMode != OrbwalkingMode.Combo)
                        {
                            if (GameObjects.Player.ManaPercent
                                < ManaManager.GetNeededMana(Vars.E.Slot, Vars.Menu["spells"]["e"]["harass"]))
                            {
                                return;
                            }
                        }

                        /// <summary>
                        ///     Check for E Whitelist if the harassable target is only one and there is only one killable minion, else do not use the whitelist.
                        /// </summary>
                        else if (objAiHeroes.Count == 1)
                        {
                            var hero = objAiHeroes.FirstOrDefault();
                            if (hero != null &&
                                !Vars.Menu["spells"]["e"]["whitelist"][hero.ChampionName.ToLower()]
                                .GetValue <MenuBool>().Value)
                            {
                                return;
                            }
                        }

                        Vars.E.Cast();
                    }
                }

                /// <summary>
                ///     The E JungleClear Logic.
                /// </summary>
                if (Vars.Menu["spells"]["e"]["junglesteal"].GetValue <MenuBool>().Value)
                {
                    if (
                        Targets.JungleMinions.Any(
                            m =>
                            Kalista.IsPerfectRendTarget(m) &&
                            m.Health
                            < (float)GameObjects.Player.GetSpellDamage(m, SpellSlot.E)
                            + (float)GameObjects.Player.GetSpellDamage(m, SpellSlot.E, DamageStage.Buff)))
                    {
                        Vars.E.Cast();
                    }
                }
            }
        }