Exemplo n.º 1
0
 public static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (sender.IsMe)
     {
         if (args.Slot == SpellSlot.R)
         {
             if (ComboMenu["UseQulty"].Cast <CheckBox>().CurrentValue&& Q.IsReady())
             {
                 EloBuddy.Player.CastSpell(SpellSlot.Q, Game.CursorPos);
             }
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Check if can cast the spell on the target
 /// </summary>
 /// <param name="target">Target to check</param>
 /// <param name="spell">Any spell</param>
 /// <returns></returns>
 public static bool CanCast(this Obj_AI_Base target, Spell.Ranged spell)
 {
     if (spell != null)
     {
         return(spell.IsReady() && target.IsValidTarget(spell.Range) && target.IsNotNull());
     }
     return(false);
 }
Exemplo n.º 3
0
        private static void Obj_AI_Base_OnSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }
            if (args.SData.IsAutoAttack())
            {
                var target = (Obj_AI_Base)args.Target;

                if (target is AIHeroClient)
                {
                    if (DrawMenu["condemnNextAA"].Cast <KeyBind>().CurrentValue&& E.IsReady())
                    {
                        E.Cast(target);
                        DrawMenu["condemnNextAA"].Cast <KeyBind>().CurrentValue = false;
                    }
                    if (target.IsValidTarget() && Q.IsReady() &&
                        (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) &&
                         ComboMenu["useQCombo"].Cast <CheckBox>().CurrentValue ||
                         Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass) &&
                         HarassMenu["useQHarass"].Cast <CheckBox>().CurrentValue))
                    {
                        var pos = (_Player.Position.Extend(Game.CursorPos, 300).Distance(target) <=
                                   _Player.GetAutoAttackRange(target) &&
                                   _Player.Position.Extend(Game.CursorPos, 300).Distance(target) > 100
                            ? Game.CursorPos
                            : (_Player.Position.Extend(target.Position, 300).Distance(target) < 100)
                                ? target.Position
                                : new Vector3());

                        if (pos.IsValid())
                        {
                            Player.CastSpell(SpellSlot.Q, pos);
                        }
                    }

                    if (ComboMenu["useQKite"].Cast <CheckBox>().CurrentValue&&
                        EntityManager.Heroes.Enemies.Any(
                            a => a.IsMelee && a.Distance(Player.Instance) < a.GetAutoAttackRange(Player.Instance)))
                    {
                        Player.CastSpell(SpellSlot.Q,
                                         target.Position.Extend(Player.Instance.Position,
                                                                target.Position.Distance(Player.Instance) + 300).To3D());
                    }
                }

                if ((Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit) && FarmMenu["useQLastHit"].Cast <CheckBox>().CurrentValue || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) && FarmMenu["useQWaveClear"].Cast <CheckBox>().CurrentValue) && Q.IsReady())
                {
                    var source =
                        EntityManager.MinionsAndMonsters.EnemyMinions
                        .Where(
                            a => a.NetworkId != target.NetworkId && a.Distance(Player.Instance) < 300 + Player.Instance.GetAutoAttackRange(a) &&
                            Prediction.Health.GetPrediction(a, (int)Player.Instance.AttackDelay) < Player.Instance.GetAutoAttackDamage(a, true) + Damages.QDamage(a))
                        .OrderBy(a => a.Health)
                        .FirstOrDefault();

                    if (source == null || Player.Instance.Position.Extend(Game.CursorPos, 300).Distance(source) >
                        Player.Instance.GetAutoAttackRange(source) &&
                        FarmMenu["onlyTumbleToCursor"].Cast <CheckBox>().CurrentValue)
                    {
                        return;
                    }
                    Orbwalker.ForcedTarget = source;
                    Player.CastSpell(SpellSlot.Q, Player.Instance.Position.Extend(Game.CursorPos, 300).Distance(source) <= Player.Instance.GetAutoAttackRange(source) ? Game.CursorPos : source.Position);
                }
            }
        }
Exemplo n.º 4
0
        public static void OnDraw(EventArgs args)
        {
            if (Misc.isChecked(DrawMenu, "drawDisable"))
            {
                return;
            }

            if (Misc.isChecked(DrawMenu, "drawAARange"))
            {
                new Circle()
                {
                    Color = Color.Cyan, Radius = _Player.GetAutoAttackRange(), BorderWidth = 2f
                }.Draw(_Player.Position);
                if (Misc.isChecked(DrawMenu, "drawNameLine"))
                {
                    Drawing.DrawText(Drawing.WorldToScreen(_Player.Position) - new Vector2(_Player.GetAutoAttackRange() - 250, 0), Color.Cyan, "Auto Attack", 15);
                }
            }

            if (Misc.isChecked(DrawMenu, "drawQ") && Q.IsReady())
            {
                new Circle()
                {
                    Color = Color.White, Radius = Q.Range, BorderWidth = 2f
                }.Draw(_Player.Position);
                if (Misc.isChecked(DrawMenu, "drawNameLine"))
                {
                    Drawing.DrawText(Drawing.WorldToScreen(_Player.Position) - new Vector2(Q.Range - 100, 0), Color.White, "Q Range", 15);
                }
            }

            if (Misc.isChecked(DrawMenu, "drawE") && E.IsReady())
            {
                new Circle()
                {
                    Color = Color.White, Radius = E.Range, BorderWidth = 2f
                }.Draw(_Player.Position);
                if (Misc.isChecked(DrawMenu, "drawNameLine"))
                {
                    Drawing.DrawText(Drawing.WorldToScreen(_Player.Position) - new Vector2(E.Range - 290, -50), Color.White, "E Range", 15);
                }
            }

            if (Misc.isChecked(DrawMenu, "drawCondemnPos") && E.IsReady())
            {
                foreach (var enemy in ObjectManager.Get <AIHeroClient>().Where(a => a.IsEnemy).Where(a => !a.IsDead).Where(a => _Player.Distance(a) <= E.Range))
                {
                    if (Misc.isChecked(CondemnMenu, "dnCondemn" + enemy.ChampionName.ToLower()))
                    {
                        return;
                    }

                    var condemnPos = _Player.Position.Extend(enemy.Position, _Player.Distance(enemy) + 470 - Misc.getSliderValue(CondemnMenu, "condenmErrorMargin"));

                    var realStart = Drawing.WorldToScreen(enemy.Position);
                    var realEnd   = Drawing.WorldToScreen(condemnPos.To3D());

                    Drawing.DrawLine(realStart, realEnd, 2f, Color.Red);
                    new Circle()
                    {
                        Color = Color.Red, Radius = 60, BorderWidth = 2f
                    }.Draw(condemnPos.To3D());
                }
            }

            if (Misc.isChecked(DrawMenu, "drawTumblePos"))
            {
                Misc.Drawing_OnDraw();
            }
        }