Beispiel #1
0
        private void ObjAiBaseOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsAlly && !sender.IsMe && !sender.IsMinion)
            {
                foreach (Obj_AI_Hero enemy in ObjectManager.Get <Obj_AI_Hero>().Where(hero => hero != null && hero.IsValid && hero.IsVisible && !hero.IsDead && hero.IsEnemy))
                {
                    if (enemy.Distance(V2E(args.Start, args.End, enemy.Distance(sender.Position))) <=
                        (200))
                    {
                        Allydamage = sender.GetDamageSpell(enemy, args.SData.Name);

                        if ((Config.Item("SKSQ").GetValue <bool>()))
                        {
                            Mydamage = Player.GetDamageSpell(enemy, SpellSlot.Q);
                            if ((enemy.Distance(Player) <= _Q.Range) && (Allydamage.CalculatedDamage + Mydamage.CalculatedDamage) > enemy.Health &&
                                Allydamage.CalculatedDamage < enemy.Health)
                            {
                                Game.PrintChat("enemy health: " + enemy.Health + " Total damage : " + (Allydamage.CalculatedDamage + Mydamage.CalculatedDamage) + "health after : " + (enemy.Health - (Allydamage.CalculatedDamage + Mydamage.CalculatedDamage)) + " " + args.SData.Name);
                                var output = Prediction.GetPrediction(enemy, _Q.Delay, _Q.Width, _Q.Speed);
                                _Q.Cast(output.UnitPosition, true);
                            }
                        }

                        if ((Config.Item("SKSW").GetValue <bool>()))
                        {
                            Mydamage = Player.GetDamageSpell(enemy, SpellSlot.W);

                            if ((enemy.Distance(Player) <= _W.Range) && (Allydamage.CalculatedDamage + Mydamage.CalculatedDamage) > enemy.Health &&
                                Allydamage.CalculatedDamage < enemy.Health)
                            {
                                var output = Prediction.GetPrediction(enemy, _W.Delay, _W.Width, _W.Speed);
                                _W.Cast(output.UnitPosition, true);
                            }
                        }

                        if ((Config.Item("SKSE").GetValue <bool>()))
                        {
                            Mydamage = Player.GetDamageSpell(enemy, SpellSlot.E);

                            if ((enemy.Distance(Player) <= _E.Range) && (Allydamage.CalculatedDamage + Mydamage.CalculatedDamage) > enemy.Health &&
                                Allydamage.CalculatedDamage < enemy.Health)
                            {
                                var output = Prediction.GetPrediction(enemy, _E.Delay, _E.Width, _E.Speed);
                                _E.Cast(output.UnitPosition, true);
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private static void LaneClear()
        {
            if (!Q.IsReady())
            {
                return;
            }
            var unit =
                ObjectManager.Get <Obj_AI_Minion>()
                .First(
                    minion =>
                    minion.IsValid && minion.IsVisible && !minion.IsDead &&
                    minion.IsValidTarget(Q.Range, true, Player.ServerPosition) &&
                    minion.Health < Player.GetDamageSpell(minion, SpellSlot.Q).CalculatedDamage);

            CastQ(unit, "LaneClear");
        }
        private static void LaneClear()
        {
            if (!Q.IsReady())
            {
                return;
            }

            var unit =
                ObjectManager.Get <Obj_AI_Minion>()
                .First(
                    minion =>
                    minion.IsValidTarget(minion.HasBuff("urgotcorrosivedebuff", true) ? Q2.Range : Q.Range) &&
                    minion.Health < Player.GetDamageSpell(minion, SpellSlot.Q).CalculatedDamage);

            if (unit != null)
            {
                CastQ(unit, "LaneClear");
            }
        }
Beispiel #4
0
        public void ObjAiBaseOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            var spellData = SpellDatabase.GetByName(args.SData.Name);

            if (sender.IsAlly && !sender.IsMinion && !sender.IsAutoAttacking && !sender.IsMe)
            {
                string[] spelllist = { "EzrealTrueshotBarrage", "LuxMaliceCannon",     "UFSlash",                   "InfernalGuardian",     "EnchantedCrystalArrow", "DravenRCast",                "FizzMarinerDoom", "GravesChargeShot",
                                       "LeonaSolarFlare",       "RivenFengShuiEngine", "SejuaniGlacialPrisonStart", "shyvanatransformcast", "SonaCrescendo",         "XerathArcaneBarrageWrapper", "ZiggsR",
                                       "CaitlynAceintheHole",   "JinxRWrapper" };

                for (int i = 0; i <= spelllist.Length; i++)
                {
                    if (args.SData.Name == spelllist[i])
                    {
                        //var spellData = SpellDatabase.GetByName(args.SData.Name);

                        if (spellData.ChampionName == "Caitlyn")
                        {
                            var diab = (Obj_AI_Base)args.Target;
                            Allydamage = sender.GetDamageSpell(diab, args.SData.Name);
                            Mydamage   = Player.GetDamageSpell(diab, SpellSlot.R);

                            if (Config.Item("Killable").GetValue <bool>())
                            {
                                if ((Mydamage.CalculatedDamage + Allydamage.CalculatedDamage) < diab.Health || Allydamage.CalculatedDamage > diab.Health)
                                {
                                    return;
                                }
                            }
                            Game.PrintChat("Spell Detected: " + args.SData.Name + " By: " + sender.BaseSkinName +
                                           " Ally Casted it On : " + diab.BaseSkinName); //Checks..
                            if (diab.Distance(Player.Position) < 3200 && diab.Distance(Player.Position) <= R.Range)
                            {
                                if (R.IsSkillshot)
                                {
                                    R.Cast(diab, true);
                                }
                                else
                                {
                                    R.CastOnUnit(diab, true);
                                }
                            }
                        }
                        else
                        {
                            foreach (Obj_AI_Hero enemy in ObjectManager.Get <Obj_AI_Hero>().Where(hero => hero != null && hero.IsValid && hero.IsVisible && !hero.IsDead && hero.IsEnemy))
                            {
                                //   PredictionOutput allyOutput = Prediction.GetPrediction(enemy, 500, args.SData.LineWidth, args.SData.MissileSpeed);

                                /*
                                 * Game.PrintChat(sender.BaseSkinName + " Ultimate Damage is : " + Allydamage.CalculatedDamage);
                                 * Game.PrintChat("My Ultimate Damage is : " + Mydamage.CalculatedDamage);
                                 * Game.PrintChat("Total damage is : " + (Allydamage.CalculatedDamage + Mydamage.CalculatedDamage));
                                 */


                                if (Config.Item("Killable").GetValue <bool>())
                                {
                                    Allydamage = sender.GetDamageSpell(enemy, args.SData.Name);
                                    Mydamage   = Player.GetDamageSpell(enemy, SpellSlot.R);

                                    if ((Allydamage.CalculatedDamage + Mydamage.CalculatedDamage) < enemy.Health && Allydamage.CalculatedDamage > enemy.Health)
                                    {
                                        return;
                                    }
                                }

                                if (enemy.Distance(V2E(args.Start, args.End, enemy.Distance(sender.Position))) <= (spellData.Radius - 50))
                                {
                                    Game.PrintChat("SkillShot Detected: " + args.SData.Name + " By: " + sender.BaseSkinName +
                                                   " Ally Casted it right.. On : " + enemy.BaseSkinName);     //Checks..
                                    if (enemy.Distance(Player.Position) < 3200 && enemy.Distance(Player.Position) <= R.Range)
                                    {
                                        if (Player.BaseSkinName == "Riven")
                                        {
                                            R.Cast(false);
                                        }
                                        if (!R.IsSkillshot) // Casting for targetable spells
                                        {
                                            R.CastOnUnit(enemy, true);
                                        }
                                        else
                                        {
                                            R.Cast(enemy, true);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #5
0
        //todo:Add KillSteal

        static void Killsteal()
        {
            if (Config.KillStealR && EkkoUlt != null)
            {
                if (EkkoUlt != null)
                {
                    foreach (var hero in ObjectManager.Get <Obj_AI_Hero>())
                    {
                        if (hero.IsEnemy && hero.Distance(EkkoUlt.Position) < SpellManager.R.Range && hero.Health <= Rdamage() && hero.IsValidTarget() && !hero.IsDead)
                        {
                            SpellManager.R.Cast();
                        }
                    }
                }
            }
            if (Config.KillStealQ)
            {
                foreach (var hero in ObjectManager.Get <Obj_AI_Hero>())
                {
                    if (hero.IsEnemy && hero.Distance(Player) < 800 && hero.Health <= Player.GetDamageSpell(hero, SpellSlot.Q).CalculatedDamage)
                    {
                        SpellManager.Q.Cast();
                    }
                }
            }

            if (Config.KillStealE)
            {
                foreach (var hero in ObjectManager.Get <Obj_AI_Hero>())
                {
                    var damage = 20 + 30 * SpellManager.E.Level + 0.2 * Player.TotalMagicalDamage();
                    if (hero.GetBuffCount("EkkoStacks") == 2)
                    {
                        damage += 10 + 10 * Player.Level + 0.7 * Player.TotalMagicalDamage;
                    }

                    if (hero.IsEnemy && hero.Distance(Player) <= 700 && hero.Health <= Player.CalcDamage(hero, Damage.DamageType.Magical, damage))
                    {
                        SpellManager.CastE(hero);
                    }
                }
            }
        }
Beispiel #6
0
        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            PredictionInput input = null;

            if (sender.IsMe || sender.IsEnemy || !(sender is Obj_AI_Hero))
            {
                return;
            }
            if (!Spells.Contains(args.SData.Name) || Config.SubMenu("AutoCombo_Spells").Item(args.SData.Name).GetValue <bool>() == false)
            {
                return;
            }
            var targetable = false;
            var line       = false;
            var aoe        = false;

            drawTime = Game.Time;

            var result = SpellDatabase.GetByName(args.SData.Name);

            if (result != null)
            {
                switch (result.Type)
                {
                case SkillShotType.SkillshotLine:
                    _skillshot = new Geometry.Polygon.Rectangle(sender.Position, sender.Position.Extend(args.End, result.Range), result.Radius);
                    line       = true;
                    break;

                case SkillShotType.SkillshotMissileLine:
                    _skillshot = new Geometry.Polygon.Rectangle(sender.Position, sender.Position.Extend(args.End, result.Range), result.Radius);
                    line       = true;
                    break;

                case SkillShotType.SkillshotCircle:
                    _skillshotAoe = new Geometry.Polygon.Circle(args.End, result.Radius);
                    aoe           = true;
                    break;

                case SkillShotType.SkillshotRing:
                    _skillshotAoe = new Geometry.Polygon.Circle(args.End, result.Radius);
                    aoe           = true;
                    break;
                }
            }

            foreach (
                var enemy in
                ObjectManager.Get <Obj_AI_Hero>()
                .Where(enemy => enemy.IsEnemy && enemy.Distance(Player) <= Config.SubMenu("AutoCombo").Item("Range").GetValue <Slider>().Value))
            {
                if (!aoe && !line && args.Target.Position == enemy.Position)
                {
                    targetable = true;
                }
                if (!aoe && !line && !targetable)
                {
                    continue;
                }
                //Game.PrintChat(sender.BaseSkinName + " Ultimate Damage is : " + Allydamage.CalculatedDamage);
                //Game.PrintChat("My Ultimate Damage is : " + Mydamage.CalculatedDamage);
                //Game.PrintChat("Total damage is : " + (Allydamage.CalculatedDamage + Mydamage.CalculatedDamage));

                if (Config.Item("Killable").GetValue <bool>())
                {
                    Allydamage = sender.GetDamageSpell(enemy, args.SData.Name);
                    Mydamage   = Player.GetDamageSpell(enemy, SpellSlot.R);

                    if ((Allydamage.CalculatedDamage + Mydamage.CalculatedDamage) < enemy.Health &&
                        Allydamage.CalculatedDamage > enemy.Health)
                    {
                        return;
                    }
                }

                if (line)
                {
                    input = new PredictionInput
                    {
                        Unit      = enemy,
                        Type      = SkillshotType.SkillshotLine,
                        Speed     = result.MissileSpeed,
                        From      = sender.Position,
                        Delay     = result.Delay,
                        Aoe       = false,
                        Radius    = result.Radius,
                        Range     = result.Range,
                        Collision = false
                    };
                }
                else
                {
                    if (aoe)
                    {
                        input = new PredictionInput
                        {
                            Unit      = enemy,
                            Type      = SkillshotType.SkillshotCircle,
                            Speed     = result.MissileSpeed,
                            From      = sender.Position,
                            Delay     = result.Delay,
                            Aoe       = true,
                            Radius    = result.Radius,
                            Range     = result.Range,
                            Collision = false
                        };
                    }
                }
                if (!targetable)
                {
                    var output = Prediction.GetPrediction(input);
                    var unit   = output.CastPosition;
                    if (line)
                    {
                        if (!_skillshot.IsInside(unit) && !_skillshot.IsInside(enemy))
                        {
                            continue;
                        }
                    }
                    else
                    {
                        if (!_skillshotAoe.IsInside(unit) && !_skillshotAoe.IsInside(enemy))
                        {
                            continue;
                        }
                    }
                }

                R.Cast(enemy.Position);
                if (enemy.Distance(Player.Position) <= Config.SubMenu("AutoCombo").Item("Range").GetValue <Slider>().Value)
                {
                    R.Cast(enemy);
                    R.CastOnUnit(enemy);
                }
            }
        }