Exemplo n.º 1
0
        private static void ReBindStacker(Unit _Bomb)
        {
            BombStack _Stacker = Config._BombStacks.FirstOrDefault <BombStack>((Func <BombStack, bool>)(x => (int)x._Unit.Handle == (int)_Bomb.Handle));

            if (_Stacker == null)
            {
                return;
            }
            RemoteBomb _NewUnit = Config._RemoteBombs.Where <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit != (Entity)_Bomb)).MinOrDefault <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Unit.Distance2D(_Stacker._Unit, false)));

            if (_NewUnit != null && (double)_NewUnit._Unit.Distance2D(_Stacker._Unit, false) < 100.0)
            {
                if (!Config._BombStacks.Where <BombStack>((Func <BombStack, bool>)(x => x.Id != _Stacker.Id)).Any <BombStack>((Func <BombStack, bool>)(x => (double)x._Unit.Distance2D(_NewUnit._Unit, false) <= 100.0)))
                {
                    _Stacker._Unit = _NewUnit._Unit;
                }
                else
                {
                    Config._BombStacks.Remove(_Stacker);
                }
            }
            else
            {
                Config._BombStacks.Remove(_Stacker);
            }
        }
Exemplo n.º 2
0
 private static void Detonate(LandBomb IvS)
 {
     foreach (BombStack bombStack in Core.Config._BombStacks)
     {
         BombStack _Stack = bombStack;
         if (_Stack.DetonateOnHeroes == 1)
         {
             int num = 0;
             List <RemoteBomb> list = Core.Config._RemoteBombs.Where <RemoteBomb>((Func <RemoteBomb, bool>)(x =>
             {
                 if (x.IsHit(IvS._Unit.Position))
                 {
                     return((double)x._Unit.Distance2D(_Stack._Unit, false) <= 100.0);
                 }
                 return(false);
             })).OrderBy <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Unit.CreateTime)).ToList <RemoteBomb>();
             foreach (Hero _Enemy in EntityManager <Hero> .Entities.Where <Hero>((Func <Hero, bool>)(x =>
             {
                 if (x.Team != Core.Config._Hero.Team && !x.IsIllusion && (!x.IsVisible && x.IsAlive))
                 {
                     return(x.IsValid);
                 }
                 return(false);
             })))
             {
                 int kill = DamageManager.NeedToKill(_Enemy, list);
                 if (list.Count >= kill && num < kill)
                 {
                     num = kill;
                 }
             }
             if (num > 0)
             {
                 Core.Config.Log.Warn("DetonateOnStack Invisible");
                 InvisibleDetonationLogic.LastDetonate = Game.RawGameTime;
                 foreach (RemoteBomb remoteBomb in list)
                 {
                     if (num > 0)
                     {
                         remoteBomb.Detonate();
                         --num;
                     }
                     else
                     {
                         break;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
        public static bool CheckPos(Hero _Enemy, BombStack _Stack)
        {
            int num   = 0;
            int index = -1;

            foreach (string heroesFullName in Core.Config._HeroesFullNames)
            {
                if (heroesFullName == _Enemy.Name)
                {
                    index = num;
                    break;
                }
                ++num;
            }
            return(index != -1 && !_Stack._Disabler[index]);
        }
Exemplo n.º 4
0
 public static void OnUpdate()
 {
     foreach (BombStack bombStack in Core.Config._BombStacks.Where <BombStack>((Func <BombStack, bool>)(x => x.Creeps)))
     {
         BombStack Stack = bombStack;
         if ((double)((IEnumerable <Unit>)EntityManager <Unit> .Entities.Where <Unit>((Func <Unit, bool>)(x =>
         {
             if (x.Team != Core.Config._Hero.Team && x.IsAlive && (x.IsVisibleToEnemies && (double)x.Distance2D(Stack._Unit, false) <= 425.0))
             {
                 return(x.ClassId != ClassId.CDOTA_BaseNPC_Creep_Lane);
             }
             return(false);
         })).ToArray <Unit>()).Count <Unit>() >= (double)Core.Config._Menu.DetonationMenu.CreepMenu.CreepsLimit.Value)
         {
             Core.Config._RemoteBombs.First <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit == (Entity)Stack._Unit)).Detonate();
             Core.Config.Log.Warn("Detonate Creeps");
         }
     }
     foreach (BombStack bombStack in Core.Config._BombStacks.Where <BombStack>((Func <BombStack, bool>)(x => x.Necro)))
     {
         BombStack Stack = bombStack;
         if ((double)EntityManager <Unit> .Entities.Where <Unit>((Func <Unit, bool>)(x =>
         {
             if (x.Team != Core.Config._Hero.Team && x.IsAlive && (x.IsVisibleToEnemies && x.Name.Contains("necronomicon")))
             {
                 return((double)x.Distance2D(Stack._Unit, false) <= 425.0);
             }
             return(false);
         })).ToArray <Unit>().Length >= (double)Core.Config._Menu.DetonationMenu.CreepMenu.NecroLimit.Value)
         {
             Core.Config._RemoteBombs.First <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit == (Entity)Stack._Unit)).Detonate();
             Core.Config.Log.Warn("Detonate Necro");
         }
     }
     foreach (BombStack bombStack in Core.Config._BombStacks.Where <BombStack>((Func <BombStack, bool>)(x => x.Manta)))
     {
         BombStack Stack = bombStack;
         if ((double)EntityManager <Hero> .Entities.Where <Hero>((Func <Hero, bool>)(x =>
         {
             if (x.IsIllusion && x.Team != Core.Config._Hero.Team && (x.IsAlive && x.IsVisibleToEnemies) && ((double)x.Distance2D(Stack._Unit, false) <= 425.0 && x.IsControllable))
             {
                 return(!x.HasModifier("modifier_vengefulspirit_command_aura_illusion"));
             }
             return(false);
         })).ToArray <Hero>().Length >= (double)Core.Config._Menu.DetonationMenu.CreepMenu.MantaLimit.Value)
         {
             Core.Config._RemoteBombs.First <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit == (Entity)Stack._Unit)).Detonate();
             Core.Config.Log.Warn("Detonate Manta");
         }
     }
     foreach (BombStack bombStack in Core.Config._BombStacks.Where <BombStack>((Func <BombStack, bool>)(x => x.HeroCreeps)))
     {
         BombStack Stack = bombStack;
         if (Core.Config._Menu.DetonationMenu.HeroCreepMenu.Brood && (double)EntityManager <Unit> .Entities.Where <Unit>((Func <Unit, bool>)(x =>
         {
             if (x.Team != Core.Config._Hero.Team && x.IsAlive && (x.IsVisibleToEnemies && (double)x.Distance2D(Stack._Unit, false) <= 425.0))
             {
                 return(x.ClassId == ClassId.CDOTA_Unit_Broodmother_Spiderling);
             }
             return(false);
         })).ToArray <Unit>().Length >= (double)Core.Config._Menu.DetonationMenu.HeroCreepMenu.BroodLimit.Value)
         {
             RemoteBomb remoteBomb = Core.Config._RemoteBombs.First <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit == (Entity)Stack._Unit));
             Core.Config.Log.Warn("Detonate CreepBrood");
             remoteBomb.Detonate();
         }
         if (Core.Config._Menu.DetonationMenu.HeroCreepMenu.Furion && (double)EntityManager <Unit> .Entities.Where <Unit>((Func <Unit, bool>)(x =>
         {
             if (x.Team != Core.Config._Hero.Team && x.IsAlive && (x.IsVisibleToEnemies && (double)x.Distance2D(Stack._Unit, false) <= 425.0))
             {
                 return(x.Name == "npc_dota_furion_treant");
             }
             return(false);
         })).ToArray <Unit>().Length >= (double)Core.Config._Menu.DetonationMenu.HeroCreepMenu.FurionLimit.Value)
         {
             RemoteBomb remoteBomb = Core.Config._RemoteBombs.First <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit == (Entity)Stack._Unit));
             Core.Config.Log.Warn("Detonate CreepFurion");
             remoteBomb.Detonate();
         }
         if (Core.Config._Menu.DetonationMenu.HeroCreepMenu.Enigma && (double)EntityManager <Unit> .Entities.Where <Unit>((Func <Unit, bool>)(x =>
         {
             if (x.Team != Core.Config._Hero.Team && x.IsAlive && (x.IsVisibleToEnemies && (double)x.Distance2D(Stack._Unit, false) <= 425.0))
             {
                 return(x.Name.ToString().Contains("eidolon"));
             }
             return(false);
         })).ToArray <Unit>().Length >= (double)Core.Config._Menu.DetonationMenu.HeroCreepMenu.EnigmaLimit.Value)
         {
             RemoteBomb remoteBomb = Core.Config._RemoteBombs.First <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit == (Entity)Stack._Unit));
             Core.Config.Log.Warn("Detonate CreepEnigma");
             remoteBomb.Detonate();
         }
     }
 }
