예제 #1
0
 public static void OnUpdate()
 {
     if (Core.Config._Items.Force == null || !Core.Config._Items.Force.CanBeCasted)
     {
         return;
     }
     foreach (Hero hero in EntityManager <Hero> .Entities.Where <Hero>((Func <Hero, bool>)(x =>
     {
         if (x.Team != Core.Config._Hero.Team && !x.IsIllusion)
         {
             return(TargetChecker.ForcePreCheck(x));
         }
         return(false);
     })))
     {
         Vector3 _Pos = hero.InFront(600f);
         if (hero.IsLinkensProtected())
         {
             if (Core.Config._Items.Hex != null && Core.Config._Items.Hex.IsReady && (double)Core.Config._Items.Hex.CastRange >= (double)Core.Config._Hero.Distance2D((Unit)hero, false))
             {
                 if (ForceLogic.ShouldDetonate(hero, _Pos) || ForceLogic.ShouldDetonateLand(hero, _Pos) || ForceLogic.ShouldDetonateCross(hero, _Pos))
                 {
                     Core.Config._Items.Hex.UseAbility((Unit)hero);
                     break;
                 }
             }
             else if (Core.Config._Items.Eul != null && Core.Config._Items.Eul.IsReady && (double)Core.Config._Items.Eul.CastRange >= (double)Core.Config._Hero.Distance2D((Unit)hero, false))
             {
                 if (ForceLogic.ShouldDetonate(hero, _Pos) || ForceLogic.ShouldDetonateLand(hero, _Pos) || ForceLogic.ShouldDetonateCross(hero, _Pos))
                 {
                     Core.Config._Items.Eul.UseAbility((Unit)hero);
                     break;
                 }
             }
             else if (Core.Config._Items.Salo != null && Core.Config._Items.Salo.IsReady && (double)Core.Config._Items.Salo.CastRange >= (double)Core.Config._Hero.Distance2D((Unit)hero, false))
             {
                 if (ForceLogic.ShouldDetonate(hero, _Pos) || ForceLogic.ShouldDetonateLand(hero, _Pos) || ForceLogic.ShouldDetonateCross(hero, _Pos))
                 {
                     Core.Config._Items.Salo.UseAbility((Unit)hero);
                     break;
                 }
             }
             else if (Core.Config._Items.Salo2 != null && Core.Config._Items.Salo2.IsReady && (double)Core.Config._Items.Salo2.CastRange >= (double)Core.Config._Hero.Distance2D((Unit)hero, false))
             {
                 if (ForceLogic.ShouldDetonate(hero, _Pos) || ForceLogic.ShouldDetonateLand(hero, _Pos) || ForceLogic.ShouldDetonateCross(hero, _Pos))
                 {
                     Core.Config._Items.Salo2.UseAbility((Unit)hero);
                     break;
                 }
             }
             else if (Core.Config._Items.Etherial != null && Core.Config._Items.Etherial.IsReady && (double)Core.Config._Items.Etherial.CastRange >= (double)Core.Config._Hero.Distance2D((Unit)hero, false))
             {
                 if (ForceLogic.ShouldDetonate(hero, _Pos) || ForceLogic.ShouldDetonateLand(hero, _Pos) || ForceLogic.ShouldDetonateCross(hero, _Pos))
                 {
                     Core.Config._Items.Etherial.UseAbility((Unit)hero);
                     break;
                 }
             }
             else
             {
                 Item dagon = DagonManager.GetDagon();
                 if ((Entity)dagon != (Entity)null && (double)dagon.Cooldown == 0.0 && (double)dagon.CastRange >= (double)Core.Config._Hero.Distance2D((Unit)hero, false) && (ForceLogic.ShouldDetonate(hero, _Pos) || ForceLogic.ShouldDetonateLand(hero, _Pos) || ForceLogic.ShouldDetonateCross(hero, _Pos)))
                 {
                     Core.Config._Items.Dagon1.UseAbility((Unit)hero);
                     break;
                 }
             }
         }
         else if (ForceLogic.ShouldDetonate(hero, _Pos) || ForceLogic.ShouldDetonateLand(hero, _Pos) || ForceLogic.ShouldDetonateCross(hero, _Pos))
         {
             Core.Config._Items.Force.UseAbility((Unit)hero);
             break;
         }
     }
 }
