Esempio n. 1
0
        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
                {
                }
            }
        }
Esempio n. 2
0
 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;
         }
     }
 }