Exemplo n.º 5
0
 private static bool ShouldDetonate(Hero _Enemy, Vector3 _Pos)
 {
     foreach (BombStack bombStack in Core.Config._BombStacks)
     {
         BombStack _Stack = bombStack;
         if (!TargetChecker.CheckPos(_Enemy, _Stack))
         {
             return(false);
         }
         if (_Stack.DetonateOnHeroes == 1)
         {
             List <RemoteBomb> list = Core.Config._RemoteBombs.Where <RemoteBomb>((Func <RemoteBomb, bool>)(x =>
             {
                 if (x.IsHit(_Pos))
                 {
                     return((double)x._Unit.Distance2D(_Stack._Unit, false) <= 100.0);
                 }
                 return(false);
             })).OrderBy <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Unit.CreateTime)).ToList <RemoteBomb>();
             int kill = DamageManager.NeedToKill(_Enemy, list);
             if (list.Count >= kill)
             {
                 return(true);
             }
         }
         else
         {
             int num = 0;
             Core.Config._RemoteBombs.Where <RemoteBomb>((Func <RemoteBomb, bool>)(x => (double)x._Unit.Distance2D(_Stack._Unit, false) <= 100.0)).OrderBy <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Unit.CreateTime));
             foreach (Hero _Enemy1 in EntityManager <Hero> .Entities.Where <Hero>((Func <Hero, bool>)(x =>
             {
                 if (x.Team != Core.Config._Hero.Team && !x.IsIllusion && TargetChecker.ForcePreCheck(x))
                 {
                     return(TargetChecker.CheckPos(x, _Stack));
                 }
                 return(false);
             })))
             {
                 List <RemoteBomb> list = Core.Config._RemoteBombs.Where <RemoteBomb>((Func <RemoteBomb, bool>)(x =>
                 {
                     if (x.IsHit(_Pos))
                     {
                         return((double)x._Unit.Distance2D(_Stack._Unit, false) <= 100.0);
                     }
                     return(false);
                 })).OrderBy <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Unit.CreateTime)).ToList <RemoteBomb>();
                 List <RemoteBomb> _Bombs = list;
                 int kill = DamageManager.NeedToKill(_Enemy1, _Bombs);
                 if (list.Count >= kill)
                 {
                     ++num;
                 }
             }
             if (num >= _Stack.DetonateOnHeroes)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 6
