Exemple #1
0
        public void Run()
        {
            var selectedTarget = TargetSelector.GetTarget(Variables.spells[SpellSlot.W].Range * 0.70f, TargetSelector.DamageType.Physical);
            var WSpell         = Variables.spells[SpellSlot.W];

            if (selectedTarget.IsValidTarget())
            {
                //The selected target is valid.
                if (selectedTarget.HasBuffOfType(BuffType.Slow) && selectedTarget.Path.Count() > 1)
                {
                    //Target is slowed.
                    var slowEndTime = JinxUtility.GetSlowEndTime(selectedTarget);
                    if (slowEndTime >= WSpell.Delay + 0.5f + Game.Ping / 2f)
                    {
                        WSpell.CastIfHitchanceEquals(selectedTarget, HitChance.VeryHigh);
                    }
                }
                else if (JinxUtility.IsHeavilyImpaired(selectedTarget))
                {
                    //The target is actually impaired heavily. Let's cast E on them.
                    var immobileEndTime = JinxUtility.GetImpairedEndTime(selectedTarget);
                    if (immobileEndTime >= WSpell.Delay + 0.5f + Game.Ping / 2f)
                    {
                        WSpell.CastIfHitchanceEquals(selectedTarget, HitChance.VeryHigh);
                    }
                }
            }
        }
Exemple #2
0
 public static void QSwapLC()
 {
     //If we are in laneclear or lasthit
     if (Variables.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
         Variables.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit)
     {
         if (Variables.spells[SpellSlot.Q].IsEnabledAndReady())
         {
             //If there are no minions in our AA range.
             if (
                 !MinionManager.GetMinions(ObjectManager.Player.ServerPosition,
                                           Orbwalking.GetRealAutoAttackRange(null)).Any())
             {
                 if (JinxUtility.IsFishBone())
                 {
                     Variables.spells[SpellSlot.Q].Cast();
                 }
             }
         }
         else
         {
             if (JinxUtility.IsFishBone())
             {
                 Variables.spells[SpellSlot.Q].Cast();
             }
         }
     }
 }
Exemple #3
0
 public static void QSwapNoEnemies()
 {
     if (Variables.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo &&
         JinxUtility.IsFishBone() &&
         MenuExtensions.GetItemValue <bool>("iseriesr.jinx.q.switch.noenemies") &&
         ObjectManager.Player.CountEnemiesInRange(1500) < 1)
     {
         Variables.spells[SpellSlot.Q].Cast();
     }
 }
Exemple #4
0
        public void Run()
        {
            if (Variables.spells[SpellSlot.R].IsReady())
            {
                var rTarget = TargetSelector.GetTarget(Variables.spells[SpellSlot.R].Range, TargetSelector.DamageType.Magical);
                if (rTarget.IsValidTarget() &&
                    (JinxUtility.IsHeavilyImpaired(rTarget) || JinxUtility.IsLightlyImpaired(rTarget)))
                {
                    var prediction = Variables.spells[SpellSlot.R].GetPrediction(rTarget);

                    if (prediction.Hitchance >= HitChance.Medium)
                    {
                        Variables.spells[SpellSlot.R].Cast(prediction.CastPosition);
                    }
                }
            }
        }
Exemple #5
0
 internal static void BeforeAttack(Orbwalking.BeforeAttackEventArgs args)
 {
     if (Variables.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
         Variables.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit)
     {
         //If we have the switch to always go minigun in LC or LH mode then switch and return.
         if (MenuExtensions.GetItemValue <bool>("iseriesr.jinx.q.switch.lhlc"))
         {
             if (JinxUtility.IsFishBone())
             {
                 Variables.spells[SpellSlot.Q].Cast();
                 return;
             }
         }
         //If it's enabled and ready.
         if (Variables.spells[SpellSlot.Q].IsEnabledAndReady() && ObjectManager.Player.ManaPercent > 30)
         {
             var target = args.Target;
             if (target is Obj_AI_Minion)
             {
                 //If our target is a minion.
                 var tgMinion = target as Obj_AI_Minion;
                 //If there are minions near the one we are AAing and they are at least 3 killable minions.
                 if (GameObjects.EnemyMinions.Count(minion => minion.Distance(tgMinion) < 150 &&
                                                    minion.Health <= (ObjectManager.Player.GetAutoAttackDamage(minion) * 1.1f) * 3) >= 3)
                 {
                     if (!JinxUtility.IsFishBone())
                     {
                         Variables.spells[SpellSlot.Q].Cast();
                     }
                 }
                 else
                 {
                     //Otherwise we go to minigun.
                     if (JinxUtility.IsFishBone())
                     {
                         Variables.spells[SpellSlot.Q].Cast();
                     }
                 }
             }
         }
     }
 }
