Пример #1
0
        private static float GetRDamage(AIHeroClient target)
        {
            if (target == null)
            {
                return(0f);
            }

            var units    = new List <Obj_AI_Base>();
            var maxdist  = ProSeries.Player.Distance(target.ServerPosition) > 750;
            var maxrdist = ProSeries.Config.Item("maxrdist", true).GetValue <Slider>().Value;

            // impact physical damage
            var idmg = R.IsReady() &&
                       ProSeries.CountInPath(ProSeries.Player.ServerPosition, target.ServerPosition, R.Width + 50,
                                             (maxrdist * 2), out units) <= 1
                ? (maxdist ? R.GetDamage(target, 1) : R.GetDamage(target, 0))
                : 0;

            // explosion damage
            var edmg = R.IsReady() &&
                       ProSeries.CountInPath(ProSeries.Player.ServerPosition, target.ServerPosition, R.Width + 50,
                                             (maxrdist * 2), out units) > 1 &&
                       target.Distance(units.OrderBy(x => x.Distance(ProSeries.Player.ServerPosition))
                                       .First(t => t.NetworkId != target.NetworkId).ServerPosition) <= R.Width + 100 // explosion radius? :^)
                ? (maxdist
                    ? (float)                                                                                        // maximum explosion dmage
                   (ProSeries.Player.CalcDamage(target, Damage.DamageType.Physical,
                                                new double[] { 160, 224, 288 }[R.Level - 1] +
                                                new double[] { 20, 24, 28 }[R.Level - 1] / 100 * (target.MaxHealth - target.Health) +
                                                0.8 * ProSeries.Player.FlatPhysicalDamageMod))
                    : (float) // minimum explosion damage
                   (ProSeries.Player.CalcDamage(target, Damage.DamageType.Physical,
                                                new double[] { 20, 28, 36 }[R.Level - 1] +
                                                new double[] { 20, 24, 28 }[R.Level - 1] / 100 * (target.MaxHealth - target.Health) +
                                                0.08 * ProSeries.Player.FlatPhysicalDamageMod)))
                : 0;

            return(idmg + edmg);
        }
Пример #2
0
        internal static void Game_OnUpdate(EventArgs args)
        {
            if (ProSeries.CanCombo())
            {
                var wtarget = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                if (wtarget.IsValidTarget() && W.IsReady())
                {
                    if (ProSeries.Config.Item("usecombow", true).GetValue <bool>())
                    {
                        W.Cast(wtarget);
                    }
                }
            }

            if (ProSeries.CanHarass())
            {
                var wtarget = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);
                if (wtarget.IsValidTarget() && W.IsReady() && ProSeries.IsWhiteListed(wtarget))
                {
                    if (ProSeries.Config.Item("useharassw", true).GetValue <bool>())
                    {
                        W.Cast(wtarget);
                    }
                }
            }

            if (W.IsReady())
            {
                foreach (var target in ObjectManager.Get <AIHeroClient>().Where(h => h.IsValidTarget(W.Range)))
                {
                    if (ProSeries.Config.Item("usewimm", true).GetValue <bool>())
                    {
                        W.CastIfHitchanceEquals(target, HitChance.Immobile);
                    }

                    if (ProSeries.Config.Item("usewdash", true).GetValue <bool>())
                    {
                        W.CastIfHitchanceEquals(target, HitChance.Dashing);
                    }
                }
            }

            if (ProSeries.CanCombo() || ProSeries.Config.Item("usesemir", true).GetValue <KeyBind>().Active)
            {
                var maxDistance = ProSeries.Config.Item("maxrdist", true).GetValue <Slider>().Value;
                foreach (var target in ObjectManager.Get <AIHeroClient>().Where(h => h.IsValidTarget(maxDistance)))
                {
                    var aaDamage = Orbwalking.InAutoAttackRange(target)
                        ? ProSeries.Player.GetAutoAttackDamage(target, true)
                        : 0;

                    if (!target.IsZombie && R.IsReady() &&
                        (ProSeries.Player.GetSpellDamage(target, SpellSlot.R) >= target.Health - aaDamage ||
                         ProSeries.Config.Item("usesemir", true).GetValue <KeyBind>().Active))
                    {
                        var units = new List <Obj_AI_Base>();
                        if (ProSeries.CountInPath(ProSeries.Player.ServerPosition,
                                                  target.ServerPosition, R.Width, maxDistance, out units) <= 1)
                        {
                            R.Cast(target);
                        }
                    }
                }
            }
        }