Example #1
0
        public void Harass()
        {
            List <Obj_AI_Base> shadows = GetShadows();

            if (!shadows.Any() ||
                (!q.UseOnHarass && !e.UseOnHarass) ||
                (!q.IsReady() && !e.IsReady()))
            {
                return;
            }

            List <Obj_AI_Hero> blackList = zedMenu.GetBlockList(BlockListType.Harass);

            foreach (Obj_AI_Base objAiBase in shadows)
            {
                if (((q.UseOnHarass && !q.IsReady()) || !q.UseOnHarass) &&
                    ((e.UseOnHarass && !e.IsReady()) || !e.UseOnHarass))
                {
                    break;
                }

                if (q.UseOnHarass && q.IsReady())
                {
                    Obj_AI_Hero target = TargetSelector.GetTarget(
                        q.Range,
                        q.DamageType,
                        true,
                        blackList,
                        objAiBase.Position);

                    if (target != null)
                    {
                        PredictionInput predictionInput = new PredictionInput();
                        predictionInput.Range          = q.Range;
                        predictionInput.RangeCheckFrom = objAiBase.Position;
                        predictionInput.From           = objAiBase.Position;
                        predictionInput.Delay          = q.Delay;
                        predictionInput.Speed          = q.Speed;
                        predictionInput.Unit           = target;
                        predictionInput.Type           = SkillshotType.SkillshotLine;
                        predictionInput.Collision      = false;

                        PredictionOutput predictionOutput = Prediction.GetPrediction(predictionInput);

                        if (predictionOutput.Hitchance >= HitChance.Medium)
                        {
                            q.Cast(predictionOutput.CastPosition);
                            //Console.WriteLine("shadow haras q 1");
                        }
                    }
                }

                if (e.UseOnHarass && e.IsReady())
                {
                    Obj_AI_Hero target = TargetSelector.GetTarget(e.Range, e.DamageType, true, blackList, objAiBase.Position);

                    if (target != null)
                    {
                        e.Cast();
                        //Console.WriteLine("shadow haras e 2");
                    }
                }
            }
        }
Example #2
0
        private void Combo()
        {
            if (actionQueue.ExecuteNextAction(comboQueue))
            {
                return;
            }

            if (w.UseOnCombo && w.IsReady() && player.HasBuff("zedr2") && shadows.CanCast)
            {
                Obj_AI_Hero target = TargetSelector.GetTarget(w.Range + e.Range, TargetSelector.DamageType.Physical);

                if (target != null)
                {
                    actionQueue.EnqueueAction(comboQueue,
                                              () => true,
                                              () => shadows.Cast(target),
                                              () => true);
                    return;
                }
            }

            float maxRange = float.MaxValue;

            if (r.UseOnCombo && r.IsReady() && r.Instance.ToggleState == 0)
            {
                Obj_AI_Hero target = null;

                maxRange = Math.Min(maxRange, r.Range);

                if (zedMenu.GetParamBool("koreanzed.combo.ronselected"))
                {
                    if (TargetSelector.SelectedTarget != null && TargetSelector.SelectedTarget.IsValidTarget(maxRange))
                    {
                        target = TargetSelector.SelectedTarget;
                    }
                }
                else
                {
                    List <Obj_AI_Hero> ignoredChamps = zedMenu.GetBlockList(BlockListType.Ultimate);
                    target = TargetSelector.GetTarget(maxRange, r.DamageType, true, ignoredChamps);
                }

                if (target != null)
                {
                    actionQueue.EnqueueAction(
                        comboQueue,
                        () => r.IsReady() && r.Instance.ToggleState == 0,
                        () => r.Cast(target),
                        () => r.Instance.ToggleState != 0);

                    actionQueue.EnqueueAction(comboQueue, () => true, () => zedItems.UseItems(target), () => true);

                    return;
                }
            }

            if (q.UseOnCombo)
            {
                maxRange = Math.Min(maxRange, q.Range);
                Obj_AI_Hero target = TargetSelector.GetTarget(maxRange, q.DamageType);

                PredictionOutput predictionOutput = q.GetPrediction(target);

                if (predictionOutput.Hitchance >= HitChance.VeryHigh)
                {
                    q.Cast(predictionOutput.CastPosition);
                }
            }

            if (e.UseOnCombo)
            {
                maxRange = Math.Min(maxRange, e.Range);
                Obj_AI_Hero target = TargetSelector.GetTarget(maxRange, e.DamageType);
                if (target != null)
                {
                    actionQueue.EnqueueAction(comboQueue,
                                              () => true,
                                              () => zedItems.UseItems(target),
                                              () => true);

                    actionQueue.EnqueueAction(comboQueue,
                                              () => e.IsReady(),
                                              () => e.Cast(),
                                              () => true);
                }
            }

            if (w.UseOnCombo && w.IsReady() && w.Instance.ToggleState != 0)
            {
                List <Obj_AI_Base> shadowList = shadows.GetShadows();

                foreach (Obj_AI_Base objAiBase in shadowList)
                {
                    Obj_AI_Hero target = TargetSelector.GetTarget(2000F, TargetSelector.DamageType.Physical);

                    if (target != null && player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target) + 50F &&
                        objAiBase.Distance(target) < player.Distance(target))
                    {
                        w.Cast();
                    }
                }
            }
        }