Exemple #6
0
 internal static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (sender.IsEnemy && sender.IsValidTarget() &&
         sender is Obj_AI_Hero &&
         MenuExtensions.GetItemValue <bool>("iseriesr.jinx.e.ops") &&
         Variables.spells[SpellSlot.E].IsReady())
     {
         if (JinxUtility.GetESpellDict().ContainsKey((sender as Obj_AI_Hero).ChampionName))
         {
             if (args.Slot == JinxUtility.GetESpellDict()[(sender as Obj_AI_Hero).ChampionName])
             {
                 const int ESpeed   = 2000;
                 var       distance = ObjectManager.Player.Distance(sender);
                 //Do the calculations for E speed. If it will reach in time then cast E.
                 if (distance / ESpeed < 0.4f)
                 {
                     Variables.spells[SpellSlot.E].Cast(sender.ServerPosition);
                 }
             }
         }
     }
 }
Exemple #7
0
        public static void HandleELogic()
        {
            var ESpell = Variables.spells[SpellSlot.E];

            if (ESpell.IsEnabledAndReady())
            {
                var meleeEnemiesOnMe =
                    GameObjects.EnemyHeroes.Where(
                        enemy =>
                        enemy.IsMelee &&
                        enemy.Distance(ObjectManager.Player.ServerPosition) < enemy.AttackRange + 65f).ToList();
                var lowHealth = ObjectManager.Player.HealthPercent < 15;

                if (meleeEnemiesOnMe.Any(m => !m.IsRunningAway()) && lowHealth)
                {
                    //There are enemies on me, I am low(ish) health, I cast E on myself to peel them.
                    ESpell.Cast(ObjectManager.Player.ServerPosition);
                }

                var selectedTarget = TargetSelector.GetTarget(Variables.spells[SpellSlot.E].Range * 0.75f, TargetSelector.DamageType.Physical);

                if (selectedTarget.IsValidTarget())
                {
                    //The selected target is valid. Is moving and is not coming towards us while we are facing them.
                    if (selectedTarget.HasBuffOfType(BuffType.Slow) &&
                        selectedTarget.Path.Count() > 1)
                    {
                        //We are facing the target, we have a high"ish" health and the target is coming towards us. No point in using E:
                        if (ObjectManager.Player.IsFacing(selectedTarget) &&
                            ObjectManager.Player.Distance(selectedTarget) >
                            ObjectManager.Player.Distance(selectedTarget.GetPositionInFront(300f)) &&
                            ObjectManager.Player.HealthPercent > 35)
                        {
                            return;
                        }

                        //Target is slowed.
                        var slowEndTime = JinxUtility.GetSlowEndTime(selectedTarget);
                        if (slowEndTime >= ESpell.Delay + 0.5f + Game.Ping / 2f)
                        {
                            ESpell.CastIfHitchanceEquals(selectedTarget, HitChance.VeryHigh);
                        }
                    }
                    else if (JinxUtility.IsHeavilyImpaired(selectedTarget))
                    {
                        //The target is actually impaired heavily. Let's cast E on them.
                        var immobileEndTime = JinxUtility.GetImpairedEndTime(selectedTarget);
                        if (immobileEndTime >= ESpell.Delay + 0.5f + Game.Ping / 2f)
                        {
                            ESpell.CastIfHitchanceEquals(selectedTarget, HitChance.VeryHigh);
                        }
                    }
                    else if (selectedTarget.GetEnemiesInRange(350f).Count() >= 2 &&
                             ESpell.GetPrediction(selectedTarget).Hitchance >= HitChance.High)
                    {
                        //We can almost certainly hit our targets and also at least 2 other targets.
                        var enemiesInRange = selectedTarget.GetEnemiesInRange(350f);
                        if (enemiesInRange.Count(enemy => ESpell.GetPrediction(enemy).Hitchance >= HitChance.High) >= 2)
                        {
                            //Cast E.
                            ESpell.Cast(ESpell.GetPrediction(selectedTarget).CastPosition);
                        }
                    }
                }
            }
        }