예제 #2
0
        private static async Task SingleDetonationAsync(Hero _Enemy, BombStack _Stack)
        {
            int _Detonated;
            int _NtK;

            List <RemoteBomb> .Enumerator enumerator;

            List <RemoteBomb> list = Core.Config._RemoteBombs.Where <RemoteBomb>((Func <RemoteBomb, bool>)(x =>
            {
                if (x.IsHit(_Enemy))
                {
                    return((double)x._Unit.Distance2D(_Stack._Unit, false) <= 100.0);
                }
                return(false);
            })).OrderBy <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Unit.CreateTime)).ToList <RemoteBomb>();

            _NtK = DamageManager.NeedToKill(_Enemy, list);
            if (list.Count < _NtK)
            {
                return;
            }
            _Detonated = 0;
            if (Core.Config._Menu.DamageHelpersMenu.UseEtherial && Core.Config._Items.Etherial != null && (Core.Config._Items.Etherial.CanBeCasted && (double)Core.Config._Hero.Distance2D((Unit)_Enemy, false) <= (double)Core.Config._Items.Etherial.CastRange))
            {
                Core.Config._Items.Etherial.UseAbility((Unit)_Enemy);
                Sleeper.Sleep(_Enemy.Name, 0.6f);
                return;
            }
            enumerator = list.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    RemoteBomb B = enumerator.Current;
                    if (_Enemy.HasModifier("modifier_eul_cyclone"))
                    {
                        Sleeper.Sleep(_Enemy.Name, 200f);
                        break;
                    }
                    bool  flag     = false;
                    Item  itemById = _Enemy.GetItemById(AbilityId.item_aeon_disk);
                    float num2     = (float)_Enemy.Health - (float)_Enemy.MaximumHealth * 0.8f;
                    if ((Entity)itemById != (Entity)null && (double)itemById.Cooldown == 0.0 && (double)_Enemy.Health > (double)num2)
                    {
                        flag = true;
                    }
                    if (!flag)
                    {
                        if (Core.Config._Menu.DamageHelpersMenu.UseVeil)
                        {
                            item_veil_of_discord veil = Core.Config._Items.Veil;
                            if (veil != null && veil.CanBeCasted && (double)Core.Config._Hero.Distance2D((Unit)_Enemy, false) < (double)veil.CastRange)
                            {
                                veil.UseAbility(_Enemy.Position);
                                await Task.Delay(50);
                            }
                        }
                        if (Core.Config._Menu.DamageHelpersMenu.UseDagon)
                        {
                            Item dagon = DagonManager.GetDagon();
                            if ((Entity)dagon != (Entity)null && (double)dagon.Cooldown == 0.0 && (double)Core.Config._Hero.Distance2D((Unit)_Enemy, false) < (double)dagon.CastRange)
                            {
                                dagon.UseAbility((Unit)_Enemy);
                                await Task.Delay(50);
                            }
                        }
                    }
                    if (!_Enemy.HasModifier("modifier_black_king_bar_immune"))
                    {
                        B.Detonate();
                        ++_Detonated;
                        if (_Detonated < _NtK)
                        {
                            B = (RemoteBomb)null;
                        }
                        else
                        {
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
            finally
            {
                enumerator.Dispose();
            }
            enumerator = new List <RemoteBomb> .Enumerator();

            Core.Config.Log.Warn("DetonateOnStack Single " + (object)_Enemy);
            Sleeper.Sleep(_Enemy.Name, 1f);
        }