Example #3
0
        private void Combo()
        {
            if (actionQueue.ExecuteNextAction(comboQueue))
            {
                return;
            }

            AIHeroClient itemsTarget = TargetSelector.GetTarget(player.AttackRange, TargetSelector.DamageType.Physical);

            if (itemsTarget != null)
            {
                zedItems.UseItems(itemsTarget);
            }

            shadows.Combo();

            if (w.UseOnCombo && shadows.CanCast && player.HasBuff("ZedR2"))
            {
                AIHeroClient target = TargetSelector.GetTarget(w.Range + e.Range, TargetSelector.DamageType.Physical);

                if (target != null)
                {
                    actionQueue.EnqueueAction(comboQueue,
                                              () => true,
                                              () => shadows.Cast(w.GetPrediction(target).CastPosition),
                                              () => true);
                    return;
                }
            }

            float maxRange = float.MaxValue;

            if (r.UseOnCombo && r.IsReady() && r.Instance.ToggleState == 0)
            {
                AIHeroClient target = null;

                maxRange = Math.Min(maxRange, r.Range);

                if (zedMenu.GetParamBool("koreanzed.combo.ronselected"))
                {
                    if (TargetSelector.SelectedTarget != null && TargetSelector.SelectedTarget.IsValidTarget(maxRange))
                    {
                        target = TargetSelector.SelectedTarget;
                    }
                }
                else
                {
                    List <AIHeroClient> ignoredChamps = zedMenu.GetBlockList(BlockListType.Ultimate);
                    target = TargetSelector.GetTarget(maxRange, r.DamageType, true, ignoredChamps);
                }

                if (target != null)
                {
                    switch (zedMenu.GetCombo())
                    {
                    case ComboType.AllStar:
                        AllStarCombo(target);
                        break;

                    case ComboType.TheLine:
                        TheLineCombo(target);
                        break;
                    }
                    return;
                }
            }
            else if (w.UseOnCombo && shadows.CanCast && (!r.UseOnCombo || (r.UseOnCombo && !r.IsReady())) &&
                     (player.Mana > w.ManaCost + (q.UseOnCombo && q.IsReady() ? q.ManaCost : 0F) + (e.UseOnCombo && e.IsReady() ? e.ManaCost : 0F)))
            {
                maxRange = Math.Min(maxRange, w.Range + e.Range);
                AIHeroClient target = TargetSelector.GetTarget(maxRange, TargetSelector.DamageType.Physical);
                if (target != null)
                {
                    actionQueue.EnqueueAction(
                        comboQueue,
                        () => shadows.CanCast,
                        () => shadows.Cast(w.GetPrediction(target).CastPosition),
                        () => !shadows.CanCast);
                    actionQueue.EnqueueAction(
                        comboQueue,
                        () => w.Instance.ToggleState != 0,
                        () => shadows.Combo(),
                        () => true);
                    actionQueue.EnqueueAction(
                        comboQueue,
                        () => shadows.CanSwitch && target.Distance(shadows.Instance.Position) <= player.AttackRange,
                        () => shadows.Switch(),
                        () => !shadows.CanSwitch || target.Distance(shadows.Instance.Position) > player.AttackRange || !w.IsReady());
                    actionQueue.EnqueueAction(
                        comboQueue,
                        () => player.Distance(target) <= Orbwalking.GetRealAutoAttackRange(target),
                        () => EloBuddy.Player.IssueOrder(GameObjectOrder.AttackUnit, target),
                        () => target.IsDead || target.IsZombie || player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target) || checkAutoAttack.Status);
                    return;
                }
            }

            if (q.UseOnCombo && q.IsReady() && player.Mana > q.ManaCost)
            {
                maxRange = Math.Min(maxRange, q.Range);
                AIHeroClient target = TargetSelector.GetTarget(maxRange, q.DamageType);

                PredictionOutput predictionOutput = q.GetPrediction(target);

                if (predictionOutput.Hitchance >= HitChance.Medium)
                {
                    q.Cast(predictionOutput.CastPosition);
                }
            }

            if (e.UseOnCombo && e.IsReady() && player.Mana > e.ManaCost)
            {
                maxRange = Math.Min(maxRange, e.Range);
                AIHeroClient target = TargetSelector.GetTarget(maxRange, e.DamageType);
                if (target != null)
                {
                    actionQueue.EnqueueAction(comboQueue,
                                              () => e.IsReady(),
                                              () => e.Cast(),
                                              () => true);
                    return;
                }
            }

            if (w.UseOnCombo && w.IsReady() && shadows.CanSwitch)
            {
                List <Obj_AI_Base> shadowList = shadows.GetShadows();

                foreach (Obj_AI_Base objAiBase in shadowList)
                {
                    AIHeroClient target = TargetSelector.GetTarget(2000F, TargetSelector.DamageType.Physical);

                    if (target != null && player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target) + 50F &&
                        objAiBase.Distance(target) < player.Distance(target))
                    {
                        shadows.Switch();
                    }
                }
            }
        }