Пример #1
0
 public virtual bool InAutoAttackRange(AttackableUnit target)
 {
     return(Orbwalking.InAutoAttackRange(target));
 }
Пример #2
0
        public bool ShouldWaitForMinion(float delay)
        {
            var minionListAA = ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget() &&
                                                                         minion.Team != GameObjectTeam.Neutral && Orbwalking.InAutoAttackRange(minion) && MinionManager.IsMinion(minion, false));

            var minionsAlly = ObjectManager.Get <Obj_AI_Minion>().Where(minion => !minion.IsDead &&
                                                                        minion.IsAlly && minion.Distance(Player) < 600 && MinionManager.IsMinion(minion, false));

            int countAlly = minionsAlly.Count();

            if (minionListAA.Count() == 1 && countAlly > 3 && minionListAA.Any(x => x.Health < Player.TotalAttackDamage * 2))
            {
                return(true);
            }

            if (countAlly > 2 && minionListAA.Any(x => x.IsMoving && x.Health < Player.TotalAttackDamage * 2))
            {
                return(true);
            }

            var   t = (int)(Player.AttackCastDelay * 1000) - 20 + 1000 * (int)Math.Max(0, 500) / (int)Orbwalking.GetMyProjectileSpeed();
            float laneClearDelay = delay * 1000 + t;

            return
                (ObjectManager.Get <Obj_AI_Minion>()
                 .Any(
                     minion =>
                     minion.IsValidTarget() && minion.Team != GameObjectTeam.Neutral &&
                     Orbwalking.InAutoAttackRange(minion) && MinionManager.IsMinion(minion, false) &&
                     HealthPrediction.LaneClearHealthPrediction(minion, (int)(laneClearDelay), 0) <= Player.GetAutoAttackDamage(minion)));
        }
Пример #3
0
        /// <summary>
        /// Fired when the game processes a spell cast.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="GameObjectProcessSpellCastEventArgs"/> instance containing the event data.</param>
        private static void ObjAiBaseOnOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.Team != ObjectManager.Player.Team || !sender.IsValidTargetLS(3000, false) || !Orbwalking.IsAutoAttackLS(args.SData.Name) || !(args.Target is Obj_AI_Base))
            {
                return;
            }

            var target = (Obj_AI_Base)args.Target;

            ActiveAttacks.Remove(sender.NetworkId);

            var attackData = new PredictedDamage(
                sender,
                target,
                sender.ServerPosition,
                Utils.GameTimeTickCount - Game.Ping / 2,
                sender.AttackCastDelay * 1000,
                sender.AttackDelay * 1000 - (sender is Obj_AI_Turret ? 70 : 0),
                sender.IsMelee ? int.MaxValue : (int)args.SData.MissileSpeed,
                (float)sender.GetAutoAttackDamage(target, true));

            ActiveAttacks.Add(sender.NetworkId, attackData);
        }
Пример #4
0
 private static void farmE()
 {
     if (Program.LaneClear && getCheckBoxItem(FarmMenu, "farmE") && Player.Mana > QMANA + EMANA + WMANA && !Orbwalking.CanAttack() && Player.ManaPercent > getSliderItem(FarmMenu, "Mana"))
     {
         var minions = Cache.GetMinions(Player.ServerPosition, E.Range);
         foreach (var minion in minions.Where(minion => minion.Health > Player.LSGetAutoAttackDamage(minion)))
         {
             var eDmg = E.GetDamage(minion) * 2;
             if (minion.Health < eDmg && minion.HasBuff("chilled"))
             {
                 E.Cast(minion);
             }
         }
     }
 }