コード例 #1
0
        private static float CalculateE_DmgOnUnit(Obj_AI_Base target)
        {
            if (!ArgsE.IsReady() || !target.HasBuff("TwitchDeadlyVenom"))
            {
                return(0.0f);
            }

            var currentstacks = CountEStacks(target);

            var dmgg = Player.Instance.CalculateDamageOnUnit(target, DamageType.Physical,
                                                             ArgsEBaseDmg[ArgsE.Level] +
                                                             currentstacks *
                                                             (Player.Instance.FlatMagicDamageMod * ArgsEApMod + Player.Instance.FlatPhysicalDamageMod * ArgsEAdMod +
                                                              ArgsEDmgPerStack[ArgsE.Level])
                                                             );

            if (!CalcPassive || target.Type == GameObjectType.obj_AI_Minion)
            {
                return(dmgg);
            }

            PassiveLvlReq.First(sw => sw.Key(Player.Instance.Level)).Value();
            dmgg += ArgsPassiveDmg[_passivemod] * currentstacks * 6;

            return(dmgg);
        }
コード例 #2
0
        public static float GetFinalEDamage(Obj_AI_Base target)
        {
            if (!ArgsE.IsReady() || !target.HasBuff("TwitchDeadlyVenom"))
            {
                return(0f);
            }

            var damage = CalculateE_DmgOnUnit(target);

            if (target.Name.Contains("Baron"))
            {
                damage = Player.Instance.HasBuff("barontarget") ? damage * 0.5f : damage;
            }

            else if (target.Name.Contains("Dragon"))
            {
                damage = Player.Instance.HasBuff("s5test_dragonslayerbuff") ? damage * (1 - (.07f * Player.Instance.GetBuffCount("s5test_dragonslayerbuff"))) : damage;
            }

            if (Player.Instance.HasBuff("summonerexhaust"))
            {
                damage = damage * 0.6f;
            }

            if (target.HasBuff("FerociousHowl"))
            {
                damage = damage * 0.7f;
            }

            return(damage);
        }
コード例 #3
0
 private static void Event_OnUnkillableMinion(Obj_AI_Base unit, Orbwalker.UnkillableMinionArgs args)
 {
     if (!Minionunkillable || !ArgsE.IsReady() || !unit.HasBuff("TwitchDeadlyVenom") || CountEnemiesInRange(ArgsE.Range) > 0)
     {
         return;
     }
     ArgsE.Cast();
 }
