Beispiel #1
0
 private static void OnDraw(EventArgs args)
 {
     if (DebugDrawings)
     {
         var front =
             EntityManager.Heroes.Enemies.Where(e => !e.IsDead && e.IsVisible && e.IsValid && e.IsHPBarRendered);
         foreach (var f in front)
         {
             var       relPos    = f.Position.Shorten(Player.Instance.Position, -300);
             ColorBGRA drawColor = f.Health <= Computed.ComboDmg(f) * Spells.ComboDmgMod
                                       ? Color.OrangeRed
                                       : Color.Yellow;
             Circle.Draw(drawColor, 100, relPos);
             Drawing.DrawText(Drawing.WorldToScreen(relPos), System.Drawing.Color.AliceBlue, f.Name, 2);
             if (f.IsFacing(Player.Instance))
             {
                 Drawing.DrawText(Drawing.WorldToScreen(f.Position), System.Drawing.Color.OrangeRed, "Facing", 3);
             }
         }
     }
 }
Beispiel #2
0
        public static void Combo()
        {
            var target = TargetSelector.GetTarget(Spells.R.Range + 250, DamageType.Magical);

            if (target == null)
            {
                return;
            }

            if (Config.IsChecked(Config.Combo, "useRInCombo") && Spells.R.IsReady())
            {
                var enemiesAroundTarget =
                    EntityManager.Heroes.Enemies.Count(
                        en => en.Distance(target.Position) <= 1000 && en.Name != target.Name);
                if (Config.IsChecked(Config.Combo, "comboFlashR") && target.IsFacing(Player.Instance) &&
                    (target.Distance(Player.Instance) > Spells.R.Range &&
                     target.Distance(Player.Instance) <= Spells.R.Range + 400) &&
                    (Spells.Flash != null && Spells.Flash.IsReady) &&
                    Computed.ComboDmg(target) * Spells.ComboDmgMod > target.Health &&
                    enemiesAroundTarget <= Config.GetSliderValue(Config.Combo, "maxEnFlash"))
                {
                    Spells.FlashR = true;
                    var relPos = target.Position.Shorten(Player.Instance.Position, -300);
                    Spells.R.Cast(relPos);
                    Core.DelayAction(
                        () => Player.CastSpell(Spells.Flash.Slot, target.Position),
                        Mainframe.RDelay.Next(300, 400));
                }

                var countFace =
                    EntityManager.Heroes.Enemies.Count(
                        h => h.IsValidTarget(Spells.R.Range) && h.IsFacing(Player.Instance));
                if (countFace >= Config.GetSliderValue(Config.Combo, "comboMinR") &&
                    target.IsValidTarget(Spells.R.Range))
                {
                    Spells.R.Cast(target);
                }
            }

            if (Config.IsChecked(Config.Combo, "useQInCombo") && Spells.Q.IsReady() &&
                !target.HasBuffOfType(BuffType.Poison))
            {
                var qPred = Spells.Q.GetPrediction(target);
                if (qPred.HitChancePercent >= 85)
                {
                    Spells.Q.Cast(qPred.CastPosition);
                }
            }

            if (Config.IsChecked(Config.Combo, "useWInCombo") && Spells.W.IsReady() &&
                target.IsValidTarget(Spells.W.Range))
            {
                if (Config.IsChecked(Config.Combo, "comboWonlyCD"))
                {
                    if (!Spells.Q.IsReady() && (Spells.QCasted - Game.Time) < -0.5f &&
                        !target.HasBuffOfType(BuffType.Poison))
                    {
                        var wPred = Spells.W.GetPrediction(target);
                        if (wPred.CastPosition.Distance(Player.Instance.Position) >= Spells.WMinRange &&
                            wPred.HitChancePercent >= 85)
                        {
                            Spells.W.Cast(wPred.CastPosition);
                        }
                    }
                }
                else
                {
                    var wPred = Spells.W.GetPrediction(target);
                    if (wPred.CastPosition.Distance(Player.Instance.Position) >= Spells.WMinRange &&
                        !wPred.CastPosition.IsWall() && wPred.HitChancePercent >= 85)
                    {
                        Spells.W.Cast(wPred.CastPosition);
                    }
                }
            }

            if (Config.IsChecked(Config.Combo, "useEInCombo") && Spells.E.IsReady() &&
                target.IsValidTarget(Spells.E.Range) &&
                (!Config.IsChecked(Config.Combo, "comboEonP") || target.HasBuffOfType(BuffType.Poison)))
            {
                if (Config.IsChecked(Config.Combo, "humanEInCombo"))
                {
                    var delay = Computed.RandomDelay(Config.GetSliderValue(Config.Misc, "humanDelay"));
                    Core.DelayAction(() => Spells.E.Cast(target), delay);
                }
                else
                {
                    Spells.E.Cast(target);
                }
            }
        }