Esempio n. 1
0
        public static void RemoveBomb(Unit _Bomb, BombType _Type)
        {
            switch (_Type)
            {
            case BombType.Stasis:
                StasisBomb stasisBomb = Config._StasisBombs.FirstOrDefault <StasisBomb>((Func <StasisBomb, bool>)(x => (Entity)x._Unit == (Entity)_Bomb));
                if (stasisBomb == null)
                {
                    break;
                }
                if (Config._ParticleManager.HasParticle(stasisBomb._Unit.Handle.ToString()))
                {
                    Config._ParticleManager.Remove(stasisBomb._Unit.Handle.ToString());
                }
                IParticleManager particleManager1 = Config._ParticleManager;
                string           str1             = "st";
                uint             handle           = stasisBomb._Unit.Handle;
                string           str2             = handle.ToString();
                string           name1            = str1 + str2;
                if (particleManager1.HasParticle(name1))
                {
                    IParticleManager particleManager2 = Config._ParticleManager;
                    string           str3             = "st";
                    handle = stasisBomb._Unit.Handle;
                    string str4  = handle.ToString();
                    string name2 = str3 + str4;
                    particleManager2.Remove(name2);
                }
                Config._StasisBombs.Remove(stasisBomb);
                break;

            case BombType.Land:
                LandBomb landBomb = Config._LandBombs.FirstOrDefault <LandBomb>((Func <LandBomb, bool>)(x => (Entity)x._Unit == (Entity)_Bomb));
                if (landBomb == null)
                {
                    break;
                }
                if (Config._ParticleManager.HasParticle(landBomb._Unit.Handle.ToString()))
                {
                    Config._ParticleManager.Remove(landBomb._Unit.Handle.ToString());
                }
                Config._LandBombs.Remove(landBomb);
                BombManager.ReBindLandStacker(_Bomb);
                break;

            case BombType.Remote:
                RemoteBomb remoteBomb = Config._RemoteBombs.FirstOrDefault <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit == (Entity)_Bomb));
                if (remoteBomb == null)
                {
                    break;
                }
                if (Config._ParticleManager.HasParticle(remoteBomb._Unit.Handle.ToString()))
                {
                    Config._ParticleManager.Remove(remoteBomb._Unit.Handle.ToString());
                }
                Config._RemoteBombs.Remove(remoteBomb);
                BombManager.ReBindStacker(_Bomb);
                break;
            }
        }
Esempio n. 2
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);
            }
        }
 void Start()
 {
     this.rb      = GetComponent <Rigidbody2D>();
     this.anim    = GetComponent <Animator>();
     this.health  = GetComponent <Health>();
     this.recover = GetComponent <Recover>();
     this.walk    = GetComponent <Walk>();
     this.dodge   = GetComponent <Dodge>();
     this.rapid   = GetComponent <RapidShot>();
     this.bomb    = GetComponent <RemoteBomb>();
 }
Esempio n. 4
0
 public static void OnUpdate()
 {
     if (!Config._Menu.Features.DetonateOnHit)
     {
         return;
     }
     foreach (RemoteBomb remoteBomb in Config._RemoteBombs)
     {
         RemoteBomb B = remoteBomb;
         try
         {
             KeyValuePair <Unit, double> keyValuePair = Config._EnemyAttakers.Where(x =>
             {
                 if (x.Key.IsAlive)
                 {
                     return(x.Key.IsInAttackRange(B._Unit, 0.0f));
                 }
                 return(false);
             }).OrderBy(x => x.Key.FindRelativeAngle(B._Unit.Position)).FirstOrDefault();
             if (keyValuePair.Key != null)
             {
                 if (B._Unit.DamageTaken(keyValuePair.Key.MaximumDamage + keyValuePair.Key.BonusDamage, DamageType.Physical, keyValuePair.Key, false, 0.0, 0.0, 0.0) >= (double)B._Unit.Health)
                 {
                     if (Game.RawGameTime >= (double)Ensage.Common.Extensions.UnitExtensions.AttackPoint(keyValuePair.Key) / 2.0 + keyValuePair.Value)
                     {
                         if (EntityManager <Unit> .Entities.Count(x =>
                         {
                             if (x.Team != Config._Hero.Team)
                             {
                                 return(x.Distance2D(B._Unit, false) <= 400.0);
                             }
                             return(false);
                         }) >= 1)
                         {
                             B._Unit.Spellbook.Spell1.UseAbility();
                         }
                     }
                 }
             }
         }
         catch (Exception)
         {
         }
     }
 }
Esempio n. 5
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();
         }
     }
 }
Esempio 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);
        }