コード例 #4
0
        private static void Execute(Modes args)
        {
            switch (args)
            {
            case Modes.Combo:
            {
                var target = TargetSelector.GetTarget(ArgsE.Range, DamageType.Physical);

                if (target == null)
                {
                    return;
                }

                if (_canusebotrk && Botrk.IsReady() && Botrk.IsInRange(target) && target.IsValidTarget(Botrk.Range))
                {
                    Botrk.Cast(target);
                    _canusebotrk = false;
                }

                if (WInCombo && _combo["WMode"].Cast <ComboBox>().CurrentValue == 1 && _aacancelpossible && ArgsW.IsReady() && ArgsW.IsInRange(target) &&
                    Player.Instance.Mana > 120)
                {
                    var wPrediction = ArgsW.GetPrediction(target);
                    if (wPrediction.HitChance >= HitChance.Medium)
                    {
                        ArgsW.Cast(wPrediction.CastPosition);
                    }
                }
                else if (WInCombo && _combo["WMode"].Cast <ComboBox>().CurrentValue == 0 && ArgsW.IsReady() &&
                         ArgsW.IsInRange(target) &&
                         Player.Instance.Mana > 120)
                {
                    var wPrediction = ArgsW.GetPrediction(target);
                    if (wPrediction.HitChance >= HitChance.Medium)
                    {
                        ArgsW.Cast(wPrediction.CastPosition);
                    }
                }
                if (UseeInCombo && ArgsE.IsReady() && ArgsE.IsInRange(target) && CountEStacks(target) >= EInCombo && CanUseEOnEnemy(target.BaseSkinName))
                {
                    ArgsE.Cast();
                }

                if (UseRInCombo && CountEnemiesInRange(ArgsR.Range - 150) >= MinEnemiesForR && ArgsR.IsReady())
                {
                    ArgsR.Cast();
                }

                break;
            }

            case Modes.Flee:
            {
                if (ArgsQ.IsReady())
                {
                    ArgsQ.Cast();
                }

                break;
            }

            case Modes.Harass:
            {
                if (HarassW && ArgsW.IsReady())
                {
                    var t =
                        EntityManager.Heroes.Enemies.OrderByDescending(a => a.TotalAttackDamage)
                        .FirstOrDefault(a => a.IsValidTarget(ArgsW.Range));

                    if (t == null)
                    {
                        return;
                    }

                    var wPrediction = ArgsW.GetPrediction(t);

                    if (wPrediction.HitChance >= HitChance.Medium)
                    {
                        ArgsW.Cast(wPrediction.CastPosition);
                    }
                }
                break;
            }

            case Modes.JungleClear:
            {
                if (!ArgsW.IsReady())
                {
                    return;
                }

                var minionw = EntityManager.MinionsAndMonsters.GetJungleMonsters(Player.Instance.ServerPosition,
                                                                                 ArgsW.Range);
                var wfarm = EntityManager.MinionsAndMonsters.GetCircularFarmLocation(minionw, ArgsW.Width,
                                                                                     (int)ArgsW.Range);

                ArgsW.Cast(wfarm.CastPosition);

                break;
            }

            case Modes.LaneClear:
            {
                if (LaneClearW && ArgsW.IsReady() && Player.Instance.ManaPercent >= LaneClearManaPercentW)
                {
                    var minionw = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
                                                                                  Player.Instance.Position, ArgsW.Range);

                    var wfarm = EntityManager.MinionsAndMonsters.GetCircularFarmLocation(minionw, ArgsW.Width,
                                                                                         (int)ArgsW.Range);

                    if (wfarm.HitNumber >= 3)
                    {
                        ArgsW.Cast(wfarm.CastPosition);
                    }
                }
                if (LaneClearE && ArgsE.IsReady() && Player.Instance.ManaPercent >= LaneClearManaPercentE)
                {
                    var minione = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
                                                                                  Player.Instance.Position, ArgsE.Range).Where(
                        a => a.IsValidTarget() && a.HasBuff("twitchdeadlyvenom"));

                    var objAiMinions = minione as IList <Obj_AI_Minion> ?? minione.ToList();
                    if (objAiMinions.Count >= LaneClearEMin && !LaneClearEKillable)
                    {
                        ArgsE.Cast();
                        break;
                    }
                    if (LaneClearEKillable && objAiMinions.Count(a => a.Health <= CalculateE_DmgOnUnit(a)) >= LaneClearEMin)
                    {
                        ArgsE.Cast();
                    }
                }
                break;
            }

            case Modes.LastHit:
            {
                break;
            }

            default:
                throw new ArgumentOutOfRangeException(nameof(args), args, null);
            }
        }