0
        private static bool ShouldDetonateCross(Hero _Enemy, Vector3 _Pos)
        {
            if (!TargetChecker.PreCheck(_Enemy))
            {
                return(false);
            }
            float num1 = DamageManager._LandDemage(_Enemy);

            if (Core.Config._StasisBombs.Any <StasisBomb>((Func <StasisBomb, bool>)(x => (double)x._Unit.Distance2D(_Pos) <= 400.0)))
            {
                float num2  = (float)Core.Config._LandBombs.Count <LandBomb>((Func <LandBomb, bool>)(x => (double)x._Unit.Distance2D(_Pos) <= 400.0)) * num1;
                int   num3  = 0;
                int   index = -1;
                foreach (string heroesFullName in Core.Config._HeroesFullNames)
                {
                    if (heroesFullName == _Enemy.Name)
                    {
                        index = num3;
                        break;
                    }
                    ++num3;
                }
                RemoteBomb[]        array  = Core.Config._RemoteBombs.Where <RemoteBomb>((Func <RemoteBomb, bool>)(x => x.IsHit(_Pos))).ToArray <RemoteBomb>();
                List <EnterInStack> source = new List <EnterInStack>();
                foreach (RemoteBomb remoteBomb in array)
                {
                    RemoteBomb B     = remoteBomb;
                    BombStack  _Temp = Core.Config._BombStacks.MinOrDefault <BombStack, float>((Func <BombStack, float>)(x => B._Unit.Distance2D(x._Unit, false)));
                    if (_Temp != null && (double)_Temp._Unit.Distance2D(B._Unit, false) <= 100.0 && (index == -1 ? 1 : (_Temp._Disabler[index] ? 1 : 0)) == 0)
                    {
                        if (source.Any <EnterInStack>((Func <EnterInStack, bool>)(x => x.Stack.Id == _Temp.Id)))
                        {
                            if (!source.Any <EnterInStack>((Func <EnterInStack, bool>)(x => x.Bombs.Any <RemoteBomb>((Func <RemoteBomb, bool>)(y => (Entity)y._Unit == (Entity)B._Unit)))))
                            {
                                source.First <EnterInStack>((Func <EnterInStack, bool>)(x => x.Stack.Id == _Temp.Id)).Bombs.Add(B);
                            }
                        }
                        else
                        {
                            EnterInStack enterInStack = new EnterInStack()
                            {
                                Bombs = new List <RemoteBomb>(),
                                Stack = _Temp
                            };
                            enterInStack.Bombs.Add(B);
                            source.Add(enterInStack);
                        }
                    }
                }
                float num4 = 0.0f;
                foreach (EnterInStack enterInStack in source)
                {
                    if (enterInStack.Stack.DetonateOnHeroes == 1)
                    {
                        float num5 = enterInStack.Bombs.Sum <RemoteBomb>((Func <RemoteBomb, float>)(x => x._Damage)) * (1f - Core.Config._QSpell.GetDamageReduction((Unit)_Enemy));
                        if ((double)num4 < (double)num5)
                        {
                            num4 = num5;
                        }
                    }
                }
                if ((double)num2 + (double)num4 > (double)_Enemy.Health + (double)_Enemy.HealthRegeneration * 2.0)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 7
0
 public static async Task OnUpdateAsync()
 {
     try
     {
         List <BombStack> .Enumerator enumerator;
         enumerator = Core.Config._BombStacks.GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 BombStack _Stack = enumerator.Current;
                 if (_Stack.DetonateOnHeroes == 1)
                 {
                     if (Core.Config._Menu.Features.UseOldHeroSelector)
                     {
                         foreach (Hero _Enemy in Heroes.GetByTeam(Team.Dire == Core.Config._Hero.Team ? Team.Dire : Team.Radiant).Where <Hero>((Func <Hero, bool>)(x =>
                         {
                             if (!x.IsIllusion && TargetChecker.PreCheck(x) && TargetChecker.CheckPos(x, _Stack))
                             {
                                 return(!TargetChecker.CanCounter(x));
                             }
                             return(false);
                         })))
                         {
                             await DetonationLogic.SingleDetonationAsync(_Enemy, _Stack);
                         }
                     }
                     else
                     {
                         foreach (Hero _Enemy in EntityManager <Hero> .Entities.Where <Hero>((Func <Hero, bool>)(x =>
                         {
                             if (x.Team != Core.Config._Hero.Team && !x.IsIllusion && (TargetChecker.PreCheck(x) && TargetChecker.CheckPos(x, _Stack)))
                             {
                                 return(!TargetChecker.CanCounter(x));
                             }
                             return(false);
                         })))
                         {
                             await DetonationLogic.SingleDetonationAsync(_Enemy, _Stack);
                         }
                     }
                 }
                 else
                 {
                     int           num2       = 0;
                     int           num3       = 0;
                     List <string> stringList = new List <string>();
                     IOrderedEnumerable <RemoteBomb> orderedEnumerable = Core.Config._RemoteBombs.Where <RemoteBomb>((Func <RemoteBomb, bool>)(x => (double)x._Unit.Distance2D(_Stack._Unit, false) <= 100.0)).OrderBy <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Unit.CreateTime));
                     if (Core.Config._Menu.Features.UseOldHeroSelector)
                     {
                         foreach (Hero hero in Heroes.GetByTeam(Team.Dire == Core.Config._Hero.Team ? Team.Dire : Team.Radiant).Where <Hero>((Func <Hero, bool>)(x =>
                         {
                             if (!x.IsIllusion && TargetChecker.PreCheck(x) && TargetChecker.CheckPos(x, _Stack))
                             {
                                 return(!TargetChecker.CanCounter(x));
                             }
                             return(false);
                         })))
                         {
                             Hero _Enemy            = hero;
                             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>();
                             int kill = DamageManager.NeedToKill(_Enemy, list);
                             if (list.Count >= kill)
                             {
                                 if (kill > num3 && kill < 100)
                                 {
                                     num3 = kill;
                                 }
                                 ++num2;
                                 stringList.Add(_Enemy.Name);
                             }
                         }
                     }
                     else
                     {
                         foreach (Hero hero in EntityManager <Hero> .Entities.Where <Hero>((Func <Hero, bool>)(x =>
                         {
                             if (x.Team != Core.Config._Hero.Team && !x.IsIllusion && (TargetChecker.PreCheck(x) && TargetChecker.CheckPos(x, _Stack)))
                             {
                                 return(!TargetChecker.CanCounter(x));
                             }
                             return(false);
                         })))
                         {
                             Hero _Enemy            = hero;
                             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>();
                             int kill = DamageManager.NeedToKill(_Enemy, list);
                             if (list.Count >= kill)
                             {
                                 if (kill > num3 && kill < 100)
                                 {
                                     num3 = kill;
                                 }
                                 ++num2;
                                 stringList.Add(_Enemy.Name);
                             }
                         }
                     }
                     if (num2 >= _Stack.DetonateOnHeroes)
                     {
                         foreach (string Name in stringList)
                         {
                             Sleeper.Sleep(Name, 1f);
                         }
                         int num4 = 0;
                         Core.Config.Log.Warn("DetonateOnStack Multi");
                         foreach (RemoteBomb remoteBomb in (IEnumerable <RemoteBomb>)orderedEnumerable)
                         {
                             remoteBomb.Detonate();
                             ++num4;
                             if (num4 >= num3)
                             {
                                 break;
                             }
                         }
                     }
                 }
             }
         }
         finally
         {
             enumerator.Dispose();
         }
         enumerator = new List <BombStack> .Enumerator();
     }
     catch (Exception ex)
     {
         Core.Config.Log.Error(ex.ToString());
     }
 }
Exemplo n.º 8
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);
        }