Exemple #8
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();
                        }
                    }
                }
            }
        }
Exemple #9
0
        public static void HandleWLogic()
        {
            var defaultHitchance = HitChance.VeryHigh;

            if (Variables.spells[SpellSlot.W].IsEnabledAndReady())
            {
                //If there are 2 or more enemies in our AA range and our health percentage is lower than
                //the average of theirs then don't fire W.
                //We only get heroes with a priority of 2 or higher, as they are more likely to do more damage to us.

                var enemiesAround = ObjectManager.Player.GetEnemiesInRange(JinxUtility.GetMinigunRange(null));


                if (enemiesAround.Any())
                {
                    //If the enemies around have more average health percent then we do * 1.5f (Since we are an ADC and there might be tanks)
                    //among the enemy team members that surround us.
                    //Or their average combo will do more than 60% of our health in damage.
                    var spellsList = new List <SpellSlot>()
                    {
                        SpellSlot.Q,
                        SpellSlot.W,
                        SpellSlot.E,
                        SpellSlot.R
                    };

                    if (enemiesAround.Count() == 1)
                    {
                        var killableEnemy = enemiesAround.FirstOrDefault(k => k.IsValidTarget());
                        if (killableEnemy != null)
                        {
                            //We are lower health than a tankier enemy and enemy is in melee range. Better put some distance before casting W.
                            if (ObjectManager.Player.Health * 1.4f < killableEnemy.Health && killableEnemy.ServerPosition.Distance(ObjectManager.Player.ServerPosition) <= 350f)
                            {
                                return;
                            }

                            var WPrediction = Variables.spells[SpellSlot.W].GetPrediction(killableEnemy);
                            //if there is only 1 target and it is killable by W and we are not about to die then shoot W and pew pew mode.
                            if (WPrediction.Hitchance >= defaultHitchance &&
                                ObjectManager.Player.HealthPercent > 8 &&
                                HealthPrediction.GetHealthPrediction(killableEnemy, 300) > 0 &&
                                HealthPrediction.GetHealthPrediction(killableEnemy, 300) + 5 < Variables.spells[SpellSlot.W].GetDamage(killableEnemy))
                            {
                                Variables.spells[SpellSlot.W].Cast(WPrediction.CastPosition);
                            }
                        }
                    }

                    if (enemiesAround.Count(m => ProrityHelper.GetPriorityFromDb(m.ChampionName) >= 2) > 1
                        &&
                        (ObjectManager.Player.HealthPercent * 1.5f <=
                         enemiesAround.Where(m => ProrityHelper.GetPriorityFromDb(m.ChampionName) >= 2)
                         .Average(m => m.HealthPercent) ||
                         enemiesAround.Average(enemy => enemy.GetComboDamage(ObjectManager.Player, spellsList) + enemy.GetAutoAttackDamage(ObjectManager.Player) * 2f) >= ObjectManager.Player.Health * 0.60f))
                    {
                        return;
                    }

                    //If there are 3 enemies which are not low health, always return.
                    if (enemiesAround.Count(en => en.HealthPercent > 20) > 3)
                    {
                        return;
                    }
                }

                var selectedTarget = TargetSelector.GetTarget(Variables.spells[SpellSlot.W].Range * 0.65f,
                                                              TargetSelector.DamageType.Physical);

                if (selectedTarget.IsValidTarget())
                {
                    //Since we already determined  the conditions for not firing W when enemies are in our AA range
                    //We can now not do any check here and just fire W.
                    var WPrediction = Variables.spells[SpellSlot.W].GetPrediction(selectedTarget);
                    //Cast the spell using prediction.
                    if (WPrediction.Hitchance >= defaultHitchance)
                    {
                        //Don't use W to poke under enemy turret unless the target is killable.
                        if (ObjectManager.Player.UnderTurret(true) &&
                            HealthPrediction.GetHealthPrediction(selectedTarget, 300) + 5 > Variables.spells[SpellSlot.W].GetDamage(selectedTarget))
                        {
                            return;
                        }

                        Variables.spells[SpellSlot.W].Cast(WPrediction.CastPosition);
                    }
                }
            }
        }
Exemple #10
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);
                }
            }
        }