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 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(); } } }
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; } }