예제 #1
0
        public static void HandleQLogic()
        {
            if (!Orbwalking.CanMove(80))
            {
                return;
            }

            if (ObjectManager.Player.Spellbook.IsAutoAttacking || ObjectManager.Player.Spellbook.IsAutoAttacking)
            {
                return;
            }

            if (Variables.spells[SpellSlot.Q].IsEnabledAndReady(false))
            {
                var maxAaRange     = JinxUtility.GetMinigunRange(null) + JinxUtility.GetFishboneRange() + 25f;
                var selectedTarget = TargetSelector.GetTarget(maxAaRange, TargetSelector.DamageType.Physical);
                var jinxBaseRange  = JinxUtility.GetMinigunRange(selectedTarget);

                if (selectedTarget.IsValidTarget())
                {
                    var manaItem      = Variables.Menu.Item($"iseriesr.{ObjectManager.Player.ChampionName.ToLower()}.{Variables.Orbwalker.ActiveMode.ToString().ToLower()}.mm.{SpellSlot.Q.ToString().ToLower()}");
                    var manaCondition = (manaItem != null && ObjectManager.Player.ManaPercent >= manaItem.GetValue <Slider>().Value);

                    if (JinxUtility.IsFishBone())
                    {
                        //If we can kill the target within 3 AAs then don't switch.
                        //Jinx Q uses 20 mana for each AA. So check if we can do the 3 AAs.
                        //And also check if the target is not about to escape our AA range.
                        if (selectedTarget.Health + 5 <= ObjectManager.Player.GetAutoAttackDamage(selectedTarget) * 3 &&
                            (ObjectManager.Player.Mana - 20 * 3 > 0) &&
                            !(selectedTarget.Distance(ObjectManager.Player) > JinxUtility.GetFishboneRange() * 0.9f &&
                              (ObjectManager.Player.ServerPosition.Distance((selectedTarget.ServerPosition.To2D() + selectedTarget.Direction.To2D().Perpendicular() * (300 + 65f)).To3D()) > ObjectManager.Player.Distance(selectedTarget.ServerPosition))
                              ))
                        {
                            return;
                        }

                        //We don't have more mana then set in the menu.
                        if (!manaCondition)
                        {
                            //Swap to minigun
                            Variables.spells[SpellSlot.Q].Cast();
                            return;
                        }

                        //If the distance from the selected target is less than the minigun base range. And it has no enemies in 150 (AOE) range within it.
                        //Swap to minigun.
                        if (ObjectManager.Player.Distance(selectedTarget) < jinxBaseRange && !(selectedTarget.ServerPosition.CountEnemiesInRange(150) >= 2))
                        {
                            Variables.spells[SpellSlot.Q].Cast();
                        }
                    }
                    else
                    {
                        //If the distance is greater than our current AA range or the selected target has enemies in AOE range.
                        //Swap to fishbone
                        if (ObjectManager.Player.Distance(selectedTarget) > jinxBaseRange || (selectedTarget.ServerPosition.CountEnemiesInRange(150) >= 2))
                        {
                            Variables.spells[SpellSlot.Q].Cast();
                        }
                    }
                }
            }
        }
예제 #2
0
        public void Run()
        {
            var target = TargetSelector.GetTarget(
                Variables.spells[SpellSlot.R].Range * 0.75f, TargetSelector.DamageType.Magical);

            if (target.IsValidTarget())
            {
                var enemiesAround = target.GetEnemiesInRange(450f);
                if (ObjectManager.Player.Distance(target) > JinxUtility.GetFishboneRange() &&
                    HealthPrediction.GetHealthPrediction(target, 375) > 0 &&
                    HealthPrediction.GetHealthPrediction(target, 375) + 5 <
                    Variables.spells[SpellSlot.R].GetDamage(target))
                {
                    //Target is over the minimum distance.
                    //Check for overkill logics.

                    //We can kill target with W. Don't use R.
                    if ((Variables.spells[SpellSlot.W].IsEnabledAndReady() &&
                         Variables.spells[SpellSlot.W].GetPrediction(target).Hitchance >= HitChance.VeryHigh
                        ? Variables.spells[SpellSlot.W].GetDamage(target)
                        : 0) > target.Health)
                    {
                        return;
                    }

                    Variables.spells[SpellSlot.R].CastIfHitchanceEquals(target, HitChance.VeryHigh);
                }
                else if (ObjectManager.Player.Distance(target) < JinxUtility.GetFishboneRange() &&
                         HealthPrediction.GetHealthPrediction(target, 375) > 0 &&
                         HealthPrediction.GetHealthPrediction(target, 375) + 5 <
                         Variables.spells[SpellSlot.R].GetDamage(target))
                {
                    //Else if the target is in range and we are low health and we can kill them.
                    //Cast R without prodiction.
                    if (ObjectManager.Player.HealthPercent < 15)
                    {
                        Variables.spells[SpellSlot.R].Cast(target.ServerPosition);
                        return;
                    }

                    //We can kill the target with W (If we can hit it, using prediction) and 2 AA then return.
                    if (ObjectManager.Player.GetAutoAttackDamage(target) * 2 +
                        (Variables.spells[SpellSlot.W].IsEnabledAndReady() &&
                         Variables.spells[SpellSlot.W].GetPrediction(target).Hitchance >= HitChance.VeryHigh
                            ? Variables.spells[SpellSlot.W].GetDamage(target)
                            : 0) > target.Health)
                    {
                        return;
                    }

                    Variables.spells[SpellSlot.R].CastIfHitchanceEquals(target, HitChance.VeryHigh);
                }
                else if (
                    enemiesAround.Count(
                        m => Variables.spells[SpellSlot.R].GetDamage(m) >= target.Health * 0.25f + 5) > 1)
                {
                    //We can do more than 25% health % damage to at least 3 enemies. Go for it lol.
                    Variables.spells[SpellSlot.R].CastIfHitchanceEquals(target, HitChance.High);
                }
            }
        }