Esempio n. 7
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);
        }
        public static async Task OnUpdateTask(CancellationToken cancellationToken)
        {
            switch (EULComboLogic._Status)
            {
            case 0:
                if ((double)Core.Config._ESpell.Cooldown != 0.0 || (double)Core.Config._WSpell.Cooldown != 0.0 || !Core.Config._Items.Eul.CanBeCasted)
                {
                    await Task.Delay(100);

                    break;
                }
                EULComboLogic._Enemy = (Hero)Core.Config._TargetSelector.Active.GetTargets().FirstOrDefault <Unit>((Func <Unit, bool>)(x => (double)x.Distance2D((Unit)Core.Config._Hero, false) <= (double)(Core.Config._ESpell.CastRange + 300U)));
                if ((Entity)EULComboLogic._Enemy == (Entity)null || (double)DamageManager._SuicideDemage(EULComboLogic._Enemy) < 100.0)
                {
                    break;
                }
                EULComboLogic._JPos  = !EULComboLogic._Enemy.IsMoving ? EULComboLogic._Enemy.Position : EULComboLogic._Enemy.InFront(1.75f * (float)EULComboLogic._Enemy.MovementSpeed);
                EULComboLogic._JTime = Game.RawGameTime;
                Core.Config._ESpell.UseAbility(EULComboLogic._JPos);
                EULComboLogic._Status   = 1;
                EULComboLogic._S2Switch = false;
                await Task.Delay(50);

                break;

            case 1:
                if (!Core.Config._ESpell.IsInAbilityPhase && (double)Core.Config._ESpell.Cooldown != 0.0 && EULComboLogic._S2Switch)
                {
                    EULComboLogic._InitHP = (float)Core.Config._Hero.Health;
                    EULComboLogic._Status = 2;
                }
                EULComboLogic._S2Switch = true;
                if ((double)EULComboLogic._JTime + 0.75 < (double)Game.RawGameTime)
                {
                    if (EULComboLogic._Enemy.IsMoving)
                    {
                        if ((double)EULComboLogic._Enemy.InFront(1.75f * (float)EULComboLogic._Enemy.MovementSpeed).Distance2D(EULComboLogic._JPos, false) > 200.0)
                        {
                            Core.Config._Hero.Stop();
                            EULComboLogic._Status = 0;
                        }
                    }
                    else if ((double)EULComboLogic._Enemy.Distance2D(EULComboLogic._JPos) > 200.0)
                    {
                        Core.Config._Hero.Stop();
                        EULComboLogic._Status = 0;
                    }
                }
                await Task.Delay(50);

                break;

            case 2:
                if ((double)EULComboLogic._InitHP > (double)EULComboLogic._InitHP / 1.5)
                {
                    await Task.Delay(50);
                }
                EULComboLogic._Status = 3;
                break;

            case 3:
                if (Core.Config._Items.Eul.CanBeCasted)
                {
                    Core.Config._Items.Eul.UseAbility((Unit)EULComboLogic._Enemy);
                    break;
                }
                if (Core.Config._Menu.EULComboMenu.UseLand && (double)Core.Config._QSpell.Cooldown == 0.0)
                {
                    Core.Config._QSpell.UseAbility(Core.Config._Hero.Position);
                    break;
                }
                if ((double)Core.Config._WSpell.Cooldown == 0.0 && !Core.Config._WSpell.IsInAbilityPhase)
                {
                    Core.Config._WSpell.UseAbility(Core.Config._Hero.Position);
                    break;
                }
                if (Core.Config._Menu.EULComboMenu.UseRemote && (double)Core.Config._RSpell.Cooldown == 0.0 && !Core.Config._RSpell.IsInAbilityPhase)
                {
                    Core.Config._RSpell.UseAbility(Core.Config._Hero.Position);
                    break;
                }
                EULComboLogic._Status = 4;
                break;

            case 4:
                if (Core.Config._Menu.EULComboMenu.UseRemote)
                {
                    if (EULComboLogic._Enemy.HasModifier("modifier_eul_cyclone"))
                    {
                        break;
                    }
                    await Task.Delay(100);

                    RemoteBomb remoteBomb = Core.Config._RemoteBombs.FirstOrDefault <RemoteBomb>((Func <RemoteBomb, bool>)(x => x.IsHit(EULComboLogic._Enemy)));
                    if (remoteBomb != null)
                    {
                        Core.Config.Log.Warn("EUL Detonate");
                        remoteBomb.Detonate();
                        break;
                    }
                    EULComboLogic._Status = 0;
                    break;
                }
                EULComboLogic._Status = 0;
                break;
            }
        }