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; } }
public static void Update() { foreach (Unit _Bomb in ObjectManager.GetEntitiesFast <Unit>().Where <Unit>((Func <Unit, bool>)(x => { if (x.Team == Config._Hero.Team) { return(x.ClassId == ClassId.CDOTA_NPC_TechiesMines); } return(false); })).ToArray <Unit>()) { if (_Bomb.Name.Contains("stasis")) { BombManager.AddBomb(_Bomb, BombType.Stasis); } else if (_Bomb.Name.Contains("land")) { BombManager.AddBomb(_Bomb, BombType.Land); } else { BombManager.AddBomb(_Bomb, BombType.Remote); } } }
public static void OnAddEntity(EntityEventArgs args) { Entity entity = args.Entity; if (entity.Team != Config._Hero.Team || entity.ClassId != ClassId.CDOTA_NPC_TechiesMines) { return; } if (entity.Name.IndexOf("stasis") > 0) { BombManager.AddBomb((Unit)entity, BombType.Stasis); } else if (entity.Name.IndexOf("land") > 0) { BombManager.AddBomb((Unit)entity, BombType.Land); } else { BombManager.AddBomb((Unit)entity, BombType.Remote); } }
public static void OnRemoveEntity(EntityEventArgs args) { Entity entity = args.Entity; if (entity.Team == Config._Hero.Team && entity.ClassId == ClassId.CDOTA_NPC_TechiesMines) { if (entity.Name.IndexOf("stasis") > 0) { BombManager.RemoveBomb((Unit)entity, BombType.Stasis); } else if (entity.Name.IndexOf("land") > 0) { BombManager.RemoveBomb((Unit)entity, BombType.Land); } else { BombManager.RemoveBomb((Unit)entity, BombType.Remote); } } else { if (entity.Team == Config._Hero.Team) { return; } try { Unit key = (Unit)entity; if (!Config._EnemyAttakers.ContainsKey(key)) { return; } Config._EnemyAttakers.Remove(key); } catch { } } }
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; } } }