コード例 #1
0
ファイル: Program.cs プロジェクト: wade1990/PortAIO
        public static void AutoKs()
        {
            var UseQEKS = Menu.Item("UseQEKS").GetValue <bool>();
            var UseWKS  = Menu.Item("UseWKS").GetValue <bool>();
            var UseQKS  = Menu.Item("UseQKS").GetValue <bool>();
            var UseEKS  = Menu.Item("UseEKS").GetValue <bool>();
            var UseRKS  = Menu.Item("UseRKS").GetValue <bool>();

            foreach (
                var enemy in
                ObjectManager.Get <AIHeroClient>().Where(enemy => enemy.Team != Player.Team).Where(enemy =>
                                                                                                   !enemy.HasBuff("UndyingRage") && !enemy.HasBuff("JudicatorIntervention") &&
                                                                                                   enemy.IsValidTarget(Spells.QE.Range) && Environment.TickCount - Spells.FlashLastCast > 650 + Game.Ping)
                )
            {
                // Use QE KS
                if (GetDamage.GetComboDamage(enemy, UseQEKS, false, UseQEKS, false) >
                    enemy.Health && Player.Distance(enemy, true) <= Math.Pow(Spells.QE.Range, 2))
                {
                    Spells.UseSpells(false, false, false, false, UseQEKS);
                    PlaySound.PlatSounds();
                    //Chat.Print("QEKS " + enemy.Name);
                }
                //Use W KS
                else if (GetDamage.GetComboDamage(enemy, false, UseWKS, false, false) > enemy.Health &&
                         Player.Distance(enemy, true) <= Math.Pow(Spells.W.Range, 2))
                {
                    Spells.UseSpells(false, UseWKS, false, false, false);
                    PlaySound.PlatSounds();
                    //Chat.Print("WKS " + enemy.Name);
                }
                //Use Q E KS
                else if (GetDamage.GetComboDamage(enemy, UseQKS, false, UseEKS, false) > enemy.Health &&
                         Player.Distance(enemy, true) <= Math.Pow(Spells.Q.Range + 25f, 2))
                {
                    Spells.UseSpells(UseQKS, false, UseEKS, false, false);
                    PlaySound.PlatSounds();
                    //Chat.Print("QEKSC " + enemy.Name);
                }
                //Use QWER QE KS
                else if (GetDamage.GetComboDamage(enemy, UseQKS, UseWKS, UseEKS, UseRKS) > enemy.Health &&
                         Player.Distance(enemy, true) <= Math.Pow(Spells.R.Range, 2))
                {
                    Spells.UseSpells(UseQKS, UseWKS, UseEKS, UseRKS, UseQEKS);
                    PlaySound.PlatSounds();
                    //Chat.Print("QWERKS " + enemy.Name);
                }

                // Why ?

/*                else if (
 *                  (GetComboDamage(
 *                      enemy, false, false, Menu.Item("UseEKS").GetValue<bool>(),
 *                      Menu.Item("UseRKS").GetValue<bool>()) > enemy.Health ||
 *                   GetComboDamage(
 *                       enemy, false, Menu.Item("UseWKS").GetValue<bool>(),
 *                       Menu.Item("UseEKS").GetValue<bool>(), false) > enemy.Health) &&
 *                  Player.Distance(enemy, true) <= Math.Pow(QE.Range, 2))
 *              {
 *                  UseSpells(
 *                      false, //Q
 *                      false, //W
 *                      false, //E
 *                      false, //R
 *                      Menu.Item("UseQEKS").GetValue<bool>() //QE
 *                      );
 *                  PlaySound();
 *                  //Chat.Print("QEKS " + enemy.Name);
 *              }*/


                //Flash Kill
                var useFlash = Menu.Item("FKT" + enemy.BaseSkinName) != null &&
                               Menu.Item("FKT" + enemy.BaseSkinName).GetValue <bool>();
                var useR = Menu.Item("DontR" + enemy.BaseSkinName) != null &&
                           Menu.Item("DontR" + enemy.BaseSkinName).GetValue <bool>() == false;
                var rflash = GetDamage.GetComboDamage(enemy, UseQKS, false, UseEKS, false) < enemy.Health;
                var ePos   = Spells.R.GetPrediction(enemy);


                if ((Spells.FlashSlot == SpellSlot.Unknown && ObjectManager.Player.Spellbook.CanUseSpell(Spells.FlashSlot) != SpellState.Ready) ||
                    !useFlash || !(Player.Distance(ePos.UnitPosition, true) <= Math.Pow(Spells.Q.Range + 25f + 395, 2)) ||
                    !(Player.Distance(ePos.UnitPosition, true) > Math.Pow(Spells.Q.Range + 25f + 200, 2)))
                {
                    continue;
                }
                if (
                    (!(GetDamage.GetComboDamage(enemy, UseQKS, false, UseEKS, false) > enemy.Health) ||
                     !Menu.Item("UseFK1").GetValue <bool>()) &&
                    (!(GetDamage.GetComboDamage(enemy, false, false, false, UseRKS) > enemy.Health) ||
                     !Menu.Item("UseFK2").GetValue <bool>() ||
                     !(Player.Distance(ePos.UnitPosition, true) <= Math.Pow(Spells.R.Range + 390, 2)) ||
                     Environment.TickCount - Spells.R.LastCastAttemptT <= Game.Ping + 750 ||
                     Environment.TickCount - Spells.QE.LastCastAttemptT <= Game.Ping + 750 ||
                     !(Player.Distance(ePos.UnitPosition, true) > Math.Pow(Spells.R.Range + 200, 2))))
                {
                    continue;
                }
                var totmana = 0d;
                if (Menu.Item("FKMANA").GetValue <bool>())
                {
                    totmana = Spells.SpellList.Aggregate(
                        totmana, (current, spell) => current + ObjectManager.Player.Spellbook.GetSpell(spell.Slot).SData.Mana);
                }
                if (totmana > Player.Mana && Menu.Item("FKMANA").GetValue <bool>() &&
                    Menu.Item("FKMANA").GetValue <bool>())
                {
                    continue;
                }
                var nearbyE = ePos.UnitPosition.CountEnemiesInRange(1000);
                if (nearbyE > Menu.Item("MaxE").GetValue <Slider>().Value)
                {
                    continue;
                }
                var flashPos = Player.ServerPosition -
                               Vector3.Normalize(Player.ServerPosition - ePos.UnitPosition) * 400;
                if (flashPos.IsWall())
                {
                    continue;
                }
                if (rflash)
                {
                    if (useR)
                    {
                        //Use Ult after flash if can't be killed by QE
                        ObjectManager.Player.Spellbook.CastSpell(Spells.FlashSlot, flashPos);
                        Spells.UseSpells(false, false, false, UseRKS, false);
                        PlaySound.PlatSounds();
                    }
                }
                else
                {
                    //Q & E after flash
                    ObjectManager.Player.Spellbook.CastSpell(Spells.FlashSlot, flashPos);
                }
                Spells.FlashLastCast = Environment.TickCount;
            }
        }
