Exemplo n.º 1
0
        private void UseSpells(bool useQ, bool useW, bool useE, bool useR, string source)
        {
//            if (source == "Harass" && !ManaManager.HasMana(source))
//                return;

            var range         = E.IsReady() ? E.Range : R.Range;
            var focusSelected = menu.Item("selected", true).GetValue <bool>();

            var target = TargetSelector.GetTarget(range, TargetSelector.DamageType.Magical);

            //     if (target != null)
            //          throw new NotImplementedException() ;
            if (TargetSelector.GetSelectedTarget() != null)
            {
                if (focusSelected && TargetSelector.GetSelectedTarget().Distance(Player.ServerPosition) < range)
                {
                    target = TargetSelector.GetSelectedTarget();
                }
            }

            bool hasMana = ManaManager.FullManaCast();
            bool waitW   = menu.Item("waitW", true).GetValue <bool>();

            var dmg = GetComboDamage(target);

            ItemManager.Target = target;

            //see if killable
            if (dmg > target.Health - 50)
            {
                ItemManager.KillableTarget = true;
            }

            ItemManager.UseTargetted = true;

            if (useW && target != null && Player.Distance(target.Position) <= W.Range && W.IsReady())
            {
                PredictionOutput pred = Prediction.GetPrediction(target, 1.25f);
                if (pred.Hitchance >= HitChance.High && W.IsReady())
                {
                    W.Cast(pred.CastPosition);
                }
            }

            if (useE && target != null && E.IsReady() && Player.Distance(target.Position) < E.Range)
            {
                if (!waitW || W.IsReady())
                {
                    CastE(target);
                    return;
                }
            }

            if (useQ && Q.IsReady() && Player.Distance(target.Position) <= Q.Range)
            {
                Notifications.AddNotification("sdgdfgdsgsdfg", 100);
                Q.CastOnUnit(target);
            }

            //R
            if (target != null && R.IsReady())
            {
                useR = rTarget(target) && useR;
                if (useR)
                {
                    CastR(target, dmg);
                }
            }
        }