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; } }
private static void ReBindLandStacker(Unit _Bomb) { LandStack _Stacker = Config._LandStacks.FirstOrDefault <LandStack>((Func <LandStack, bool>)(x => (int)x._Unit.Handle == (int)_Bomb.Handle)); if (_Stacker == null) { return; } LandBomb _NewUnit = Config._LandBombs.Where <LandBomb>((Func <LandBomb, bool>)(x => (Entity)x._Unit != (Entity)_Bomb)).MinOrDefault <LandBomb, float>((Func <LandBomb, float>)(x => x._Unit.Distance2D(_Stacker._Unit, false))); if (_NewUnit != null && (double)_NewUnit._Unit.Distance2D(_Stacker._Unit, false) < 100.0) { if (!Config._LandStacks.Where <LandStack>((Func <LandStack, bool>)(x => x.Id != _Stacker.Id)).Any <LandStack>((Func <LandStack, bool>)(x => (double)x._Unit.Distance2D(_NewUnit._Unit, false) <= 100.0))) { _Stacker._Unit = _NewUnit._Unit; } else { Config._LandStacks.Remove(_Stacker); } } else { Config._LandStacks.Remove(_Stacker); } }
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; } } } } } }
public static void CreateNewStack() { Vector3 _Pos = Game.MousePosition; if (Config._LandStacks.Any <LandStack>((Func <LandStack, bool>)(x => (double)x._Unit.Distance2D(_Pos) <= 400.0))) { return; } LandBomb landBomb = Config._LandBombs.FirstOrDefault <LandBomb>((Func <LandBomb, bool>)(x => (double)x._Unit.Distance2D(_Pos) <= 400.0)); if (landBomb == null) { return; } Config._LandStacks.Add(new LandStack(landBomb._Unit)); }
public static void OnInt32Change(Entity sender, Int32PropertyChangeEventArgs args) { if (sender.Team != Config._Hero.Team || sender.ClassId != ClassId.CDOTA_NPC_TechiesMines) { return; } if (args.PropertyName == "m_iHealth") { if (args.NewValue == 0) { if (sender.Name.Contains("stasis")) { BombManager.RemoveBomb((Unit)sender, BombType.Stasis); } else if (sender.Name.Contains("land")) { BombManager.RemoveBomb((Unit)sender, BombType.Land); } else { BombManager.RemoveBomb((Unit)sender, BombType.Remote); } } else { if (args.NewValue > 100 || !Config._Menu.Features.DetonateOnVision || (!sender.Name.Contains("remote") || ObjectManager.GetEntitiesFast <Unit>().Count <Unit>((Func <Unit, bool>)(x => { if (x.Team != Config._Hero.Team) { return((double)x.Distance2D((Unit)sender, false) < 400.0); } return(false); })) < 3)) { return; } ((Unit)sender).Spellbook.Spell1.UseAbility(); } } else if (args.PropertyName == "m_NetworkActivity") { if (args.NewValue != 1500) { return; } LandBomb landBomb = Config._LandBombs.FirstOrDefault <LandBomb>((Func <LandBomb, bool>)(z => (Entity)z._Unit == sender)); if (landBomb == null || !landBomb._Unit.IsVisibleToEnemies) { return; } landBomb._OnVision = true; landBomb._VisionDate = Game.RawGameTime; } else { if (!(args.PropertyName == "m_iTaggedAsVisibleByTeam")) { return; } LandBomb landBomb = Config._LandBombs.FirstOrDefault <LandBomb>((Func <LandBomb, bool>)(z => (Entity)z._Unit == sender)); if (landBomb == null) { return; } if (args.NewValue == 30) { landBomb._OnVision = true; landBomb._VisionDate = Game.RawGameTime; } else { landBomb._OnVision = false; } } }