Example #1
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();
                    }
                }
            }
        }