예제 #1
0
파일: Program.cs 프로젝트: Dekryptor/Port-1
        public static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            {
                //Last cast time of spells
                if (sender.IsMe)
                {
                    if (args.SData.Name == "SyndraQ")
                    {
                        Spells.Q.LastCastAttemptT = Environment.TickCount;
                    }
                    if (args.SData.Name == "SyndraW" || args.SData.Name == "syndrawcast")
                    {
                        Spells.W.LastCastAttemptT = Environment.TickCount;
                    }
                    if (args.SData.Name == "SyndraE" || args.SData.Name == "syndrae5")
                    {
                        Spells.E.LastCastAttemptT = Environment.TickCount;
                    }
                }

                //Harass when enemy do attack
                if (Menu.Item("HarassAAQ").GetValue <bool>() && sender.Type == Player.Type && sender.Team != Player.Team &&
                    args.SData.Name.ToLower().Contains("attack") &&
                    Player.Distance(sender, true) <= Math.Pow(Spells.Q.Range, 2) &&
                    Player.Mana / Player.MaxMana * 100 > Menu.Item("HarassMana").GetValue <Slider>().Value)
                {
                    Spells.UseQSpell((AIHeroClient)sender);
                }
                if (!sender.IsValid || sender.Team == ObjectManager.Player.Team || args.SData.Name != "YasuoWMovingWall")
                {
                    return;
                }
                Utils._wallCastT          = Environment.TickCount;
                Utils._yasuoWallCastedPos = sender.ServerPosition.To2D();
            }
        }
예제 #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);
            }
        }