Example #1
0
        internal static int QWorth(Obj_AI_Base target)
        {
            var pred1 = MySpells.Q.GetPrediction(target);

            if (pred1.Hitchance < HitChance.Medium || (Calculation.isPoisonned(target) && target.ObjectType != GameObjectType.obj_AI_Minion))
            {
                return(-1);
            }

            int worth = 0;

            foreach (var enemy2 in ObjectManager.Get <Obj_AI_Base>().Where(a => a.IsValidTarget(MySpells.Q.Range, true) && a.IsInRange(pred1.CastPosition, 150)))
            {
                if (enemy2 == TargetSelector.GetTarget(MySpells.Q.Range + 100))
                {
                    worth += 3;
                }

                if (!Calculation.isPoisonned(enemy2) && enemy2.ObjectType != GameObjectType.obj_AI_Minion)
                {
                    worth += 2;
                }

                if (enemy2.ObjectType == GameObjectType.obj_AI_Minion)
                {
                    if (enemy2.Health > MySpells.E.GetDamage(enemy2) + Cassio.Player.GetAutoAttackDamage(enemy2))
                    {
                        worth += 1;
                    }
                }
                else if (enemy2.ObjectType == GameObjectType.AIHeroClient)
                {
                    worth += 5;
                }
            }
            return(worth);
        }
Example #2
0
        public static void Wlogic()
        {
            if (!W.IsReady())
            {
                return;
            }
            var enemies = ObjectManager.Get <AIHeroClient>().Where(t => t.IsValidTarget(0.8f * W.Range, true) && t.Distance(Cassio.Player) > 500);

            if (enemies.Count() == 0)
            {
                return;
            }
            foreach (var enemy in enemies)
            {
                var Wpred = W.GetPrediction(enemy);
                if (Wpred.Hitchance < HitChance.Medium)
                {
                    continue;
                }

                if ((enemy.IsStunned || enemy.IsRooted || enemy.IsCharmed) ||
                    (!enemy.IsMoving && !Calculation.isPoisonned(enemy) && Cassio.Player.Spellbook.GetSpell(HesaEngine.SDK.Enums.SpellSlot.Q).CooldownExpires - Game.Time <= 2.75) &&
                    enemy.IsFacing(Cassio.Player))
                {
                    W.Cast(enemy);
                    return;
                }
            }

            var WBestPred = W.GetCircularFarmLocation(enemies as List <Obj_AI_Base>);

            if (WBestPred.MinionsHit >= 3)
            {
                W.Cast(WBestPred.Position);
            }
        }
Example #3
0
        public static void Elogic(bool OnlyChamp = false, bool Onlypoison = false, bool Pushing = false)
        {
            if (!E.IsReady())
            {
                return;
            }
            var TStarget = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);

            Obj_AI_Base[] enemies;

            enemies = ObjectManager.Get <AIHeroClient>().Where(a => a.IsValidTarget(E.Range, true)).ToArray();
            if (!OnlyChamp)
            {
                enemies = enemies.Concat(ObjectManager.Get <Obj_AI_Minion>().Where(a => a.IsValidTarget(E.Range, true))).ToArray();
            }

            if (enemies.Count() == 0)
            {
                return;
            }
            List <int> worthCasting = new List <int>();

            int worth;

            foreach (var enemy in enemies)
            {
                if (Onlypoison && !Calculation.isPoisonned(enemy)) // TODO : proper cd check (opt) ( Q ready && pushing )
                {
                    worthCasting.Add(0);
                    continue;
                }
                worth = 0;
                if (enemy.ObjectType == GameObjectType.AIHeroClient)
                {
                    worth += 2;
                }
                else
                {
                    if (enemy.Health < E.GetDamage(enemy) || (Pushing && Calculation.isPoisonned(enemy)))
                    {
                        worth += 1;
                    }
                }
                if (enemy == TStarget)
                {
                    worth += 1;
                }
                worthCasting.Add(worth);
            }
            int i = 0;

            if (worthCasting.Max() == 0)
            {
                return;
            }
            foreach (var enemy in enemies)
            {
                if (worthCasting[i] == worthCasting.Max())
                {
                    E.Cast(enemy);
                }
                i += 1;
            }
        }