コード例 #5
0
        private static void Drawing_OnEndScene(EventArgs args)
        {
            if (DrawQTime && ArgsQ.IsLearned || ArgsR.IsLearned)
            {
                var qbuff = Player.Instance.GetBuff("TwitchHideInShadows");
                var rbuff = Player.Instance.GetBuff("TwitchUlt");
                if (qbuff != null)
                {
                    var percentage = 100 * Math.Max(0, qbuff.EndTime - Game.Time) / ArgsInvisTime[ArgsQ.Level];

                    var g = Math.Max(0, 255f / 100f * percentage);
                    var r = Math.Max(0, 255 - g);

                    var color = Color.FromArgb((int)r, (int)g, 0);

                    InfoText.Color     = color;
                    InfoText.X         = (int)Drawing.WorldToScreen(Player.Instance.Position).X;
                    InfoText.Y         = (int)Drawing.WorldToScreen(Player.Instance.Position).Y;
                    InfoText.TextValue = "Q expiry time : " + Math.Max(0, qbuff.EndTime - Game.Time).ToString("F1");
                    InfoText.Draw();
                }
                if (rbuff != null)
                {
                    var percentage = 100 * Math.Max(0, rbuff.EndTime - Game.Time) / 5;

                    var g = Math.Max(0, 255f / 100f * percentage);
                    var r = Math.Max(0, 255 - g);

                    var color = Color.FromArgb((int)r, (int)g, 0);

                    InfoText.Color     = color;
                    InfoText.X         = (int)Drawing.WorldToScreen(Player.Instance.Position).X;
                    InfoText.Y         = (int)Drawing.WorldToScreen(Player.Instance.Position).Y;
                    InfoText.TextValue = "\nR expiry time : " + Math.Max(0, rbuff.EndTime - Game.Time).ToString("F1");
                    InfoText.Draw();
                }
            }


            if (!DrawTextNearHpBar)
            {
                return;
            }

            foreach (
                var enemy in
                EntityManager.Heroes.Enemies.Where(
                    a => !a.IsDead && a.HasBuff("twitchdeadlyvenom") && a.IsHPBarRendered && a.IsValidTarget(ArgsE.Range)))
            {
                var stacks = CountEStacks(enemy);

                if (ArgsE.IsReady())
                {
                    var calc = GetFinalEDamage(enemy) / GetTotalHealth(enemy) * 100;

                    InfoText.Color     = Color.DeepSkyBlue;
                    InfoText.X         = (int)(enemy.HPBarPosition.X + 140);
                    InfoText.Y         = (int)enemy.HPBarPosition.Y;
                    InfoText.TextValue = "" + Math.Min(calc, 100).ToString("F1") + " %";
                    InfoText.Draw();
                }

                if (stacks < 1)
                {
                    continue;
                }
                for (var i = 0; i < 6; i++)
                {
                    Drawing.DrawLine(enemy.HPBarPosition.X + i * 20, enemy.HPBarPosition.Y - 30, enemy.HPBarPosition.X + i * 20 + 20,
                                     enemy.HPBarPosition.Y - 30, 10, stacks <= i ? Color.DarkGray : Color.MediumVioletRed);
                }
            }
        }
コード例 #6
0
        private static void Event_Game_OnTick(EventArgs args)
        {
            if (Player.Instance.IsDead)
            {
                return;
            }

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                Execute(Modes.Combo);
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Flee))
            {
                Execute(Modes.Flee);
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                Execute(Modes.Harass);
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
            {
                Execute(Modes.JungleClear);
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
            {
                Execute(Modes.LaneClear);
            }
            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit))
            {
                Execute(Modes.LastHit);
            }

            if (!ArgsE.IsReady())
            {
                return;
            }

            foreach (var t in EntityManager.Heroes.Enemies.Where(
                         enemy => enemy.IsValid && enemy.HasBuff("twitchdeadlyvenom") && enemy.IsValidTarget(ArgsE.Range) && CanUseEOnEnemy(enemy.BaseSkinName)))
            {
                if (ERange && CountEStacks(t) >= ERangeStacks &&
                    t.Distance(Player.Instance.ServerPosition) >= ArgsE.Range - 200)
                {
                    ArgsE.Cast();
                }
                if (EBeforeDeath && Player.Instance.HealthPercent <= EHealthPercent)
                {
                    ArgsE.Cast();
                }
                if (EKillsteal && IsEnemyKillable(t))
                {
                    ArgsE.Cast();
                }
                if (PassiveTime(t) < 0.5f && CountEStacks(t) >= 3)
                {
                    ArgsE.Cast();
                }
            }

            if (!JangleSteal)
            {
                return;
            }

            var monster =
                EntityManager.MinionsAndMonsters.GetJungleMonsters()
                .FirstOrDefault(
                    a =>
                    a.IsValidTarget(ArgsE.Range) && a.HasBuff("twitchdeadlyvenom") && a.Health <= CalculateE_DmgOnUnit(a));

            if (monster == null)
            {
                return;
            }

            if ((monster.BaseSkinName == "SRU_Baron" || monster.BaseSkinName == "SRU_Dragon") && EBaronDrake)
            {
                ArgsE.Cast();
            }
            if ((monster.BaseSkinName == "SRU_Red" || monster.BaseSkinName == "SRU_Blue") && JangleSteal)
            {
                ArgsE.Cast();
            }
        }