示例#1
0
 public void CastE(Obj_AI_Base target)
 {
     if (target != null && E.IsReady)
     {
         foreach (var ball in Spheres.Where(ball => WillHitSpheres.ContainsKey(ball.GameObject.NetworkId) && WillHitSpheres[ball.GameObject.NetworkId].ContainsKey(target.NetworkId)))
         {
             QE.Cast(WillHitSpheres[ball.GameObject.NetworkId][target.NetworkId]);
         }
     }
 }
示例#2
0
        public static void CastIfWillHit(this SpellBase spell, Obj_AI_Base target, int hitNumber)
        {
            var prediction          = (spell as Skillshot).GetPrediction(target);
            var enemiesInSpellRange = EntityManager.Heroes.Enemies.Count(x => !x.IsDead && x.Distance(prediction.CastPosition) <= spell.Range);

            if (hitNumber <= enemiesInSpellRange)
            {
                spell.Cast(prediction.CastPosition);
            }
        }
示例#3
0
        public static bool CastIfWillHitReturn(this SpellBase spell, Obj_AI_Base target, int hitChance)
        {
            var prediction = (spell as Skillshot).GetPrediction(target);

            if ((int)prediction.HitChance >= hitChance)
            {
                spell.Cast(prediction.CastPosition);
                return(true);
            }
            return(false);
        }
示例#4
0
        public IEnumerator StartCast()
        {
            state = EAI_State.STATE_ATTACK;
            m_creature.agent.velocity = Vector3.zero;
            m_creature.agent.ResetPath();
            yield return(new WaitForSeconds(_spell.SpellProps.CastTime));

            _spell.Cast(m_creature, m_target.transform.position);
            _castCoolDown = _spell.SpellProps.CoolDownDuration;
            m_creature.animator.SetTrigger("Cast");
            state = EAI_State.STATE_COMBAT;
        }
示例#5
0
 public override void useQ(Obj_AI_Base target)
 {
     if (Q.IsReady())
     {
         if (HaveQ3)
         {
             Q3.Cast(target);
         }
         else
         {
             Q.Cast(target);
         }
     }
 }
示例#6
0
        public static bool CastIfHitchanceEquals(this SpellBase spell, Obj_AI_Base target, HitChance chance, bool value)
        {
            if (target == null)
            {
                return(false);
            }
            var pred    = (spell as Skillshot).GetPrediction(target);
            var willHit = false;

            if ((int)pred.HitChance >= (int)chance)
            {
                willHit = true;
            }
            if (value && willHit)
            {
                return(spell.Cast(pred.CastPosition));
            }
            return(false);
        }
示例#7
0
 public static void CastOnUnit(this SpellBase spell, Obj_AI_Base target)
 {
     spell.Cast(target);
 }
示例#8
0
        public override void farm()
        {
            var laneClear = true;

            if (player.ManaPercent < 65)
            {
                return;
            }

            var rangedMinions = EntityManager.MinionsAndMonsters.EnemyMinions.Where(x => !x.IsDead && x.IsMelee && x.IsInRange(ObjectManager.Player.ServerPosition, Q2.Range));
            var allMinions    = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, ObjectManager.Player.ServerPosition, Q2.Range);

            var useQi = 2;
            var useWi = 2;
            var useEi = 2;
            var useQ  = (laneClear && (useQi == 1 || useQi == 2)) || (!laneClear && (useQi == 0 || useQi == 2));
            var useW  = (laneClear && (useWi == 1 || useWi == 2)) || (!laneClear && (useWi == 0 || useWi == 2));
            var useE  = (laneClear && (useEi == 1 || useEi == 2)) || (!laneClear && (useEi == 0 || useEi == 2));

            if (laneClear)
            {
                if (Q1.IsReady() && useQ)
                {
                    var rangedLocation = Q2.GetCircularFarmLocation(rangedMinions, Q2.Width());
                    var location       = Q2.GetCircularFarmLocation(allMinions, Q2.Width());

                    var bLocation = (location.HitNumber > rangedLocation.HitNumber + 1) ? location : rangedLocation;

                    if (bLocation.HitNumber > 0)
                    {
                        Q2.Cast(bLocation.CastPosition);
                    }
                }

                if (W.IsReady() && useW)
                {
                    var dmgpct         = new[] { 25, 27.5, 30, 32.5, 35 }[W.Level - 1];
                    var killableTurret = ObjectManager.Get <Obj_AI_Turret>().FirstOrDefault(x => x.IsEnemy && ObjectManager.Player.Distance(x.Position) <= W.Range && x.HealthPercent < dmgpct);
                    if (killableTurret != null)
                    {
                        W.Cast(killableTurret.Position);
                    }
                }

                if (E.IsReady() && useE)
                {
                    var rangedLocation = E.GetCircularFarmLocation(rangedMinions, E.Width() * 2);
                    var location       = E.GetCircularFarmLocation(allMinions, E.Width() * 2);

                    var bLocation = (location.HitNumber > rangedLocation.HitNumber + 1) ? location : rangedLocation;

                    if (bLocation.HitNumber > 2)
                    {
                        E.Cast(bLocation.CastPosition);
                    }
                }
            }
            else
            {
                if (useQ && Q1.IsReady())
                {
                    foreach (var minion in allMinions)
                    {
                        if (!Player.Instance.IsInAutoAttackRange(minion))
                        {
                            var Qdamage = ObjectManager.Player.GetSpellDamage(minion, SpellSlot.Q) * 0.75;

                            if (Qdamage > Q1.GetHealthPrediction(minion))
                            {
                                Q2.Cast(minion);
                            }
                        }
                    }
                }

                if (E.IsReady() && useE)
                {
                    var rangedLocation = E.GetCircularFarmLocation(rangedMinions, E.Width() * 2);
                    var location       = E.GetCircularFarmLocation(allMinions, E.Width() * 2);

                    var bLocation = (location.HitNumber > rangedLocation.HitNumber + 1) ? location : rangedLocation;

                    if (bLocation.HitNumber > 2)
                    {
                        E.Cast(bLocation.CastPosition);
                    }
                }
            }
        }
示例#9
0
        public Xerath()
        {
            Q = new SpellBase(SpellSlot.Q, SpellType.Linear, 1500)
            {
                CastDelay = 500,
                Width     = 100,
            };
            W = new SpellBase(SpellSlot.W, SpellType.Circular, 1000)
            {
                CastDelay = 750,
                Width     = 100,//Width = 250,
            };
            E = new SpellBase(SpellSlot.E, SpellType.Linear, 1125)
            {
                CastDelay             = 250,
                Speed                 = 1400,
                Width                 = 60,
                CollidesWithYasuoWall = true,
                AllowedCollisionCount = 0,
            };
            R = new SpellBase(SpellSlot.R, SpellType.Circular, 5600)
            {
                Width     = 190,
                CastDelay = 600,
            };
            foreach (var enemy in EntityManager.Heroes.Enemies)
            {
                IsKillableOnEnemyPosition.Add(enemy.NetworkId, new Text("R KILLABLE", new Font("Arial", TextEnemyPositionSize, FontStyle.Bold))
                {
                    Color = Color.Red,
                });
                IsKillableOnScreen.Add(enemy.NetworkId, new Text(enemy.BaseSkinName + " is killable", new Font("Arial", TextScreenSize, FontStyle.Bold))
                {
                    Color = Color.Red,
                });
            }
            Obj_AI_Base.OnProcessSpellCast += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (sender.IsMe)
                {
                    switch (args.Slot)
                    {
                    case SpellSlot.Q:
                        Q.LastCastTime = Core.GameTickCount;
                        break;

                    case SpellSlot.W:
                        W.LastCastTime    = Core.GameTickCount;
                        W.LastEndPosition = args.End;
                        break;

                    case SpellSlot.E:
                        E.LastCastTime    = Core.GameTickCount;
                        E.LastEndPosition = sender.Position + (args.End - sender.Position).Normalized() * E.Range;
                        break;

                    case SpellSlot.R:
                        R.LastCastTime = Core.GameTickCount;
                        TapKeyPressed  = false;
                        break;
                    }
                }
            };
            GameObject.OnCreate += delegate(GameObject sender, EventArgs args)
            {
                var missile = sender as MissileClient;
                if (missile != null && missile.SpellCaster.IsMe && missile.SData.Name.ToLower() == Spells.E.MissileName)
                {
                    Spells.E.Missile = missile;
                }
            };
            GameObject.OnDelete += delegate(GameObject sender, EventArgs args)
            {
                var missile = sender as MissileClient;
                if (missile != null && missile.SpellCaster.IsMe && missile.SData.Name.ToLower() == Spells.E.MissileName)
                {
                    Spells.E.Missile = null;
                }
            };
            Gapcloser.OnGapcloser += delegate(AIHeroClient sender, Gapcloser.GapcloserEventArgs args)
            {
                if (sender.IsEnemy && AutomaticMenu.CheckBox("Gapcloser") && args.End.Distance(MyHero, true) <= sender.Distance(MyHero, true))
                {
                    CastE(sender);
                }
            };
            Dash.OnDash += delegate(Obj_AI_Base sender, Dash.DashEventArgs args)
            {
                if (sender.IsEnemy && AutomaticMenu.CheckBox("Gapcloser") && args.EndPos.Distance(MyHero, true) <= sender.Distance(MyHero, true))
                {
                    CastE(sender);
                }
            };
            Interrupter.OnInterruptableSpell +=
                delegate(Obj_AI_Base sender, Interrupter.InterruptableSpellEventArgs args)
            {
                if (sender.IsEnemy && AutomaticMenu.CheckBox("Interrupter"))
                {
                    CastE(sender);
                }
            };

            MenuManager.AddSubMenu("Keys");
            {
                KeysMenu.AddValue("TapKey",
                                  new KeyBind("R Tap Key", false, KeyBind.BindTypes.HoldActive, 'T')).OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                {
                    if (args.NewValue && R.IsLearned)
                    {
                        TapKeyPressed = true;
                        if (!IsCastingR)
                        {
                            R.Cast();
                        }
                    }
                };
                ToggleManager.RegisterToggle(
                    KeysMenu.AddValue("StartWithCC",
                                      new KeyBind("Start with CC", false, KeyBind.BindTypes.PressToggle, 'L')),
                    delegate
                {
                });
            }
            Q.AddConfigurableHitChancePercent();
            W.AddConfigurableHitChancePercent();
            E.AddConfigurableHitChancePercent();
            R.AddConfigurableHitChancePercent();

            MenuManager.AddSubMenu("Combo");
            {
                ComboMenu.AddValue("Q", new CheckBox("Use Q"));
                ComboMenu.AddValue("W", new CheckBox("Use W"));
                ComboMenu.AddValue("E", new CheckBox("Use E"));
            }

            MenuManager.AddSubMenu("Ultimate");
            {
                UltimateMenu.AddStringList("Mode", "R AIM Mode", new[] { "Disabled", "Using TapKey", "Automatic" }, 2);
                UltimateMenu.AddValue("Delay", new Slider("Delay between R's (in ms)", 0, 0, 1500));
                UltimateMenu.AddValue("NearMouse", new GroupLabel("Near Mouse Settings"));
                UltimateMenu.AddValue("NearMouse.Enabled", new CheckBox("Only select target near mouse", false));
                UltimateMenu.AddValue("NearMouse.Radius", new Slider("Near mouse radius", 500, 100, 1500));
                UltimateMenu.AddValue("NearMouse.Draw", new CheckBox("Draw near mouse radius"));
            }

            MenuManager.AddSubMenu("Harass");
            {
                HarassMenu.AddValue("Q", new CheckBox("Use Q", false));
                HarassMenu.AddValue("W", new CheckBox("Use W", false));
                HarassMenu.AddValue("E", new CheckBox("Use E", false));
                HarassMenu.AddValue("ManaPercent", new Slider("Minimum Mana Percent", 25));
            }

            MenuManager.AddSubMenu("Clear");
            {
                ClearMenu.AddValue("LaneClear", new GroupLabel("LaneClear"));
                {
                    ClearMenu.AddValue("LaneClear.Q", new Slider("Use Q if hit is greater than {0}", 0, 0, 10));
                    ClearMenu.AddValue("LaneClear.W", new Slider("Use W if hit is greater than {0}", 3, 0, 10));
                    ClearMenu.AddValue("LaneClear.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("JungleClear", new GroupLabel("JungleClear"));
                {
                    ClearMenu.AddValue("JungleClear.Q", new CheckBox("Use Q"));
                    ClearMenu.AddValue("JungleClear.W", new CheckBox("Use W"));
                    ClearMenu.AddValue("JungleClear.E", new CheckBox("Use E"));
                    ClearMenu.AddValue("JungleClear.ManaPercent", new Slider("Minimum Mana Percent", 20));
                }
            }
            MenuManager.AddKillStealMenu();
            {
                KillStealMenu.AddValue("Q", new CheckBox("Use Q"));
                KillStealMenu.AddValue("W", new CheckBox("Use W"));
                KillStealMenu.AddValue("E", new CheckBox("Use E"));
                KillStealMenu.AddValue("R", new CheckBox("Use R", false));
            }
            MenuManager.AddSubMenu("Automatic");
            {
                AutomaticMenu.AddValue("Interrupter", new CheckBox("Use E on channeling spells"));
                AutomaticMenu.AddValue("Gapcloser", new CheckBox("Use E on hero gapclosing / dashing"));
            }
            MenuManager.AddDrawingsMenu();
            {
                Q.AddDrawings();
                W.AddDrawings();
                E.AddDrawings();
                R.AddDrawings();
                DrawingsMenu.AddValue("R.Killable", new CheckBox("Draw text if target is r killable"));
                DrawingsMenu.AddValue("Toggles", new CheckBox("Draw toggles status"));
            }
        }
示例#10
0
        public Cassiopeia()
        {
            Q = new SpellBase(SpellSlot.Q, SpellType.Circular, 850)
            {
                Width     = 130,
                CastDelay = 400
            };
            W = new SpellBase(SpellSlot.W, SpellType.Circular, 900)
            {
                Width     = 180,
                CastDelay = 250,
                Speed     = 3000
            };
            E = new SpellBase(SpellSlot.E, SpellType.Targeted, 730)
            {
                Speed     = 1900,
                CastDelay = 125
            };
            R = new SpellBase(SpellSlot.R, SpellType.Cone, 825)
            {
                Width     = 80,
                CastDelay = 500
            };

            Spellbook.OnCastSpell += delegate(Spellbook sender, SpellbookCastSpellEventArgs args)
            {
                if (sender.Owner.IsMe)
                {
                    switch (args.Slot)
                    {
                    case SpellSlot.Q:
                        Q.LastSentTime    = Core.GameTickCount;
                        Q.LastEndPosition = args.EndPosition;
                        break;

                    case SpellSlot.W:
                        W.LastSentTime    = Core.GameTickCount;
                        W.LastEndPosition = args.EndPosition;
                        break;
                    }
                }
            };

            Gapcloser.OnGapcloser += delegate(AIHeroClient sender, Gapcloser.GapcloserEventArgs args)
            {
                if ((ModeManager.LastHit || ModeManager.Harass) && sender.IsEnemy && args.End.Distance(MyHero, true) <= 700 && args.End.Distance(MyHero, true) > 500)
                {
                    CastW(sender);
                }

                else if (sender.IsEnemy && (ModeManager.Harass || ModeManager.Flee) && args.End.Distance(MyHero, true) <= 900 && args.End.Distance(MyHero, true) > 500)
                {
                    foreach (
                        var ally in
                        EntityManager.Heroes.Allies.Where(ally => sender.IsFacing(ally)))
                    {
//
                        {
                            CastW(sender);
                        }
                    }
                }
            };

            Obj_AI_Base.OnProcessSpellCast += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (sender.IsMe)
                {
                    switch (args.Slot)
                    {
                    case SpellSlot.Q:
                        Q.LastCastTime    = Core.GameTickCount;
                        Q.LastEndPosition = args.End;
                        break;

                    case SpellSlot.W:
                        W.LastCastTime    = Core.GameTickCount;
                        W.LastEndPosition = args.End;
                        break;
                    }
                }
            };

            Obj_AI_Base.OnBasicAttack += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (ModeManager.Harass && sender.IsValidTarget(800) && Q.IsReady && KeysMenu.KeyBind("HarassToggle") && sender.IsEnemy && sender.Type == GameObjectType.AIHeroClient)
                {
                    Q.Cast(sender.ServerPosition + 20);
                }
            };


            MenuManager.AddSubMenu("Keys");
            {
                KeysMenu.AddValue("AssistedUltimate",
                                  new KeyBind("Assisted Ultimate", false, KeyBind.BindTypes.HoldActive, 'T'));
                ToggleManager.RegisterToggle(
                    KeysMenu.AddValue("HarassToggle",
                                      new KeyBind("Harass Toggle", false, KeyBind.BindTypes.PressToggle, 'K')),
                    delegate
                {
                    if (!ModeManager.Combo)
                    {
                    }
                });
            }
            Q.AddConfigurableHitChancePercent();
            W.AddConfigurableHitChancePercent();
            R.AddConfigurableHitChancePercent();


            MenuManager.AddSubMenu("Combo");
            {
                ComboMenu.AddValue("Q", new CheckBox("Use Q"));
                ComboMenu.AddValue("W", new CheckBox("Use W"));
                ComboMenu.AddStringList("E", "Use E", new[] { "Never", "If Poisoned", "Always" }, 1);
                ComboMenu.AddValue("R", new Slider("Use R if hit >= {0}", 3, 0, 5));
            }

            MenuManager.AddSubMenu("Harass");
            {
                HarassMenu.AddValue("Q", new CheckBox("Use Q"));
                HarassMenu.AddValue("W", new CheckBox("Use W"));
                HarassMenu.AddStringList("E", "Use E", new[] { "Never", "If Poisoned", "Always" }, 1);
                HarassMenu.AddValue("ManaPercent", new Slider("Minimum Mana Percent", 25));
            }

            MenuManager.AddSubMenu("Clear");
            {
                ClearMenu.AddValue("LaneClear", new GroupLabel("LaneClear"));
                {
                    ClearMenu.AddValue("LaneClear.Q", new Slider("Use Q if hit >= {0}", 2, 0, 10));
                    ClearMenu.AddValue("LaneClear.W", new Slider("Use W if hit >= {0}", 3, 0, 10));
                    ClearMenu.AddStringList("LaneClear.E", "Use E", new[] { "Never", "If Poisoned", "Always" }, 1);
                    ClearMenu.AddValue("LaneClear.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("LastHit", new GroupLabel("LastHit"));
                {
                    ClearMenu.AddStringList("LastHit.E", "Use E", new[] { "Never", "If Poisoned", "Always" }, 1);
                    ClearMenu.AddValue("LastHit.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("JungleClear", new GroupLabel("JungleClear"));
                {
                    ClearMenu.AddValue("JungleClear.Q", new CheckBox("Use Q"));
                    ClearMenu.AddValue("JungleClear.W", new CheckBox("Use W"));
                    ClearMenu.AddValue("JungleClear.E", new CheckBox("Use E"));
                    ClearMenu.AddValue("JungleClear.ManaPercent", new Slider("Minimum Mana Percent", 20));
                }
            }
            MenuManager.AddKillStealMenu();
            {
                KillStealMenu.AddValue("Q", new CheckBox("Use Q"));
                KillStealMenu.AddValue("W", new CheckBox("Use W"));
                KillStealMenu.AddValue("E", new CheckBox("Use E"));
                KillStealMenu.AddValue("R", new CheckBox("Use R", false));
            }
            MenuManager.AddSubMenu("Automatic");
            {
                AutomaticMenu.AddValue("R", new CheckBox("Use R on channeling spells"));
            }
            MenuManager.AddDrawingsMenu();
            {
                Q.AddDrawings();
                W.AddDrawings(false);
                E.AddDrawings();
                R.AddDrawings();
                DrawingsMenu.AddValue("Toggles", new CheckBox("Draw toggles status"));
            }
        }
    protected override void Update()
    {
        base.Update();

        maxLife = playerData.GetMaxLife();

        if (playerData.name.StartsWith("#") && Input.GetKeyDown(KeyCode.L))
        {
            playerData.GrantExperience(playerData.ExperienceToNextLevel - playerData.Experience);
        }

        if (Input.GetKeyDown(KeyCode.Tab))
        {
            if (!TryAndSwitchTarget())
            {
                enemyTabCache = (from e in GameObject.FindGameObjectsWithTag("Enemy")
                                 where reasonableTargetFunc(e) && e.GetComponent <EntityLiving>()
                                 orderby Vector3.Distance(e.transform.position, transform.position) ascending
                                 select e.GetComponent <EntityLiving>()).ToList();

                TryAndSwitchTarget();
            }
        }

        SpellBase[] keys = cooldowns.Keys.ToArray();

        for (int i = 0; i < keys.Length; i++)
        {
            SpellBase key = keys[i];

            if (cooldowns[key] > .0F)
            {
                cooldowns[key] -= Time.deltaTime;
            }
        }

        if (casting != null)
        {
            if (progress >= casting.castTime)
            {
                if (casting.VerifyCanCastSpell(this))
                {
                    anim.Pause(false);

                    if (!string.IsNullOrEmpty(casting.animation) && !casting.animateBeforeCast && anim.IsPlaying())
                    {
                        return;
                    }

                    cooldowns[casting] = casting.cooldown;
                    casting.Cast(this);
                }

                anim.Stop();

                if (castingParticle)
                {
                    castEffect = null;

                    foreach (Transform t in castingParticle)
                    {
                        Destroy(t.gameObject);
                    }
                }

                casting = null;
            }
            else
            {
                progress += Time.deltaTime;
            }
            return;
        }

        for (int i = 0; i < spells.Count && i < spellKeys.Length; i++)
        {
            if (Input.GetKeyDown(spellKeys[i]))
            {
                if (cooldowns.ContainsKey(spells[i]) && cooldowns[spells[i]] > 0)
                {
                    UIHelper.Alert("alerts.player.spell.cooldown", "InGameError");
                    continue;
                }
                if (!spells[i].VerifyCanCastSpell(this))
                {
                    continue;
                }
                progress = 0;
                casting  = spells[i];

                if (!string.IsNullOrEmpty(casting.animation))
                {
                    anim.Play(Resources.Load <TextAsset>("Poses/" + casting.animation));
                    if (!casting.animateBeforeCast)
                    {
                        anim.Pause(true);
                    }
                }

                if (castingParticle && !string.IsNullOrEmpty(casting.particle))
                {
                    castEffect = Instantiate(Resources.Load <GameObject>("Particles/" + casting.particle), castingParticle);
                }

                return;
            }
        }
    }
示例#12
0
        private void CastSpell(SpellBase QWER, AIHeroClient target, int HitChanceNum)
        {
            QWER.CastIfHitchanceEquals(target, (EloBuddy.SDK.Enumerations.HitChance)HitChanceNum, true);
            return;



            //HitChance 0 - 2
            // example CastSpell(Q, ts, 2);
            var poutput = QWER.GetPrediction(target);
            var col     = poutput.CollisionObjects.Count(ColObj => ColObj.IsEnemy && ColObj.IsMinion && !ColObj.IsDead);

            if (target.IsDead || col > 0 || target.Path.Count() > 1)
            {
                return;
            }

            if ((target.Path.Count() == 0 && target.Position == target.ServerPosition) || target.HasBuff("Recall"))
            {
                QWER.Cast(poutput.CastPosition);
                return;
            }

            if (HitChanceNum == 0)
            {
                QWER.Cast(target);
            }
            else if (HitChanceNum == 1)
            {
                if ((int)poutput.HitChance > 4)
                {
                    QWER.Cast(poutput.CastPosition);
                }
            }
            else if (HitChanceNum == 2)
            {
                List <Vector2> waypoints = target.GetWaypoints();
                if (waypoints.Last().To3D().Distance(poutput.CastPosition) > QWER.Width() && (int)poutput.HitChance == 5)
                {
                    if (waypoints.Last().To3D().Distance(player.Position) <= target.Distance(player.Position) || (target.Path.Count() == 0 && target.Position == target.ServerPosition))
                    {
                        if (player.Distance(target.ServerPosition) < QWER.Range - (poutput.CastPosition.Distance(target.ServerPosition) + target.BoundingRadius))
                        {
                            QWER.Cast(poutput.CastPosition);
                        }
                    }
                    else if ((int)poutput.HitChance == 5)
                    {
                        QWER.Cast(poutput.CastPosition);
                    }
                }
            }
            else if (HitChanceNum == 3)
            {
                List <Vector2> waypoints   = target.GetWaypoints();
                float          SiteToSite  = ((target.MoveSpeed * QWER.CastDelay) + (player.Distance(target.ServerPosition) / QWER.Speed()) - QWER.Width()) * 6;
                float          BackToFront = ((target.MoveSpeed * QWER.CastDelay) + (player.Distance(target.ServerPosition) / QWER.Speed()));
                if (player.Distance(waypoints.Last().To3D()) < SiteToSite || player.Distance(target.Position) < SiteToSite)
                {
                    QWER.CastIfHitchanceEquals(target, EloBuddy.SDK.Enumerations.HitChance.High, true);
                }
                else if ((target.ServerPosition.Distance(waypoints.Last().To3D()) > SiteToSite ||
                          Math.Abs(player.Distance(waypoints.Last().To3D()) - player.Distance(target.Position)) > BackToFront))
                {
                    if (waypoints.Last().To3D().Distance(player.Position) <= target.Distance(player.Position))
                    {
                        if (player.Distance(target.ServerPosition) < QWER.Range - (poutput.CastPosition.Distance(target.ServerPosition)))
                        {
                            QWER.Cast(poutput.CastPosition);
                        }
                    }
                    else
                    {
                        QWER.Cast(poutput.CastPosition);
                    }
                }
            }
            else if (HitChanceNum == 4 && (int)poutput.HitChance > 4)
            {
                List <Vector2> waypoints   = target.GetWaypoints();
                float          SiteToSite  = ((target.MoveSpeed * QWER.CastDelay) + (player.Distance(target.ServerPosition) / QWER.Speed()) - QWER.Width()) * 6;
                float          BackToFront = ((target.MoveSpeed * QWER.CastDelay) + (player.Distance(target.ServerPosition) / QWER.Speed()));

                if (player.Distance(waypoints.Last().To3D()) < SiteToSite || player.Distance(target.Position) < SiteToSite)
                {
                    QWER.CastIfHitchanceEquals(target, EloBuddy.SDK.Enumerations.HitChance.High, true);
                }
                else if ((target.ServerPosition.Distance(waypoints.Last().To3D()) > SiteToSite ||
                          Math.Abs(player.Distance(waypoints.Last().To3D()) - player.Distance(target.Position)) > BackToFront))
                {
                    if (waypoints.Last().To3D().Distance(player.Position) <= target.Distance(player.Position))
                    {
                        if (player.Distance(target.ServerPosition) < QWER.Range - (poutput.CastPosition.Distance(target.ServerPosition)))
                        {
                            QWER.Cast(poutput.CastPosition);
                        }
                    }
                    else
                    {
                        QWER.Cast(poutput.CastPosition);
                    }
                }
            }
        }
示例#13
0
        public Syndra()
        {
            Q = new SpellBase(SpellSlot.Q, SpellType.Circular, 825)
            {
                CastDelay = 600,
                Width     = Spells.Q.Width,
            };
            W = new SpellBase(SpellSlot.W, SpellType.Circular, 950)
            {
                CastDelay = 250,
                Width     = Spells.W.Width,
                Speed     = 1450,
            };
            E = new SpellBase(SpellSlot.E, SpellType.Cone, 675 + Spells.E.ExtraRange)
            {
                CastDelay = 250,
                Width     = Spells.E.Level1Angle,
                Speed     = 2500,
            };
            QE = new SpellBase(SpellSlot.E, SpellType.Linear, Spells.QE.Range)
            {
                CastDelay = Spells.QE.CastDelay,
                Width     = 60,
                Speed     = Spells.QE.Speed,
            };
            R = new SpellBase(SpellSlot.R, SpellType.Targeted, Spells.R.Level1Range);
            foreach (var enemy in EntityManager.Heroes.Enemies)
            {
                IsKillableOnEnemyPosition.Add(enemy.NetworkId, new Text("R KILLABLE", new Font("Arial", TextEnemyPositionSize, FontStyle.Bold))
                {
                    Color = Color.Red,
                });
                IsKillableOnScreen.Add(enemy.NetworkId, new Text(enemy.BaseSkinName + " is killable", new Font("Arial", TextScreenSize, FontStyle.Bold))
                {
                    Color = Color.Red,
                });
            }

            Obj_AI_Base.OnBasicAttack += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (sender == Target && (ModeManager.LastHit || ModeManager.Flee || ModeManager.Harass || ModeManager.LaneClear) && sender.IsValidTarget(1300) && sender.IsEnemy && sender.Type == GameObjectType.AIHeroClient)
                {
                    if (Q.IsReady && sender.IsValidTarget(825))
                    {
                        Q.Cast(sender.ServerPosition);
                    }
                    if (W.IsReady && sender.IsValidTarget(950))
                    {
                        CastW(sender);
                    }
                    if (E.IsReady && sender.IsValidTarget(1300))
                    {
                        CastE(sender);
                    }
                }
            };

            Obj_AI_Base.OnProcessSpellCast += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (sender.IsMe)
                {
                    switch (args.Slot)
                    {
                    case SpellSlot.Q:
                        Q.LastEndPosition = args.End.IsInRange(sender, Q.Range) ? args.End : (MyHero.Position + (args.End - MyHero.Position).Normalized() * Q.Range);
                        Q.LastCastTime    = Core.GameTickCount;
                        break;

                    case SpellSlot.W:
                        if (args.SData.Name.ToLower() == "syndrawcast")
                        {
                            W.LastEndPosition = args.End.IsInRange(sender, W.Range) ? args.End : (MyHero.Position + (args.End - MyHero.Position).Normalized() * W.Range);
                            W.LastCastTime    = Core.GameTickCount;
                        }
                        break;

                    case SpellSlot.E:
                        E.LastCastTime = Core.GameTickCount;
                        break;
                    }
                }
                {
                    if (!sender.IsDashing() && sender == Target && (ModeManager.LastHit || ModeManager.Flee || ModeManager.Harass || ModeManager.LaneClear) && sender.IsValidTarget(1300) && sender.IsEnemy && sender.Type == GameObjectType.AIHeroClient)
                    {
                        if (Q.IsReady && sender.IsValidTarget(825))
                        {
                            Q.Cast(sender.ServerPosition);
                        }
                        if (W.IsReady && sender.IsValidTarget(950))
                        {
                            CastW(sender);
                        }
                        if (E.IsReady && sender.IsValidTarget(1300))
                        {
                            CastE(sender);
                        }
                    }
                }
            };
            GameObject.OnCreate += delegate(GameObject sender, EventArgs args)
            {
                var objBase = sender as Obj_AI_Base;
                if (objBase != null && Sphere.IsMySphere(objBase))
                {
                    Spheres.Add(new Sphere(objBase));
                }
            };
            Gapcloser.OnGapcloser += delegate(AIHeroClient sender, Gapcloser.GapcloserEventArgs args)
            {
                if (sender.IsEnemy && AutomaticMenu.CheckBox("Gapcloser") && args.End.Distance(MyHero, true) <= sender.Distance(MyHero, true) && args.End.Distance(MyHero, true) <= 900)
                {
                    E.Cast(args.End);
                    CastQE(sender);
                }
            };
            Dash.OnDash += delegate(Obj_AI_Base sender, Dash.DashEventArgs args)
            {
                if (sender.IsEnemy && AutomaticMenu.CheckBox("Gapcloser") && args.EndPos.Distance(MyHero, true) <= sender.Distance(MyHero, true) && args.EndPos.Distance(MyHero, true) <= E.Range)
                {
                    CastE(sender);
                    CastQE(sender);
                }
            };
            Interrupter.OnInterruptableSpell +=
                delegate(Obj_AI_Base sender, Interrupter.InterruptableSpellEventArgs args)
            {
                if (sender.IsEnemy && AutomaticMenu.CheckBox("Interrupter"))
                {
                    CastE(sender);
                    CastQE(sender);
                }
            };
            MenuManager.AddSubMenu("Keys");
            {
                KeysMenu.AddValue("QE",
                                  new KeyBind("Use QE/WE on enemy near mouse", false, KeyBind.BindTypes.HoldActive, 'E'));
                ToggleManager.RegisterToggle(
                    KeysMenu.AddValue("HarassToggle",
                                      new KeyBind("Harass Toggle", false, KeyBind.BindTypes.PressToggle, 'K')),
                    delegate
                {
                    if (!ModeManager.Combo)
                    {
                        Harass(HarassMenu);
                    }
                });
            }
            Q.AddConfigurableHitChancePercent(50);
            W.AddConfigurableHitChancePercent(60);
            QE.AddConfigurableHitChancePercent(75);

            MenuManager.AddSubMenu("Combo");
            {
                ComboMenu.AddValue("Q", new CheckBox("Use Q"));
                ComboMenu.AddValue("W", new CheckBox("Use W"));
                ComboMenu.AddValue("E", new CheckBox("Use E"));
                ComboMenu.AddValue("QE", new CheckBox("Use QE"));
                ComboMenu.AddValue("WE", new CheckBox("Use WE"));
            }

            MenuManager.AddSubMenu("Ultimate");
            {
                UltimateMenu.AddValue("BlackList", new GroupLabel("BlackList"));
                var hashSet = new HashSet <string>();
                foreach (var enemy in EntityManager.Heroes.Enemies.Where(enemy => hashSet.Add(enemy.ChampionName)))
                {
                    UltimateMenu.AddValue("BlackList." + enemy.ChampionName, new CheckBox(enemy.ChampionName));
                }
            }
            MenuManager.AddSubMenu("Harass");
            {
                HarassMenu.AddValue("Turret", new CheckBox("Don't harass under enemy turret"));
                HarassMenu.AddValue("Q", new CheckBox("Use Q"));
                HarassMenu.AddValue("W", new CheckBox("Use W", false));
                HarassMenu.AddValue("E", new CheckBox("Use E", false));
                HarassMenu.AddValue("QE", new CheckBox("Use QE", false));
                HarassMenu.AddValue("WE", new CheckBox("Use WE", false));
                HarassMenu.AddValue("ManaPercent", new Slider("Minimum Mana Percent", 25));
            }
            MenuManager.AddSubMenu("Clear");
            {
                ClearMenu.AddValue("LaneClear", new GroupLabel("LaneClear"));
                {
                    ClearMenu.AddValue("LaneClear.Q", new Slider("Use Q if hit >= {0}", 3, 0, 10));
                    ClearMenu.AddValue("LaneClear.W", new Slider("Use W if hit >= {0}", 3, 0, 10));
                    ClearMenu.AddValue("LaneClear.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("LastHit", new GroupLabel("LastHit"));
                {
                    ClearMenu.AddStringList("LastHit.Q", "Use Q", new[] { "Never", "Smartly", "Always" }, 1);
                    ClearMenu.AddValue("LastHit.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("JungleClear", new GroupLabel("JungleClear"));
                {
                    ClearMenu.AddValue("JungleClear.Q", new CheckBox("Use Q"));
                    ClearMenu.AddValue("JungleClear.W", new CheckBox("Use W"));
                    ClearMenu.AddValue("JungleClear.E", new CheckBox("Use E"));
                    ClearMenu.AddValue("JungleClear.ManaPercent", new Slider("Minimum Mana Percent", 20));
                }
            }
            MenuManager.AddKillStealMenu();
            {
                KillStealMenu.AddValue("Q", new CheckBox("Use Q"));
                KillStealMenu.AddValue("W", new CheckBox("Use W"));
                KillStealMenu.AddValue("E", new CheckBox("Use E"));
                KillStealMenu.AddValue("R", new CheckBox("Use R", false));
            }
            MenuManager.AddSubMenu("Automatic");
            {
                AutomaticMenu.AddValue("Interrupter", new CheckBox("Use E on channeling spells"));
                AutomaticMenu.AddValue("Gapcloser", new CheckBox("Use E on hero gapclosing / dashing"));
            }
            MenuManager.AddSubMenu("Misc");
            {
                MiscMenu.AddValue("QE.ReducedRange", new Slider("Less QE Range", 0, 0, 650));
            }
            MenuManager.AddDrawingsMenu();
            {
                Q.AddDrawings();
                W.AddDrawings();
                QE.AddDrawings();
                R.AddDrawings();
                DrawingsMenu.AddValue("R.Killable", new CheckBox("Draw text if target is r killable"));
                DrawingsMenu.AddValue("Toggles", new CheckBox("Draw toggles status"));
                DrawingsMenu.AddValue("E.Lines", new CheckBox("Draw lines for E"));
            }
            foreach (var sphere in ObjectManager.Get <Obj_AI_Minion>().Where(o => o.IsValid && o.IsVisible && !o.IsDead && Sphere.IsMySphere(o)))
            {
                Spheres.Add(new Sphere(sphere));
            }
        }
示例#14
0
 public static async Task CastWithDelay(this SpellBase s, int delay)
 {
     System.Threading.Thread.Sleep(delay);
     s.Cast();
 }
示例#15
0
        private void CastER(Obj_AI_Base target) // copied from ScienceARK
        {
            PredictionResult prediction;

            if (ObjectManager.Player.Distance(target) < E1.Range)
            {
                var oldrange = E1.Range;
                E1.Range   = E2.Range;
                prediction = E1.GetPrediction(target, true);
                E1.Range   = oldrange;
            }
            else if (ObjectManager.Player.Distance(target) < E2.Range)
            {
                var oldrange = E2.Range;
                E2.Range   = E3.Range;
                prediction = E2.GetPrediction(target, true);
                E2.Range   = oldrange;
            }
            else if (ObjectManager.Player.Distance(target) < E3.Range)
            {
                prediction = E3.GetPrediction(target, true);
            }
            else
            {
                return;
            }

            if (prediction.HitChance >= HitChance.High)
            {
                if (ObjectManager.Player.ServerPosition.Distance(prediction.CastPosition) <= E1.Range + E1.Width())
                {
                    Vector3 p;
                    if (ObjectManager.Player.ServerPosition.Distance(prediction.CastPosition) > 300)
                    {
                        p = prediction.CastPosition -
                            100 *
                            (prediction.CastPosition.To2D() - ObjectManager.Player.ServerPosition.To2D()).Normalized()
                            .To3D();
                    }
                    else
                    {
                        p = prediction.CastPosition;
                    }
                    R.Cast();
                    E1.Cast(p);
                }
                else if (ObjectManager.Player.ServerPosition.Distance(prediction.CastPosition) <=
                         ((E1.Range + E1.Range) / 2))
                {
                    var p = ObjectManager.Player.ServerPosition.To2D()
                            .Extend(prediction.CastPosition.To2D(), E1.Range - 100);
                    {
                        R.Cast();
                        E1.Cast(p.To3D());
                    }
                }
                else
                {
                    var p = ObjectManager.Player.ServerPosition.To2D() +
                            E1.Range *
                            (prediction.CastPosition.To2D() - ObjectManager.Player.ServerPosition.To2D()).Normalized
                                ();

                    {
                        R.Cast();
                        E1.Cast(p.To3D());
                    }
                }
            }
        }
示例#16
0
文件: Jhin.cs 项目: chienhao10/CHOP
        public Jhin()
        {
            foreach (var enemy in EntityManager.Heroes.Enemies)
            {
                TextsInScreen.Add(enemy.NetworkId, new Text(enemy.ChampionName + " 可击杀", new Font("Arial", 30F, FontStyle.Bold))
                {
                    Color = Color.Red
                });
                TextsInHeroPosition.Add(enemy.NetworkId, new Text("R 可击杀", new Font("Arial", 23F, FontStyle.Bold))
                {
                    Color = Color.Red
                });
                LastPredictedPositionText.Add(enemy.NetworkId, new Text(enemy.ChampionName + " 最后预知位置", new Font("Arial", 23F, FontStyle.Bold))
                {
                    Color = Color.Red
                });
            }
            Q = new SpellBase(SpellSlot.Q, SpellType.Targeted, 600)
            {
                Width     = 450,
                Speed     = 1800,
                CastDelay = 250,
            };
            W = new SpellBase(SpellSlot.W, SpellType.Linear, 2500)
            {
                Width                 = 40,
                CastDelay             = 750,
                AllowedCollisionCount = -1,
            };
            E = new SpellBase(SpellSlot.E, SpellType.Circular, 750)
            {
                Width     = 135,
                CastDelay = 250,
                Speed     = 1600,
            };
            R = new SpellBase(SpellSlot.R, SpellType.Linear, 3500)
            {
                Width                 = 80,
                CastDelay             = 200,
                Speed                 = 5000,
                AllowedCollisionCount = -1,
            };
            Evader.OnEvader += delegate
            {
                if (EvaderMenu.CheckBox("BlockW"))
                {
                    LastBlockTick = Core.GameTickCount;
                }
            };

            Spellbook.OnCastSpell += delegate(Spellbook sender, SpellbookCastSpellEventArgs args)
            {
                if (sender.Owner.IsMe)
                {
                    if (args.Slot == SpellSlot.W)
                    {
                        args.Process = Core.GameTickCount - LastBlockTick > 750;
                    }
                }
            };
            Obj_AI_Base.OnProcessSpellCast += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (sender.IsMe)
                {
                    switch (args.Slot)
                    {
                    case SpellSlot.W:
                        W.LastCastTime    = Core.GameTickCount;
                        W.LastEndPosition = args.End;
                        break;

                    case SpellSlot.R:
                        if (args.SData.Name == "JhinR")
                        {
                            IsCastingR = true;
                            LastRCone  = new Geometry.Polygon.Sector(sender.Position, args.End, (float)(60f * Math.PI / 180f), R.Range);
                            Stacks     = 4;
                        }
                        else if (args.SData.Name == "JhinRShot")
                        {
                            R.LastCastTime = Core.GameTickCount;
                            TapKeyPressed  = false;
                            Stacks--;
                        }
                        break;
                    }
                }
            };
            Gapcloser.OnGapcloser += delegate(AIHeroClient sender, Gapcloser.GapcloserEventArgs args)
            {
                if (sender.IsValidTarget() && sender.IsEnemy)
                {
                    if (MyHero.Distance(args.Start, true) > MyHero.Distance(args.End))
                    {
                        if (AutomaticMenu.CheckBox("E.Gapcloser") && MyHero.IsInRange(args.End, E.Range))
                        {
                            E.Cast(args.End);
                        }
                        if (MyHero.Distance(args.End, true) < (sender.GetAutoAttackRange(MyHero) * 1.5f).Pow())
                        {
                            WShouldWaitTick = Core.GameTickCount;
                        }
                    }
                }
            };

            MenuManager.AddSubMenu("Keys");
            {
                KeysMenu.AddValue("TapKey", new KeyBind("R 半自动发射", false, KeyBind.BindTypes.HoldActive, 32)).OnValueChange +=
                    delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                {
                    if (args.NewValue && R.IsLearned && IsCastingR)
                    {
                        TapKeyPressed = true;
                    }
                };
                ToggleManager.RegisterToggle(
                    KeysMenu.AddValue("AutoW",
                                      new KeyBind("自动W开关", true, KeyBind.BindTypes.PressToggle, 'K')),
                    delegate
                {
                    foreach (var enemy in UnitManager.ValidEnemyHeroes.Where(TargetHaveEBuff))
                    {
                        if (MyHero.ManaPercent >= MiscMenu.Slider("W.ManaPercent"))
                        {
                            if (MiscMenu.CheckBox("自动W." + enemy.ChampionName))
                            {
                                CastW(enemy);
                            }
                        }
                    }
                });
            }

            W.AddConfigurableHitChancePercent();
            R.AddConfigurableHitChancePercent();

            MenuManager.AddSubMenu("Combo");
            {
                ComboMenu.AddValue("Q", new CheckBox("Use Q"));
                ComboMenu.AddValue("E", new CheckBox("Use E"));
                ComboMenu.AddValue("Items", new CheckBox("Use offensive items"));
                ComboMenu.AddStringList("W", "Use W", new[] { "Never", "Only buffed enemies", "Always" }, 2);
            }
            MenuManager.AddSubMenu("Ultimate");
            {
                UltimateMenu.AddStringList("Mode", "R 瞄准模式", new[] { "不使用", "使用扳机键", "自动" }, 2);
                UltimateMenu.AddValue("OnlyKillable", new CheckBox("只攻击可击杀目标"));
                UltimateMenu.AddValue("Delay", new Slider("R之间的延迟(毫秒)", 0, 0, 1500));
                UltimateMenu.AddValue("NearMouse", new GroupLabel("鼠标附近设置"));
                UltimateMenu.AddValue("NearMouse.Enabled", new CheckBox("只选择鼠标附近目标", false));
                UltimateMenu.AddValue("NearMouse.Radius", new Slider("靠近鼠标半径", 500, 100, 1500));
                UltimateMenu.AddValue("NearMouse.Draw", new CheckBox("显示鼠标半径"));
            }
            MenuManager.AddSubMenu("Harass");
            {
                HarassMenu.AddValue("Q", new CheckBox("Use Q"));
                HarassMenu.AddValue("W", new CheckBox("Use W", false));
                HarassMenu.AddValue("E", new CheckBox("Use E", false));
                HarassMenu.AddValue("ManaPercent", new Slider("Minimum Mana Percent", 20));
            }

            MenuManager.AddSubMenu("Clear");
            {
                ClearMenu.AddValue("LaneClear", new GroupLabel("LaneClear"));
                {
                    ClearMenu.AddValue("LaneClear.Q", new Slider("Use Q if hit is greater than {0}", 3, 0, 10));
                    ClearMenu.AddValue("LaneClear.W", new Slider("Use W if hit is greater than {0}", 5, 0, 10));
                    ClearMenu.AddValue("LaneClear.E", new Slider("Use E if hit is greater than {0}", 4, 0, 10));
                    ClearMenu.AddValue("LaneClear.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("LastHit", new GroupLabel("LastHit"));
                {
                    ClearMenu.AddStringList("LastHit.Q", "Use Q", new[] { "Never", "Smartly", "Always" }, 1);
                    ClearMenu.AddValue("LastHit.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("JungleClear", new GroupLabel("JungleClear"));
                {
                    ClearMenu.AddValue("JungleClear.Q", new CheckBox("Use Q"));
                    ClearMenu.AddValue("JungleClear.W", new CheckBox("Use W"));
                    ClearMenu.AddValue("JungleClear.E", new CheckBox("Use E"));
                    ClearMenu.AddValue("JungleClear.ManaPercent", new Slider("Minimum Mana Percent", 20));
                }
            }

            MenuManager.AddKillStealMenu();
            {
                KillStealMenu.AddValue("Q", new CheckBox("Use Q"));
                KillStealMenu.AddValue("W", new CheckBox("Use W"));
                KillStealMenu.AddValue("E", new CheckBox("Use E"));
                KillStealMenu.AddValue("R", new CheckBox("Use R"));
            }

            MenuManager.AddSubMenu("Automatic");
            {
                AutomaticMenu.AddValue("E.Gapcloser", new CheckBox("Use E on hero gapclosing / dashing"));
                AutomaticMenu.AddValue("Immobile", new CheckBox("对无法移动目标使用E"));
            }
            MenuManager.AddSubMenu("Evader");
            {
                EvaderMenu.AddValue("BlockW", new CheckBox("保留W进行躲避"));
            }
            Evader.Initialize();
            Evader.AddCrowdControlSpells();
            Evader.AddDangerousSpells();
            MenuManager.AddSubMenu("Misc");
            {
                MiscMenu.AddValue("W.ManaPercent", new Slider("最低蓝量百分比使用自动W", 10));
                MiscMenu.AddValue("Champions", new GroupLabel("自动使用W英雄"));
                foreach (var enemy in EntityManager.Heroes.Enemies)
                {
                    MiscMenu.AddValue("自动W." + enemy.ChampionName, new CheckBox(enemy.ChampionName));
                }
            }
            MenuManager.AddDrawingsMenu();
            {
                Q.AddDrawings(false);
                W.AddDrawings();
                E.AddDrawings(false);
                R.AddDrawings();
                DrawingsMenu.AddValue("Toggles", new CheckBox("Draw toggles status"));
                DrawingsMenu.AddValue("R.Killable", new CheckBox("显示可被R击杀的目标"));
                DrawingsMenu.AddValue("R.LastPredictedPosition", new CheckBox("显示预判敌人最后出现位置"));
            }
        }
示例#17
0
        public Diana()
        {
            Q = new SpellBase(SpellSlot.Q, SpellType.Circular, 825)
            {
                Width     = 185,
                CastDelay = 250,
                Speed     = 1640
            };
            W = new SpellBase(SpellSlot.W, SpellType.Self, 250);
            E = new SpellBase(SpellSlot.E, SpellType.Self, 450)
            {
                CastDelay = 250
            };
            R = new SpellBase(SpellSlot.R, SpellType.Targeted, 825)
            {
                Speed = 2500
            };
            Obj_AI_Base.OnProcessSpellCast += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (sender.IsMe)
                {
                    switch (args.Slot)
                    {
                    case SpellSlot.Q:
                        Q.LastCastTime = Core.GameTickCount;
                        QEndPosition   = args.End;   // +(args.End - sender.ServerPosition).Normalized() * Q.Width / 2;
                        break;

                    case SpellSlot.R:
                        R.LastCastTime = Core.GameTickCount;
                        break;
                    }
                }
            };
            GameObject.OnCreate += delegate(GameObject sender, EventArgs args)
            {
                var missile = sender as MissileClient;
                if (missile != null && missile.SpellCaster != null && missile.SpellCaster.IsMe)
                {
                    if (missile.SData.Name.Equals(QMissileName))
                    {
                        QMissile = missile;
                    }
                }
            };
            GameObject.OnDelete += delegate(GameObject sender, EventArgs args)
            {
                var missile = sender as MissileClient;
                if (missile != null && missile.SpellCaster != null && missile.SpellCaster.IsMe)
                {
                    if (missile.SData.Name.Equals(QMissileName))
                    {
                        QMissile = null;
                    }
                }
            };
            Gapcloser.OnGapcloser += delegate(AIHeroClient sender, Gapcloser.GapcloserEventArgs args)
            {
                if (sender.IsEnemy)
                {
                    if (AutomaticMenu.CheckBox("Gapcloser"))
                    {
                        E.Cast(sender);
                    }
                }
            };
            Interrupter.OnInterruptableSpell +=
                delegate(Obj_AI_Base sender, Interrupter.InterruptableSpellEventArgs args)
            {
                if (sender.IsEnemy)
                {
                    if (AutomaticMenu.CheckBox("Interrupter"))
                    {
                        E.Cast(sender);
                    }
                }
            };
            Dash.OnDash += delegate(Obj_AI_Base sender, Dash.DashEventArgs args)
            {
                if (sender.IsEnemy)
                {
                    if (AutomaticMenu.CheckBox("Gapcloser"))
                    {
                        E.Cast(sender);
                    }
                }
            };
            Q.AddConfigurableHitChancePercent();
            MenuManager.AddSubMenu("Combo");
            {
                ComboMenu.AddValue("Q", new CheckBox("Use Q"));
                ComboMenu.AddValue("W", new CheckBox("Use W"));
                ComboMenu.AddValue("QR", new CheckBox("Use QR on minion to gapclose"));
                ComboMenu.AddValue("Ignite", new CheckBox("Use Ignite if target is killable", false));
                ComboMenu.AddStringList("E", "Use E", new[] { "Never", "Smartly", "Always" }, 1);
                ComboMenu.AddStringList("R", "Use R", new[] { "Never", "Smartly", "Always" }, 1);
                ComboMenu.AddValue("2ndR", new CheckBox("Use always second r", false));
            }

            MenuManager.AddSubMenu("Harass");
            {
                HarassMenu.AddValue("Q", new CheckBox("Use Q"));
                HarassMenu.AddValue("W", new CheckBox("Use W"));
                HarassMenu.AddValue("E", new CheckBox("Use E", false));
                HarassMenu.AddValue("ManaPercent", new Slider("Minimum Mana Percent", 25));
            }

            MenuManager.AddSubMenu("Clear");
            {
                ClearMenu.AddValue("LaneClear", new GroupLabel("LaneClear"));
                {
                    ClearMenu.AddValue("LaneClear.Q", new Slider("Use Q if hit is greater than {0}", 4, 0, 10));
                    ClearMenu.AddValue("LaneClear.W", new Slider("Use W if hit is greater than {0}", 3, 0, 10));
                    ClearMenu.AddValue("LaneClear.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("LastHit", new GroupLabel("LastHit"));
                {
                    ClearMenu.AddStringList("LastHit.Q", "Use Q", new[] { "Never", "Smartly", "Always" }, 1);
                    ClearMenu.AddValue("LastHit.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("JungleClear", new GroupLabel("JungleClear"));
                {
                    ClearMenu.AddValue("JungleClear.Q", new CheckBox("Use Q"));
                    ClearMenu.AddValue("JungleClear.W", new CheckBox("Use W"));
                    ClearMenu.AddValue("JungleClear.R", new CheckBox("Use R"));
                    ClearMenu.AddValue("JungleClear.ManaPercent", new Slider("Minimum Mana Percent", 20));
                }
            }

            MenuManager.AddKillStealMenu();
            {
                KillStealMenu.AddValue("Q", new CheckBox("Use Q"));
                KillStealMenu.AddValue("W", new CheckBox("Use W"));
                KillStealMenu.AddValue("R", new CheckBox("Use R"));
            }

            MenuManager.AddSubMenu("Automatic");
            {
                AutomaticMenu.AddValue("Gapcloser", new CheckBox("Use E on hero gapclosing / dashing"));
                AutomaticMenu.AddValue("Interrupter", new CheckBox("Use E on channeling spells"));
            }
            MenuManager.AddDrawingsMenu();
            {
                Q.AddDrawings();
                W.AddDrawings();
                E.AddDrawings(false);
                R.AddDrawings();
            }
        }
示例#18
0
        public Zed()
        {
            Q = new SpellBase(SpellSlot.Q, SpellType.Linear, 925)
            {
                CastDelay = 250,
                Speed     = 1700,
                Width     = 50
            };
            Q.SetSourceFunction(() => MyHero);
            Q.SetRangeCheckSourceFunction(() => MyHero);
            W = new SpellBase(SpellSlot.W, SpellType.Linear, WRange)
            {
                Speed = 1750,
                Width = 60
            };
            E = new SpellBase(SpellSlot.E, SpellType.Self, 280);
            E.SetSourceFunction(() => MyHero);
            E.SetRangeCheckSourceFunction(() => MyHero);
            R          = new SpellBase(SpellSlot.R, SpellType.Targeted, 625);
            IsDeadText = new Text("", new Font("Arial", 30F, FontStyle.Bold))
            {
                Color    = Color.Red,
                Position = new Vector2(100, 50)
            };
            Obj_AI_Base.OnBuffGain += delegate(Obj_AI_Base sender, Obj_AI_BaseBuffGainEventArgs args)
            {
                var minion = sender as Obj_AI_Minion;
                if (minion != null && minion.IsAlly && minion.BaseSkinName == ShadowSkinName && args.Buff.Caster.IsMe)
                {
                    switch (args.Buff.Name)
                    {
                    case "zedwshadowbuff":
                        WShadow = minion;
                        break;

                    case "zedrshadowbuff":
                        RShadow = minion;
                        break;
                    }
                }
            };
            Obj_AI_Base.OnPlayAnimation += delegate(Obj_AI_Base sender, GameObjectPlayAnimationEventArgs args)
            {
                var minion = sender as Obj_AI_Minion;
                if (minion != null && minion.IsAlly && minion.BaseSkinName == ShadowSkinName)
                {
                    if (args.Animation == "Death")
                    {
                        if (WShadow.IdEquals(minion))
                        {
                            WShadow = null;
                        }
                        else if (RShadow.IdEquals(minion))
                        {
                            RShadow = null;
                        }
                    }
                }
            };
            GameObject.OnCreate += delegate(GameObject sender, EventArgs args)
            {
                if (sender.Name == IsDeadName && RTarget != null && RTarget.IsInRange(sender, 200))
                {
                    IsDeadObject = sender;
                }
            };
            GameObject.OnDelete += delegate(GameObject sender, EventArgs args)
            {
                var minion = sender as Obj_AI_Minion;
                if (minion != null && minion.IsAlly && minion.BaseSkinName == ShadowSkinName)
                {
                    if (WShadow.IdEquals(minion))
                    {
                        WShadow = null;
                    }
                    else if (RShadow.IdEquals(minion))
                    {
                        RShadow = null;
                    }
                }
                else if (sender.IdEquals(IsDeadObject))
                {
                    IsDeadObject = null;
                }
            };
            Obj_AI_Base.OnProcessSpellCast += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (sender.IsMe)
                {
                    switch (args.Slot)
                    {
                    case SpellSlot.W:
                        if (args.SData.Name == "ZedW")
                        {
                            W.LastCastTime    = Core.GameTickCount;
                            W.LastEndPosition = args.End;
                        }
                        break;

                    case SpellSlot.R:
                        if (args.SData.Name == "ZedR")
                        {
                            MarkedDamageReceived = 0;
                            EnemyWillDie         = false;
                        }
                        break;
                    }
                }
            };
            Evader.OnEvader += delegate(EvaderArgs args)
            {
                var w1Distance = W.IsReady && IsW1 && EvaderMenu.CheckBox("Evader.W1")
                    ? MyHero.GetDistanceSqr(args.Sender)
                    : 16000000;
                var w2Distance = W.IsReady && WShadowIsValid && EvaderMenu.CheckBox("Evader.W2") &&
                                 !args.WillHitMyHero(WShadow.Position)
                    ? WShadow.GetDistanceSqr(args.Sender)
                    : 16000000;
                var rTarget    = TargetSelector.GetTarget(R.Range, DamageType.Physical) ?? args.Sender;
                var r1Distance = R.IsReady && IsR1 && rTarget != null && R.InRange(rTarget) &&
                                 EvaderMenu.CheckBox("Evader.R1")
                    ? MyHero.GetDistanceSqr(args.Sender)
                    : 16000000;
                var r2Distance = R.IsReady && RShadowIsValid && EvaderMenu.CheckBox("Evader.R2") &&
                                 !args.WillHitMyHero(RShadow.Position)
                    ? RShadow.GetDistanceSqr(args.Sender)
                    : 16000000;
                var min = Math.Min(w1Distance, Math.Min(w2Distance, Math.Min(r1Distance, r2Distance)));
                if (min < 16000000)
                {
                    if (Math.Abs(min - r2Distance) < float.Epsilon)
                    {
                        R.Cast();
                    }
                    else if (Math.Abs(min - r1Distance) < float.Epsilon)
                    {
                        R.Cast(rTarget);
                    }
                    else if (Math.Abs(min - w2Distance) < float.Epsilon)
                    {
                        W.Cast();
                    }
                    else if (Math.Abs(min - w1Distance) < float.Epsilon)
                    {
                        var wPos = MyHero.ServerPosition +
                                   ((args.Sender.ServerPosition - MyHero.ServerPosition).Normalized() * WRange)
                                   .To2D()
                                   .Perpendicular()
                                   .To3DWorld();
                        W.Cast(wPos);
                    }
                }
            };

            AttackableUnit.OnDamage += delegate(AttackableUnit sender, AttackableUnitDamageEventArgs args)
            {
                if (args.Source.IsMe)
                {
                    var hero = args.Target as AIHeroClient;
                    if (hero != null && TargetHaveR(hero))
                    {
                        MarkedDamageReceived += args.Damage;
                    }
                }
            };

            MenuManager.AddSubMenu("Keys");
            {
                Orbwalker.RegisterKeyBind(
                    KeysMenu.AddValue("Combo2", new KeyBind("Combo without R", false, KeyBind.BindTypes.HoldActive, 'A')),
                    Orbwalker.ActiveModes.Combo);
                Orbwalker.RegisterKeyBind(
                    KeysMenu.AddValue("Harass2", new KeyBind("Harass WEQ", false, KeyBind.BindTypes.HoldActive, 'S')),
                    Orbwalker.ActiveModes.Harass);
            }

            Q.AddConfigurableHitChancePercent();

            MenuManager.AddSubMenu("Combo");
            {
                ComboMenu.AddStringList("Mode", "R Combo Mode", new[] { "Line", "Triangle", "MousePos" });
                ComboMenu.AddValue("Q", new CheckBox("Use Q"));
                ComboMenu.AddValue("W", new CheckBox("Use W"));
                ComboMenu.AddValue("E", new CheckBox("Use E"));
                ComboMenu.AddValue("R", new CheckBox("Use R"));
                ComboMenu.AddValue("Items", new CheckBox("Use offensive items"));
                ComboMenu.AddValue("SwapDead", new CheckBox("Use W2/R2 if target will die"));
                ComboMenu.AddValue("SwapGapclose", new CheckBox("Use W2/R2 to get close to target"));
                ComboMenu.AddValue("SwapHP", new Slider("Use W2/R2 if my % of health is less than {0}", 15));
                ComboMenu.AddValue("Prevent", new CheckBox("Don't use spells before R"));
                if (EntityManager.Heroes.Enemies.Count > 0)
                {
                    ComboMenu.AddValue("BlackList.R", new GroupLabel("Don't use R on:"));
                    var enemiesAdded = new HashSet <string>();
                    foreach (var enemy in EntityManager.Heroes.Enemies)
                    {
                        if (!enemiesAdded.Contains(enemy.ChampionName))
                        {
                            ComboMenu.AddValue("BlackList." + enemy.ChampionName,
                                               new CheckBox(enemy.ChampionName, false));
                            enemiesAdded.Add(enemy.ChampionName);
                        }
                    }
                }
            }
            MenuManager.AddSubMenu("Harass");
            {
                HarassMenu.AddValue("Collision", new CheckBox("Check collision when casting Q (more damage)", false));
                HarassMenu.AddValue("WE", new CheckBox("Only harass when combo WE will hit", false));
                HarassMenu.AddValue("SwapGapclose", new CheckBox("Use W2 if target is killable"));
                HarassMenu.AddValue("ManaPercent", new Slider("Minimum Mana Percent", 20));
            }

            MenuManager.AddSubMenu("Clear");
            {
                ClearMenu.AddValue("LaneClear", new GroupLabel("LaneClear"));
                {
                    ClearMenu.AddValue("LaneClear.Q", new Slider("Use Q if hit is greater than {0}", 3, 0, 10));
                    ClearMenu.AddValue("LaneClear.W", new Slider("Use W if hit is greater than {0}", 4, 0, 10));
                    ClearMenu.AddValue("LaneClear.E", new Slider("Use E if hit is greater than {0}", 3, 0, 10));
                    ClearMenu.AddValue("LaneClear.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("LastHit", new GroupLabel("LastHit"));
                {
                    ClearMenu.AddStringList("LastHit.Q", "Use Q", new[] { "Never", "Smartly", "Always" }, 1);
                    ClearMenu.AddStringList("LastHit.E", "Use E", new[] { "Never", "Smartly", "Always" }, 1);
                    ClearMenu.AddValue("LastHit.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("JungleClear", new GroupLabel("JungleClear"));
                {
                    ClearMenu.AddValue("JungleClear.Q", new CheckBox("Use Q"));
                    ClearMenu.AddValue("JungleClear.W", new CheckBox("Use W"));
                    ClearMenu.AddValue("JungleClear.E", new CheckBox("Use E"));
                    ClearMenu.AddValue("JungleClear.ManaPercent", new Slider("Minimum Mana Percent", 20));
                }
            }

            MenuManager.AddKillStealMenu();
            {
                KillStealMenu.AddValue("Q", new CheckBox("Use Q"));
                KillStealMenu.AddValue("W", new CheckBox("Use W"));
                KillStealMenu.AddValue("E", new CheckBox("Use E"));
            }

            MenuManager.AddSubMenu("Automatic");
            {
                AutomaticMenu.AddValue("E", new CheckBox("Use E", false));
                AutomaticMenu.AddValue("SwapDead", new CheckBox("Use W2/R2 if target will die", false));
            }
            MenuManager.AddSubMenu("Evader");
            {
                EvaderMenu.AddValue("Evader.W1", new CheckBox("Use W1", false));
                EvaderMenu.AddValue("Evader.W2", new CheckBox("Use W2"));
                EvaderMenu.AddValue("Evader.R1", new CheckBox("Use R1"));
                EvaderMenu.AddValue("Evader.R2", new CheckBox("Use R2"));
            }
            Evader.Initialize();
            Evader.AddCrowdControlSpells();
            Evader.AddDangerousSpells();
            MenuManager.AddDrawingsMenu();
            {
                Q.AddDrawings();
                W.AddDrawings();
                E.AddDrawings(false);
                R.AddDrawings();
                CircleManager.Circles.Add(new Circle(
                                              DrawingsMenu.AddValue("W.Shadow", new CheckBox("Draw W shadow circle")), SharpDX.Color.Blue,
                                              () => 100, () => WShadowIsValid,
                                              () => WShadow)
                {
                    Width = 1
                });

                CircleManager.Circles.Add(new Circle(
                                              DrawingsMenu.AddValue("R.Shadow", new CheckBox("Draw R shadow circle")), SharpDX.Color.Orange,
                                              () => 100, () => RShadowIsValid,
                                              () => RShadow)
                {
                    Width = 1
                });
                DrawingsMenu.AddValue("IsDead", new CheckBox("Draw text if target will die"));
                DrawingsMenu.AddValue("Passive", new CheckBox("Draw text when passive is available"));
            }
        }
示例#19
0
        private void CastQ(Obj_AI_Base target)
        {
            PredictionResult prediction;

            if (ObjectManager.Player.Distance(target) < Q1.Range)
            {
                var oldrange = Q1.Range;
                Q1.Range   = Q2.Range;
                prediction = Q1.GetPrediction(target, true);
                Q1.Range   = oldrange;
            }
            else if (ObjectManager.Player.Distance(target) < Q2.Range)
            {
                var oldrange = Q2.Range;
                Q2.Range   = Q3.Range;
                prediction = Q2.GetPrediction(target, true);
                Q2.Range   = oldrange;
            }
            else if (ObjectManager.Player.Distance(target) < Q3.Range)
            {
                prediction = Q3.GetPrediction(target, true);
            }
            else
            {
                return;
            }

            if (prediction.HitChance >= HitChance.High)
            {
                if (ObjectManager.Player.ServerPosition.Distance(prediction.CastPosition) <= Q1.Range + Q1.Width())
                {
                    Vector3 p;
                    if (ObjectManager.Player.ServerPosition.Distance(prediction.CastPosition) > 300)
                    {
                        p = prediction.CastPosition -
                            100 *
                            (prediction.CastPosition.To2D() - ObjectManager.Player.ServerPosition.To2D()).Normalized()
                            .To3D();
                    }
                    else
                    {
                        p = prediction.CastPosition;
                    }

                    Q1.Cast(p);
                }
                else if (ObjectManager.Player.ServerPosition.Distance(prediction.CastPosition) <= ((Q1.Range + Q2.Range) / 2))
                {
                    var p = ObjectManager.Player.ServerPosition.To2D().Extend(prediction.CastPosition.To2D(), Q1.Range - 100);

                    if (!CheckQCollision(target, prediction.UnitPosition, p.To3D()))
                    {
                        Q1.Cast(p.To3D());
                    }
                }
                else
                {
                    var p = ObjectManager.Player.ServerPosition.To2D() +
                            Q1.Range *
                            (prediction.CastPosition.To2D() - ObjectManager.Player.ServerPosition.To2D()).Normalized
                                ();

                    if (!CheckQCollision(target, prediction.UnitPosition, p.To3D()))
                    {
                        Q1.Cast(p.To3D());
                    }
                }
            }
        }
示例#20
0
        public Jhin()
        {
            foreach (var enemy in EntityManager.Heroes.Enemies)
            {
                TextsInScreen.Add(enemy.NetworkId, new Text(enemy.ChampionName + " is R killable", new Font("Arial", 30F, FontStyle.Bold))
                {
                    Color = Color.Red
                });
                TextsInHeroPosition.Add(enemy.NetworkId, new Text("R killable", new Font("Arial", 23F, FontStyle.Bold))
                {
                    Color = Color.Red
                });
                LastPredictedPositionText.Add(enemy.NetworkId, new Text(enemy.ChampionName + " last predicted position", new Font("Arial", 23F, FontStyle.Bold))
                {
                    Color = Color.Red
                });
            }
            Q = new SpellBase(SpellSlot.Q, SpellType.Targeted, 600)
            {
                Width     = 450,
                Speed     = 1800,
                CastDelay = 250,
            };
            W = new SpellBase(SpellSlot.W, SpellType.Linear, 2500)
            {
                Width                 = 40,
                CastDelay             = 750,
                Speed                 = 5000,
                AllowedCollisionCount = -1,
            };
            E = new SpellBase(SpellSlot.E, SpellType.Circular, 750)
            {
                Width     = 135,
                CastDelay = 250,
                Speed     = 1600,
            };
            R = new SpellBase(SpellSlot.R, SpellType.Linear, 3500)
            {
                Width                 = 65,
                CastDelay             = 250,
                Speed                 = 5000,
                AllowedCollisionCount = -1,
            };
            Evader.OnEvader += delegate
            {
                if (EvaderMenu.CheckBox("BlockW"))
                {
                    LastBlockTick = Core.GameTickCount;
                }
            };

            Spellbook.OnCastSpell += delegate(Spellbook sender, SpellbookCastSpellEventArgs args)
            {
                if (sender.Owner.IsMe)
                {
                    if (args.Slot == SpellSlot.W)
                    {
                        args.Process = Core.GameTickCount - LastBlockTick > 750;
                    }
                }
            };
            Obj_AI_Base.OnProcessSpellCast += delegate(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
            {
                if (sender.IsMe)
                {
                    switch (args.Slot)
                    {
                    case SpellSlot.W:
                        W.LastCastTime    = Core.GameTickCount;
                        W.LastEndPosition = args.End;
                        break;

                    case SpellSlot.R:
                        if (args.SData.Name == "JhinR")
                        {
                            IsCastingR = true;
                            LastRCone  = new Geometry.Polygon.Sector(sender.Position, args.End, (float)(45 * 2f * Math.PI / 175f), R.Range);
                            Stacks     = 4;
                        }
                        else if (args.SData.Name == "JhinRShot")
                        {
                            R.LastCastTime = Core.GameTickCount;
                            TapKeyPressed  = false;
                            Stacks--;
                        }
                        break;
                    }
                }
            };
            Gapcloser.OnGapcloser += delegate(AIHeroClient sender, Gapcloser.GapcloserEventArgs args)
            {
                if (sender.IsValidTarget(E.Range) && sender.IsEnemy)
                {
                    if (MyHero.Distance(args.Start, true) > MyHero.Distance(args.End))
                    {
                        if (AutomaticMenu.CheckBox("E.Gapcloser") && MyHero.IsInRange(args.End, E.Range) && E.IsReady)
                        {
                            E.Cast(args.End);
                        }
                        if (MyHero.Distance(args.End, true) < (sender.GetAutoAttackRange(MyHero) * 1.5f).Pow())
                        {
                            WShouldWaitTick = Core.GameTickCount;
                        }
                    }
                }
            };

            MenuManager.AddSubMenu("Keys");
            {
                KeysMenu.AddValue("TapKey", new KeyBind("R Tap Key", false, KeyBind.BindTypes.HoldActive, 'T')).OnValueChange +=
                    delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                {
                    if (args.NewValue && R.IsLearned && (R.IsReady || IsCastingR) && R.EnemyHeroes.Count > 0)
                    {
                        TapKeyPressed = true;
                    }
                };
                KeysMenu.AddValue("UltKey", new KeyBind("R Key in game", false, KeyBind.BindTypes.HoldActive, 'R')).OnValueChange +=
                    delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                {
                    if (args.NewValue && R.IsLearned && (R.IsReady || IsCastingR))
                    {
                        Player.IssueOrder(GameObjectOrder.Stop, Player.Instance.ServerPosition);
                    }
                };
                ToggleManager.RegisterToggle(
                    KeysMenu.AddValue("AutoW",
                                      new KeyBind("AutoW Toggle", false, KeyBind.BindTypes.PressToggle, 'K')),
                    delegate
                {
                    foreach (var enemy in UnitManager.ValidEnemyHeroes.Where(TargetHaveEBuff))
                    {
                        if (MiscMenu.CheckBox("AutoW." + enemy.ChampionName))
                        {
                            CastW(enemy);
                        }
                    }
                });
            }

            W.AddConfigurableHitChancePercent();
            R.AddConfigurableHitChancePercent();

            MenuManager.AddSubMenu("Combo");
            {
                ComboMenu.AddValue("Q", new CheckBox("Use Q"));
                ComboMenu.AddValue("W", new CheckBox("Use W", false));
                ComboMenu.AddValue("E", new CheckBox("Use E", false));
                ComboMenu.AddValue("Items", new CheckBox("Use offensive items"));
            }
            MenuManager.AddSubMenu("Ultimate");
            {
                UltimateMenu.AddStringList("Mode", "R AIM Mode", new[] { "Disabled", "Using TapKey", "Automatic" }, 3);
                UltimateMenu.AddValue("OnlyKillable", new CheckBox("Only attack if it's killable", false));
                UltimateMenu.AddValue("Delay", new Slider("Delay between R's (in ms)", 0, 0, 1500));
                UltimateMenu.AddValue("NearMouse", new GroupLabel("Near Mouse Settings"));
                UltimateMenu.AddValue("NearMouse.Enabled", new CheckBox("Only select target near mouse", false));
                UltimateMenu.AddValue("NearMouse.Radius", new Slider("Near mouse radius", 500, 100, 1500));
                UltimateMenu.AddValue("NearMouse.Draw", new CheckBox("Draw near mouse radius"));
            }
            MenuManager.AddSubMenu("Harass");
            {
                HarassMenu.AddValue("Q", new CheckBox("Use Q"));
                HarassMenu.AddValue("W", new CheckBox("Use W", false));
                HarassMenu.AddValue("E", new CheckBox("Use E", false));
                HarassMenu.AddValue("ManaPercent", new Slider("Minimum Mana Percent", 20));
            }

            MenuManager.AddSubMenu("Clear");
            {
                ClearMenu.AddValue("LaneClear", new GroupLabel("LaneClear"));
                {
                    ClearMenu.AddValue("LaneClear.Q", new Slider("Use Q if hit is greater than {0}", 5, 0, 10));
                    ClearMenu.AddValue("LaneClear.W", new Slider("Use W if hit is greater than {0}", 6, 0, 10));
                    ClearMenu.AddValue("LaneClear.E", new Slider("Use E if hit is greater than {0}", 5, 0, 10));
                    ClearMenu.AddValue("LaneClear.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("LastHit", new GroupLabel("LastHit"));
                {
                    ClearMenu.AddStringList("LastHit.Q", "Use Q", new[] { "Never", "Smartly", "Always" }, 1);
                    ClearMenu.AddValue("LastHit.ManaPercent", new Slider("Minimum Mana Percent", 50));
                }
                ClearMenu.AddValue("JungleClear", new GroupLabel("JungleClear"));
                {
                    ClearMenu.AddValue("JungleClear.Q", new CheckBox("Use Q"));
                    ClearMenu.AddValue("JungleClear.W", new CheckBox("Use W", false));
                    ClearMenu.AddValue("JungleClear.E", new CheckBox("Use E", false));
                    ClearMenu.AddValue("JungleClear.ManaPercent", new Slider("Minimum Mana Percent", 20));
                }
            }

            MenuManager.AddKillStealMenu();
            {
                KillStealMenu.AddValue("Q", new CheckBox("Use Q"));
                KillStealMenu.AddValue("Qmin", new CheckBox("Use Q On Minions"));
                KillStealMenu.AddValue("W", new CheckBox("Use W"));
                KillStealMenu.AddValue("E", new CheckBox("Use E", false));
                KillStealMenu.AddValue("R", new CheckBox("Use R"));
            }

            MenuManager.AddSubMenu("Automatic");
            {
                AutomaticMenu.AddValue("E.Gapcloser", new CheckBox("Use E on hero gapclosing / dashing"));
                AutomaticMenu.AddValue("Immobile", new CheckBox("Use E on hero immobile"));
                AutomaticMenu.AddValue("Buffed", new CheckBox("Use W on hero with buff"));
            }
            MenuManager.AddSubMenu("Evader");
            {
                EvaderMenu.AddValue("BlockW", new CheckBox("Block W to Evade"));
            }
            Evader.Initialize();
            Evader.AddCrowdControlSpells();
            Evader.AddDangerousSpells();
            MenuManager.AddSubMenu("Misc");
            {
                MiscMenu.AddValue("Champions", new GroupLabel("Allowed champions to use Auto W"));
                foreach (var enemy in EntityManager.Heroes.Enemies)
                {
                    MiscMenu.AddValue("AutoW." + enemy.ChampionName, new CheckBox(enemy.ChampionName));
                }
            }
            MenuManager.AddDrawingsMenu();
            {
                Q.AddDrawings(false);
                W.AddDrawings();
                E.AddDrawings(false);
                R.AddDrawings();
                DrawingsMenu.AddValue("Toggles", new CheckBox("Draw toggles status"));
                DrawingsMenu.AddValue("R.Killable", new CheckBox("Draw text if target is r killable"));
                DrawingsMenu.AddValue("R.LastPredictedPosition", new CheckBox("Draw last predicted position"));
            }
        }
示例#21
0
        public override void useSpells()
        {
            var target = ARAMTargetSelector.getBestTarget(_humanW.Range);

            if (target == null)
            {
                return;                 //buffelisecocoon
            }
            CheckSpells();
            var qdmg = player.GetSpellDamage(target, SpellSlot.Q);
            var wdmg = player.GetSpellDamage(target, SpellSlot.W);

            if (_human)
            {
                if (target.Distance(player.Position) < _humanE.Range && _humanE.IsReady())
                {
                    if (_humanE.GetPrediction(target).HitChance >= HitChance.High)
                    {
                        _humanE.Cast(target);
                    }
                }

                if (player.Distance(target) <= _humanQ.Range && _humanQ.IsReady())
                {
                    _humanQ.Cast(target);
                }
                if (player.Distance(target) <= _humanW.Range && _humanW.IsReady())
                {
                    _humanW.Cast(target);
                }
                if (!_humanQ.IsReady() && !_humanW.IsReady() && !_humanE.IsReady() && _r.IsReady())
                {
                    _r.Cast();
                }
                if (!_humanQ.IsReady() && !_humanW.IsReady() && player.Distance(target) <= _spiderQ.Range && _r.IsReady())
                {
                    _r.Cast();
                }
            }
            if (!_spider)
            {
                return;
            }
            if (player.Distance(target) <= _spiderQ.Range && _spiderQ.IsReady())
            {
                _spiderQ.Cast(target);
            }
            if (player.Distance(target) <= 200 && _spiderW.IsReady())
            {
                _spiderW.Cast();
            }
            if (player.Distance(target) <= _spiderE.Range && player.Distance(target) > _spiderQ.Range && _spiderE.IsReady() && !_spiderQ.IsReady())
            {
                if ((safeGap(target)) || target.Distance(ARAMSimulator.fromNex.Position, true) < player.Distance(ARAMSimulator.fromNex.Position, true))
                {
                    _spiderE.Cast(target);
                }
            }
            if (player.Distance(target) > _spiderQ.Range && !_spiderE.IsReady() && _r.IsReady() && !_spiderQ.IsReady())
            {
                _r.Cast();
            }
            if (_humanQ.IsReady() && _humanW.IsReady() && _r.IsReady())
            {
                _r.Cast();
            }
            if (_humanQ.IsReady() && _humanW.IsReady() && _r.IsReady())
            {
                _r.Cast();
            }
            if ((_humanQ.IsReady() && qdmg >= target.Health || _humanW.IsReady() && wdmg >= target.Health))
            {
                _r.Cast();
            }

            Core.DelayAction(() => Player.IssueOrder(GameObjectOrder.AttackUnit, target), 100);
        }