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 double GetEDamageToMinion(Obj_AI_Base minion)
        {
            // Workaround cause DamageLib does not have the correct values for Cassio
            var damageSpell = new DamageSpell { Slot = SpellSlot.E, DamageType = LeagueSharp.Common.Damage.DamageType.Magical, Damage = (source, target, level) => new double[] { 45, 85, 120, 155, 190 }[level] + (0.55 * source.FlatMagicDamageMod) };
            var rawDamage = damageSpell.Damage(Player, minion, Math.Max(1, Math.Min(Player.Spellbook.GetSpell(SpellSlot.Q).Level - 1, 6)));

            return CalcMagicDamage(Player, minion, rawDamage);
        }
Beispiel #3
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);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }