コード例 #1
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                if (this.SpellObject == null)
                {
                    return;
                }

                var spellQ = new SpellQ();
                if (spellQ.SpellObject.IsCharging)
                {
                    return;
                }

                var target = Misc.GetTarget(this.Range + this.Width, this.DamageType);
                if (target != null)
                {
                    if (MyMenu.RootMenu.Item("comboealways").IsActive() ||
                        this.SpellObject.IsKillable(target) ||
                        Misc.GetWStacks(target) >= MyMenu.RootMenu.Item("comboew.count").GetValue <Slider>().Value ||
                        HeroManager.Enemies.Count(x => x.IsValidTarget(this.Range + this.Width)) >= MyMenu.RootMenu.Item("comboe.count.hit").GetValue <Slider>().Value)
                    {
                        this.SpellObject.Cast(target, aoe: true);
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellE.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }
コード例 #2
0
        /// <summary>
        ///     The on mixed callback.
        /// </summary>
        internal override void OnMixed()
        {
            var spellQ = new SpellQ();

            if (spellQ.SpellObject.IsCharging)
            {
                return;
            }

            var target = Misc.GetTarget(this.Range + this.Width, this.DamageType);

            if (target != null)
            {
                if (this.SpellObject.IsCharging ||
                    MyMenu.RootMenu.Item("mixedeusealways").IsActive() ||
                    Misc.GetWStacks(target) >= MyMenu.RootMenu.Item("mixedeusealways.count").GetValue <Slider>().Value)
                {
                    var prediction = this.SpellObject.GetPrediction(target);
                    if (prediction.Hitchance >= HitChance.VeryHigh)
                    {
                        this.SpellObject.Cast(prediction.CastPosition);
                    }
                }
            }
        }
コード例 #3
0
        /// <summary>
        ///     The on combo callback.
        /// </summary>
        internal override void OnCombo()
        {
            try
            {
                if (this.SpellObject == null)
                {
                    return;
                }

                var spellQ = new SpellQ();
                if (spellQ.SpellObject.IsCharging)
                {
                    return;
                }

                var target = Misc.GetTarget(this.Range + this.Width, this.DamageType);
                if (target != null)
                {
                    if (MyMenu.RootMenu.Item("combousersolo").IsActive())
                    {
                        if (target.HealthPercent
                            < MyMenu.RootMenu.Item("combor.count.solo").GetValue <Slider>().Value)
                        {
                            var enemiesCount =
                                HeroManager.Enemies.Count(
                                    h =>
                                    h.IsValid && !h.IsDead && h.IsVisible && h.NetworkId != target.NetworkId &&
                                    h.Distance(
                                        ObjectManager.Player.Position.Extend(
                                            target.Position,
                                            ObjectManager.Player.Distance(target) / 2f)) <= MyMenu.RootMenu.Item("combor.r.enmies.range").GetValue <Slider>().Value);

                            if (enemiesCount > MyMenu.RootMenu.Item("combor.count.enemies").GetValue <Slider>().Value&& !MyMenu.RootMenu.Item("combo" + target.CharData.BaseSkinName + "use").IsActive())
                            {
                                return;
                            }

                            this.SpellObject.Cast(target);
                        }
                    }

                    if (MyMenu.RootMenu.Item("combousermultiple").IsActive())
                    {
                        var spreadRadius = MyMenu.RootMenu.Item("combor.r.radius").GetValue <Slider>().Value;
                        var enemiesHit   = HeroManager.Enemies.Where(e => e.Distance(target) <= spreadRadius && !e.IsDead).ToList();
                        if (enemiesHit.Count >= MyMenu.RootMenu.Item("combor.count").GetValue <Slider>().Value)
                        {
                            this.SpellObject.Cast(target);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryTrype.Error, "@SpellR.cs: Can not run OnCombo - {0}", e);
                throw;
            }
        }