コード例 #2
0
        public static void UseSpells(bool useQBool, bool useWBool, bool useEBool, bool useRBool, bool useQEBool)
        {
            //Set Target
            var qTarget  = TargetSelector.GetTarget(Spells.Q.Range + 25f, TargetSelector.DamageType.Magical);
            var wTarget  = TargetSelector.GetTarget(Spells.W.Range + Spells.W.Width, TargetSelector.DamageType.Magical);
            var rTarget  = TargetSelector.GetTarget(Spells.R.Range, TargetSelector.DamageType.Magical);
            var qeTarget = TargetSelector.GetTarget(Spells.QE.Range + 150, TargetSelector.DamageType.Magical);

            //Harass Combo Key Override
            if (rTarget != null &&
                (Program.harassKey.GetValue <KeyBind>().Active || Program.laneclearKey.GetValue <KeyBind>().Active) &&
                Program.comboKey.GetValue <KeyBind>().Active&&
                ObjectManager.Player.Distance(rTarget, true) <= Math.Pow(Spells.R.Range, 2) &&
                Utils.BuffCheck(rTarget) && Utils.DetectCollision(rTarget))
            {
                if (Program.Menu.Item("DontR" + rTarget.BaseSkinName) != null &&
                    Program.Menu.Item("DontR" + rTarget.BaseSkinName).GetValue <bool>() == false &&
                    useRBool && GetDamage.overkillcheckv2(rTarget) <= rTarget.Health && ObjectManager.Player.HealthPercent >= 35)
                {
                    Spells.R.CastOnUnit(rTarget);
                    Spells.R.LastCastAttemptT = Environment.TickCount;
                }
            }
            if (Spells.IgniteSlot.IsReady() && qTarget.Health < GetDamage.GetIgniteDamage(qTarget))
            {
                ObjectManager.Player.Spellbook.CastSpell(Spells.IgniteSlot, qTarget);
            }

            if (Spells.R.IsReady())
            {
                //R, Ignite
                foreach (var enemy in
                         ObjectManager.Get <AIHeroClient>()
                         .Where(
                             enemy =>
                             enemy.Team != ObjectManager.Player.Team && enemy.IsValidTarget(Spells.R.Range) && !enemy.IsDead &&
                             Utils.BuffCheck(enemy)))
                {
                    //R
                    var useR = Program.Menu.Item("DontR" + enemy.BaseSkinName).GetValue <bool>() == false && useRBool;
                    var okR  = Program.Menu.Item("okR" + enemy.BaseSkinName).GetValue <Slider>().Value * .01 + 1;
                    if (Utils.DetectCollision(enemy) && useR && ObjectManager.Player.Distance(enemy, true) <= Math.Pow(Spells.R.Range, 2) &&
                        (GetDamage.GetRDamage(enemy)) > enemy.Health * okR &&
                        RCheck(enemy))
                    {
                        if (
                            !(ObjectManager.Player.GetSpellDamage(enemy, SpellSlot.Q) > enemy.Health &&
                              ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).CooldownExpires - Game.Time < 2 &&
                              ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).CooldownExpires - Game.Time >= 0 && enemy.IsStunned) &&
                            Environment.TickCount - Spells.Q.LastCastAttemptT > 500 + Game.Ping &&
                            GetDamage.overkillcheckv2(rTarget) <= rTarget.Health && ObjectManager.Player.HealthPercent >= 35)
                        {
                            Spells.R.CastOnUnit(enemy);
                            Spells.R.LastCastAttemptT = Environment.TickCount;
                        }
                    }
                    //Ignite
                    if (!(ObjectManager.Player.Distance(enemy, true) <= 600 * 600) || !(GetDamage.GetIgniteDamage(enemy) > enemy.Health))
                    {
                        continue;
                    }
                    if (Program.Menu.Item("IgniteALLCD").GetValue <bool>())
                    {
                        if (!Spells.Q.IsReady() && !Spells.W.IsReady() && !Spells.E.IsReady() && !Spells.R.IsReady() &&
                            Environment.TickCount - Spells.R.LastCastAttemptT > Game.Ping + 750 &&
                            Environment.TickCount - Spells.QE.LastCastAttemptT > Game.Ping + 750 &&
                            Environment.TickCount - Spells.W.LastCastAttemptT > Game.Ping + 750)
                        {
                            ObjectManager.Player.Spellbook.CastSpell(Spells.IgniteSlot, enemy);
                        }
                    }
                    else
                    {
                        ObjectManager.Player.Spellbook.CastSpell(Spells.IgniteSlot, enemy);
                    }
                }
            }

            //Use QE
            if (useQEBool && Utils.DetectCollision(qeTarget) && qeTarget != null && Spells.Q.IsReady() &&
                (Spells.E.IsReady() && Spells.E.Level > 0) &&
                ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Q).SData.Mana + ObjectManager.Player.Spellbook.GetSpell(SpellSlot.E).SData.Mana <=
                ObjectManager.Player.Mana)
            {
                Spells.UseQeSpell(qeTarget);
            }

            //Use Q
            else if (useQBool && qTarget != null)
            {
                Spells.UseQSpell(qTarget);
            }

            //Use E
            if (useEBool && Spells.E.IsReady() && Environment.TickCount - Spells.W.LastCastAttemptT > Game.Ping + 150 &&
                Environment.TickCount - QWLastcast > Game.Ping)
            {
                foreach (
                    var enemy in
                    ObjectManager.Get <AIHeroClient>()
                    .Where(enemy => enemy.Team != ObjectManager.Player.Team)
                    .Where(enemy => enemy.IsValidTarget(Spells.E.Range)))
                {
                    if (GetDamage.GetComboDamage(enemy, useQBool, useWBool, useEBool, useRBool) > enemy.Health &&
                        ObjectManager.Player.Distance(enemy, true) <= Math.Pow(Spells.E.Range, 2))
                    {
                        Spells.E.Cast(enemy);
                    }
                    else if (ObjectManager.Player.Distance(enemy, true) <= Math.Pow(Spells.QE.Range, 2))
                    {
                        Spells.UseESpell(enemy);
                    }
                }
            }
            //Use W
            if (useWBool)
            {
                Spells.UseWSpell(qeTarget, wTarget);
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: wade1990/PortAIO
        public static void Game_OnGameUpdate(EventArgs args)
        {
            var ComboKey           = comboKey.GetValue <KeyBind>();
            var HarassKey          = harassKey.GetValue <KeyBind>();
            var HarassToggle       = Menu.Item("HarassActiveT").GetValue <KeyBind>();
            var LaneClearKey       = laneclearKey.GetValue <KeyBind>();
            var FreezeKey          = lanefreezeKey.GetValue <KeyBind>();
            var DontHarassInTurret = Menu.Item("HarassTurret").GetValue <bool>();
            var AutoKSKey          = Menu.Item("AutoKST").GetValue <KeyBind>();

            if (Player.IsDead)
            {
                return;
            }

            Spells.UpdateSpellRange();

            UseQEToMouse();


            //Combo and Harass
            if (ComboKey.Active)
            {
                Combo();
            }
            else if (HarassKey.Active || HarassToggle.Active)
            {
                if (DontHarassInTurret && HarassKey.Active)
                {
                    var turret = ObjectManager.Get <Obj_AI_Turret>().FirstOrDefault(t => t.IsValidTarget(Spells.Q.Range));
                    if (turret == null)
                    {
                        Harass();
                    }
                }
                else
                {
                    Harass();
                }
            }

            //Auto KS
            if (AutoKSKey.Active)
            {
                AutoKs();
            }

            //Farm
            if (ComboKey.Active)
            {
                return;
            }

            if (LaneClearKey.Active || FreezeKey.Active)
            {
                Farm();
            }
            if (LaneClearKey.Active)
            {
                JungleFarm();
            }
        }