Ejemplo n.º 1
0
        protected override void OnActivate()
        {
            base.OnActivate();

            this.Decrepify = UnitExtensions.GetAbilityById(this.Owner, AbilityId.pugna_decrepify);
            this.Blast     = UnitExtensions.GetAbilityById(this.Owner, AbilityId.pugna_nether_blast);
            this.Ward      = UnitExtensions.GetAbilityById(this.Owner, AbilityId.pugna_nether_ward);
            this.Drain     = UnitExtensions.GetAbilityById(this.Owner, AbilityId.pugna_life_drain);


            var factory  = this.Config.Hero.Factory;
            var itemMenu = this.Config.Hero.ItemMenu;

            this.UseBlinkPrediction = factory.Item("Blink Prediction", new Slider(200, 0, 600));
            this.UseBlinkPrediction.Item.Tooltip = "Will blink to set distance. Set to 0 if you want to disable it.";
            this.DrainHP = factory.Item("Heal ally HP", new Slider(30, 0, 100));
            this.DrainHP.Item.Tooltip     = "Allies HP to begin healing";
            this.SelfHPDrain              = factory.Item("Min HP to Heal", new Slider(60, 0, 100));
            this.SelfHPDrain.Item.Tooltip = "HP threshold to start healing";
            this.PostDrainHP              = factory.Item("Post drain HP", new Slider(30, 0, 100));
            this.PostDrainHP.Item.Tooltip =
                "HP threshold to stop healing. (this value must be higher than post drain HP)";
            this.HealAllyTo = factory.Item("Post drain HP for ally", new Slider(100, 0, 100));
            this.HealAllyTo.Item.Tooltip  = "Heal ally to this hp (this value must be higher than heal ally HP)";
            this.WardTargets              = factory.Item("Targets for ward", new Slider(0, 1, 5));
            this.WardTargets.Item.Tooltip = "Targets in range of ward for usage";
            this.HealTargetHeroes         = factory.Item("Heal Targets", new HeroToggler(new Dictionary <string, bool>(), false, true, false));
        }
Ejemplo n.º 2
0
        protected override void OnActivate()
        {
            base.OnActivate();

            KillStealHandler = UpdateManager.Run(KillStealAsync, true, true);

            this.context.Inventory.Attach(this);

            this.Imprison = UnitExtensions.GetAbilityById(this.Owner, AbilityId.obsidian_destroyer_astral_imprisonment);
            this.Orb      = UnitExtensions.GetAbilityById(this.Owner, AbilityId.obsidian_destroyer_arcane_orb);
            this.Ulti     = UnitExtensions.GetAbilityById(this.Owner, AbilityId.obsidian_destroyer_sanity_eclipse);
        }
Ejemplo n.º 3
0
        private async Task OnUpdate(CancellationToken token)
        {
            //List<Hero> enemies = new List<Hero> ();
            //List<Unit> greenbombsnearby = new List<Unit> ();
            //greenbombsnearby.Clear ();
            //enemies.Clear ();

            if (config.EnableCheat)
            {
                greenbombsnearby = new List <Unit>();
                if (config.techiesRampage.RemoteMines != null)
                {
                    enemies = ObjectManager.GetEntities <Hero> ().Where(x => (x.Team != main.Team)).ToList();
                    if (enemies.Count > 0)
                    {
                        foreach (Hero enemy in enemies)
                        {
                            int   bombsneeded  = 0;
                            float damage       = 0.0f;
                            int   bombscounter = 0;
                            damage = AbilityDamage.CalculateDamage(config.techiesRampage.RemoteMines, context.Owner, enemy as Unit, 0, 0, enemy.MagicDamageResist, enemy.Health);
                            //damage = getDamage(enemy);
                            greenbombsnearby = ObjectManager.GetEntities <Unit> ().Where(x => x.IsInRange(enemy, 400) && x.IsAlive && x.Name == "npc_dota_techies_remote_mine" && x.Team == main.Team && x.IsControllableByPlayer(ObjectManager.LocalPlayer)).ToList();
                            bombsneeded      = 0;
                            float damageneeded = 0;
                            while (greenbombsnearby.Count > 0 && damageneeded < enemy.Health)
                            {
                                damageneeded += damage;
                                bombsneeded++;
                            }

                            if (greenbombsnearby.Count > 0 && greenbombsnearby.Count >= bombsneeded)
                            {
                                foreach (Unit bomb in greenbombsnearby)
                                {
                                    if (bombscounter < bombsneeded)
                                    {
                                        Ability selfdetonate = UnitExtensions.GetAbilityById(bomb, AbilityId.techies_remote_mines_self_detonate);
                                        if (selfdetonate != null)
                                        {
                                            selfdetonate.UseAbility();
                                            bombscounter++;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            await Task.Delay(25, token);
        }