Esempio n. 1
0
        static void AreaSpellCheck(Player sender, ExecuteOrderEventArgs args)
        {
            var spells = new[]
            {
                new AreaSpell("enigma_black_hole", "pull_radius"),
                new AreaSpell("puck_dream_coil", "coil_radius"),
                new AreaSpell("obsidian_destroyer_sanity_eclipse", "radius"),
                new AreaSpell("faceless_void_chronosphere", "radius"),
            };
            var spell = spells.FirstOrDefault(x => x.Name == args.Ability.Name);

            if (spell != null)
            {
                var enemies =
                    ObjectMgr.GetEntities <Hero>()
                    .Where(
                        x =>
                        x.IsAlive && x.IsVisible && !x.IsIllusion && x.Team != sender.Team &&
                        x.Distance2D(args.TargetPosition) - x.HullRadius
                        < args.Ability.AbilityData.First(s => s.Name == spell.Radius).Value);
                if (!enemies.Any())
                {
                    args.Process = false;
                    return;
                }
            }
            if (PowerTreadsIntCheck(args))
            {
                args.Ability.UseAbility(args.TargetPosition, true);
            }
        }
Esempio n. 2
0
        private static void Game_OnUpdate(EventArgs args)
        {
            var tick = Environment.TickCount;
            var hero = ObjectMgr.LocalHero;

            if (hero == null || tick < _sleeptick || !_enabled)
            {
                return;
            }
            // check for runes
            var runes =
                ObjectMgr.GetEntities <Rune>()
                .Where(x => x.IsVisible && GetDistance2D(x.NetworkPosition, hero.NetworkPosition) < 400).ToList();

            if (runes.Any())
            {
                hero.PickUpRune(runes.First());
                _sleeptick = tick + 125;
                return;
            }
            // check for aegis and cheese
            if (hero.Inventory.FreeSlots.Any())
            {
                var items =
                    ObjectMgr.GetEntities <PhysicalItem>()
                    .Where(x => x.IsVisible && GetDistance2D(x.NetworkPosition, hero.NetworkPosition) < 400 &&
                           (x.Item.Name == "item_aegis" || x.Item.Name == "item_cheese")).ToList();
                if (items.Any())
                {
                    hero.PickUpItem(items.First());
                    _sleeptick = tick + 125;
                    return;
                }
            }
        }
Esempio n. 3
0
        private static void HandleTowers()
        {
            if (!Game.IsInGame)
            {
                return;
            }

            foreach (var e in Effects)
            {
                e.Dispose();
            }
            Effects.Clear();

            var player = ObjectMgr.LocalPlayer;

            if (player == null)
            {
                return;
            }
            var towers =
                ObjectMgr.GetEntities <Building>()
                .Where(x => x.IsAlive && x.ClassID == ClassID.CDOTA_BaseNPC_Tower)
                .ToList();

            if (!towers.Any())
            {
                return;
            }

            if (player.Team == Team.Observer)
            {
                foreach (var effect in towers.Select(tower => tower.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf")))
                {
                    effect.SetControlPoint(1, new Vector3(0, 255, 0));
                    effect.SetControlPoint(2, new Vector3(950, 255, 0));
                    Effects.Add(effect);
                }
            }
            else
            {
                if (enemyTowers)
                {
                    foreach (var effect in towers.Where(x => x.Team != player.Team).Select(tower => tower.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf")))
                    {
                        effect.SetControlPoint(1, new Vector3(255, 0, 0));
                        effect.SetControlPoint(2, new Vector3(950, 255, 0));
                        Effects.Add(effect);
                    }
                }
                if (ownTowers)
                {
                    foreach (var effect in towers.Where(x => x.Team == player.Team).Select(tower => tower.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf")))
                    {
                        effect.SetControlPoint(1, new Vector3(0, 255, 0));
                        effect.SetControlPoint(2, new Vector3(950, 255, 0));
                        Effects.Add(effect);
                    }
                }
            }
        }
 /// <summary>
 ///     Checks for lowest hp creep in attack range
 /// </summary>
 /// <param name="source"></param>
 /// <returns></returns>
 public static Unit GetLowestHPCreep(Hero source)
 {
     try
     {
         var attackRange = source.GetAttackRange();
         var lowestHp    =
             ObjectMgr.GetEntities <Unit>()
             .Where(
                 x =>
                 (x.ClassID == ClassID.CDOTA_BaseNPC_Tower || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane ||
                  x.ClassID == ClassID.CDOTA_BaseNPC_Creep ||
                  x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral ||
                  x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege ||
                  x.ClassID == ClassID.CDOTA_BaseNPC_Additive ||
                  x.ClassID == ClassID.CDOTA_BaseNPC_Barracks ||
                  x.ClassID == ClassID.CDOTA_BaseNPC_Building ||
                  x.ClassID == ClassID.CDOTA_BaseNPC_Creature) && x.IsAlive && x.IsVisible &&
                 x.Team != source.Team && x.Distance2D(source) < (attackRange + 100))
             .OrderBy(creep => creep.Health)
             .DefaultIfEmpty(null)
             .FirstOrDefault();
         return(lowestHp);
     }
     catch (Exception)
     {
         //no
     }
     return(null);
 }
Esempio n. 5
0
        private static void Game_OnUpdate(System.EventArgs args)
        {
            var player = ObjectMgr.LocalPlayer;

            if (player == null || player.Team == Team.Observer)
            {
                return;
            }
            // check allied heroes
            var heroes = ObjectMgr.GetEntities <Hero>().Where(x => x.Team == player.Team);

            foreach (var hero in heroes)
            {
                HandleEffect(hero);
            }
            // check wards
            var wards =
                ObjectMgr.GetEntities <Unit>()
                .Where(
                    x =>
                    x.Team == player.Team &&
                    (x.ClassID == ClassID.CDOTA_NPC_Observer_Ward ||
                     x.ClassID == ClassID.CDOTA_NPC_Observer_Ward_TrueSight));

            foreach (var ward in wards)
            {
                HandleEffect(ward);
            }
        }
Esempio n. 6
0
        private static Hero GetLowHpHeroInDistance(Hero me, float maxDistance)
        {
            Item aghanim = me.FindItem("item_ultimate_scepter");

            int[] ultDamage;
            if (aghanim != null)
            {
                ultDamage = new int[3] {
                    297, 422, 547
                };
            }
            else
            {
                ultDamage = new int[3] {
                    247, 322, 395
                };
            }
            var ultLevel = me.Spellbook.SpellR.Level;
            var damage   = ultDamage[ultLevel - 1];
            var enemies  = ObjectMgr.GetEntities <Hero>()
                           .Where(x => x.IsAlive && !x.IsIllusion && x.Team != me.Team && (damage > (x.Health - 5))).ToList();
            Hero target = getHeroInDistance(me, enemies, maxDistance);

            return(target);
        }
Esempio n. 7
0
        /// <summary>
        ///     Find enemy hero that takes least hits to kill
        /// </summary>
        /// <param name="source">Source hero</param>
        /// <returns></returns>
        public static Hero BestAutoAttackTarget(Hero source)
        {
            var attackRange = source.GetAttackRange();
            var enemyHeroes =
                ObjectMgr.GetEntities <Hero>()
                .Where(
                    x =>
                    x.Team == source.GetEnemyTeam() && !x.IsIllusion && x.IsAlive && x.IsVisible &&
                    x.Distance2D(source) <= (attackRange + x.HullRadius / 2));
            var  aaDmg          = source.MinimumDamage + source.BonusDamage;
            Hero bestTarget     = null;
            var  lastHitsToKill = 0f;

            foreach (var enemyHero in enemyHeroes)
            {
                var takenDmg   = enemyHero.DamageTaken(aaDmg, DamageType.Physical, source, false);
                var hitsToKill = enemyHero.Health / takenDmg;
                if (bestTarget != null && !(lastHitsToKill < hitsToKill))
                {
                    continue;
                }
                bestTarget     = enemyHero;
                lastHitsToKill = hitsToKill;
            }
            return(bestTarget);
        }
Esempio n. 8
0
 private static Hero[] FindTargets()
 {
     return
         (ObjectMgr.GetEntities <Hero>()
          .Where(
              x => x.Team != me.Team && x.IsAlive && x.IsVisible && !x.IsMagicImmune() && x.Modifiers.All(y => y.Name != "modifier_abaddon_borrowed_time") && Utils.SleepCheck(x.ClassID.ToString()) && !x.IsIllusion).OrderBy(s => s.Distance2D(Game.MousePosition)).ToArray());
 }
Esempio n. 9
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
            {
                return;
            }
            me = ObjectMgr.LocalHero;

            if (!me.IsAlive || me == null || !Menu.Item("ToggleKey").GetValue <KeyBind>().Active)
            {
                return;
            }

            if (Menu.Item("ToggleKey").GetValue <KeyBind>().Active)
            {
                var rune  = ObjectMgr.GetEntities <Rune>().FirstOrDefault(x => x.IsVisible && x.Distance2D(me) < 350);
                var aegis = ObjectMgr.GetEntities <PhysicalItem>().FirstOrDefault(x => x.IsVisible && x.Distance2D(me) < 380 && x.Item.Name == "item_aegis");
                if (rune != null)
                {
                    me.PickUpRune(rune);
                    return;
                }
                if (aegis != null && me.Inventory.FreeSlots.Any())
                {
                    me.PickUpItem(aegis);
                    return;
                }
            }
        }
Esempio n. 10
0
        public static void No_Item(EventArgs args)
        {
            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
            {
                return;
            }

            me = ObjectMgr.LocalHero;

            if (noitem)
            {
                if (fountain == null || !fountain.IsValid)
                {
                    fountain = ObjectMgr.GetEntities <Unit>()
                               .FirstOrDefault(x => x.Team == me.Team && x.ClassID == ClassID.CDOTA_Unit_Fountain);
                }

                if (bot != null && bot.IsValid && bot.CanBeCasted() && Utils.SleepCheck("bot") &&
                    menuValue.IsEnabled(bot.Name))
                {
                    bot.UseAbility(fountain);
                    Utils.Sleep(150 + Game.Ping, "bot");
                }

                else if (tp != null && tp.IsValid && bot.CanBeCasted() && Utils.SleepCheck("tp") &&
                         menuValue.IsEnabled(tp.Name))
                {
                    tp.UseAbility(fountain);
                    Utils.Sleep(150 + Game.Ping, "tp");
                }
            }
        }
Esempio n. 11
0
        public static void Killsteal(EventArgs args)
        {
            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
            {
                return;
            }
            me = ObjectMgr.LocalHero;
            if (me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Obsidian_Destroyer)
            {
                return;
            }

            var astrallvl = me.Spellbook.SpellW.Level;
            var range     = me.Spellbook.SpellW.CastRange;

            if (Utils.SleepCheck("killstealW") && Menu.Item("wks").GetValue <bool>())
            {
                if (astral.CanBeCasted() && me.Mana > astral.ManaCost)
                {
                    var enemy = ObjectMgr.GetEntities <Hero>().Where(e => e.Team != me.Team && e.IsAlive && e.IsVisible && !e.IsIllusion && !e.UnitState.HasFlag(UnitState.MagicImmune) && me.Distance2D(e) < range).ToList();
                    foreach (var v in enemy)
                    {
                        var damage = Math.Floor((wDamage[astrallvl] * (1 - v.MagicDamageResist)) - (v.HealthRegeneration * 5));
                        if (v.Health < damage && me.Distance2D(v) < range)
                        {
                            astral.UseAbility(v);
                            Utils.Sleep(300, "killstealW");
                        }
                    }
                }
            }
        }
Esempio n. 12
0
        public static void Killsteal(EventArgs args)
        {
            var me = ObjectMgr.LocalHero;

            if (me == null || !Game.IsInGame || me.Spellbook.Spell4 == null)
            {
                stealToggle = false;
            }

            if (Utils.SleepCheck("killstealR") && Game.IsInGame)
            {
                drawStealNotice = false;

                if (me.HasItem(ClassID.CDOTA_Item_UltimateScepter))
                {
                    rDmg = new int[3] {
                        440, 540, 640
                    };
                }
                else
                {
                    rDmg = new int[3] {
                        225, 350, 475
                    };
                }

                if (!active && toggle && me.Spellbook.Spell4.CanBeCasted() && me.Mana > me.Spellbook.Spell4.ManaCost)
                {
                    var enemy = ObjectMgr.GetEntities <Hero>().Where(e => e.Team != me.Team && e.IsAlive && e.IsVisible && !e.IsIllusion && !e.UnitState.HasFlag(UnitState.MagicImmune) &&
                                                                     e.ClassID != ClassID.CDOTA_Unit_Hero_Beastmaster_Hawk &&
                                                                     e.ClassID != ClassID.CDOTA_Unit_Hero_Beastmaster_Boar &&
                                                                     e.ClassID != ClassID.CDOTA_Unit_Hero_Beastmaster_Beasts &&
                                                                     e.ClassID != ClassID.CDOTA_Unit_Brewmaster_PrimalEarth &&
                                                                     e.ClassID != ClassID.CDOTA_Unit_Brewmaster_PrimalFire &&
                                                                     e.ClassID != ClassID.CDOTA_Unit_Brewmaster_PrimalStorm &&
                                                                     e.ClassID != ClassID.CDOTA_Unit_Undying_Tombstone &&
                                                                     e.ClassID != ClassID.CDOTA_Unit_Undying_Zombie &&
                                                                     e.ClassID != ClassID.CDOTA_Ability_Juggernaut_HealingWard).ToList();

                    foreach (var v in enemy)
                    {
                        var damage = Math.Floor(rDmg[me.Spellbook.Spell4.Level - 1] * (1 - v.MagicDamageResist / 100));
                        if (v.Health < (damage - 40) && v != null && !v.IsIllusion)
                        {
                            drawStealNotice = true;

                            steallableHero = v.NetworkName;
                            steallableHero = steallableHero.Replace("CDOTA_Unit_Hero_", "");
                            steallableHero = steallableHero.ToUpper();

                            if (confirmSteal || stealToggle && v != null && !v.IsIllusion)
                            {
                                me.Spellbook.Spell4.UseAbility();
                                Utils.Sleep(300, "killstealR");
                            }
                        }
                    }
                }
            }
        }
Esempio n. 13
0
        private static Hero ClosestToMouse(Hero source, float range = 600)
        {
            var mousePosition = Game.MousePosition;
            var enemyHeroes   = ObjectMgr.GetEntities <Hero>().Where(x => x.Team == source.GetEnemyTeam() && !x.IsIllusion && x.IsAlive && x.IsVisible && x.Distance2D(mousePosition) <= range /*&& !x.IsMagicImmune()*/).OrderBy(source.Distance2D);

            return(enemyHeroes.FirstOrDefault());
        }
Esempio n. 14
0
        private static void PickUpItems(bool move = false)
        {
            var droppedItems =
                ObjectMgr.GetEntities <PhysicalItem>().Where(x => x.Distance2D(hero) < 250).Reverse().ToList();

            for (var i = 0; i < droppedItems.Count; i++)
            {
                hero.PickUpItem(droppedItems[i], i != 0);
            }

            foreach (var itemSlot in ItemSlots)
            {
                itemSlot.Value.MoveItem(itemSlot.Key);
            }

            ItemSlots.Clear();

            if (move)
            {
                hero.Move(Game.MousePosition, true);
            }

            if (!ptChanged)
            {
                return;
            }

            if (hero.Modifiers.All(x => x.Name != "modifier_bottle_regeneration"))
            {
                ChangePowerTreads(lastPtAttribute, false);
            }
        }
Esempio n. 15
0
        private static void Game_OnDraw(EventArgs args)
        {
            if (!Game.IsInGame || _player == null || _me == null || !_activ)
            {
                return;
            }

            var enemies = ObjectMgr.GetEntities <Hero>().Where(hero => hero.IsVisible && hero.IsAlive && hero.Team != _player.Team && !hero.IsIllusion()).ToList();

            foreach (var enemy in enemies)
            {
                Vector2 screenPos;
                var     enemyPos = enemy.Position + new Vector3(0, 0, enemy.HealthBarOffset);
                if (!Drawing.WorldToScreen(enemyPos, out screenPos))
                {
                    continue;
                }

                var    start = screenPos + new Vector2(-51, -40);
                double damageNeeded;
                string spell;
                if (!HeroDamageDictionary.TryGetValue(enemy, out damageNeeded) || !HeroSpellDictionary.TryGetValue(enemy, out spell))
                {
                    continue;
                }

                var text     = "D a m a g e  f o r  K S: " + string.Format("{0}", (int)damageNeeded);
                var textSize = Drawing.MeasureText(text, "Arial", new Vector2(10, 150), FontFlags.None);
                var textPos  = start + new Vector2(51 - textSize.X / 2, -textSize.Y / 2 + 2);
                //Drawing.DrawRect(textPos - new Vector2(15, 0), new Vector2(10, 10), Drawing.GetTexture("materials/NyanUI/spellicons/" + spell + ".vmt"));
                Drawing.DrawText(text, "Arial", textPos, new Vector2(10, 150), damageNeeded < 0 ? Color.Red : Color.White, FontFlags.AntiAlias | FontFlags.DropShadow);
            }
        }
Esempio n. 16
0
        private static Creep KillableCreep(bool islaneclear)
        {
            var minion = ObjectMgr.GetEntities <Creep>()
                         .Where(creep => creep.IsAlive && me.Distance2D(creep) <= me.GetAttackRange())
                         .OrderBy(creep => creep.Health).DefaultIfEmpty(null).FirstOrDefault();

            double test = 0;

            if (minion != null)
            {
                var missilespeed = GetProjectileSpeed(me);
                var time         = me.IsRanged == false ? 0 : UnitDatabase.GetAttackBackswing(me) + (me.Distance2D(minion) / missilespeed);
                test = time * minion.AttacksPerSecond * minion.DamageAverage;


                Console.WriteLine("test " + test + " time " + time + " distance " + me.Distance2D(minion) / missilespeed);
                if (minion != null && (minion.Health) < GetPhysDamageOnUnit(minion, test))
                {
                    if (me.CanAttack())
                    {
                        return(minion);
                    }
                }
            }
            return(islaneclear == true ? minion : null);
        }
Esempio n. 17
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!Game.IsInGame || Game.GameTime > 1800 || Game.IsPaused)
            {
                return;
            }

            var player = ObjectMgr.LocalPlayer;

            _me = player.Hero;

            if (player == null || player.Team == Team.Observer || _me == null || _me.MinimumDamage > 120)
            {
                return;
            }

            var quellingBlade = _me.FindItem(" item_quelling_blade ");
            var damage        = (quellingBlade != null) ? (_me.MinimumDamage * 1.40 + _me.BonusDamage) : (_me.MinimumDamage + _me.BonusDamage);

            var creeps = ObjectMgr.GetEntities <Unit>().Where(creep => (creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane || creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege) && creep.IsSpawned).ToList();

            if (!creeps.Any())
            {
                return;
            }

            foreach (var creep in creeps)
            {
                if (creep.IsAlive && creep.IsVisible)
                {
                    string creepType;
                    if (creep.Health > 0 && creep.Health < damage * (1 - creep.DamageResist) + 1)
                    {
                        if (!CreepsDictionary.TryGetValue(creep, out creepType) || creepType != "passive")
                        {
                            continue;
                        }
                        CreepsDictionary.Remove(creep);
                        CreepsTeamDictionary.Remove(creep);
                        creepType = "active";
                        CreepsDictionary.Add(creep, creepType);
                        CreepsTeamDictionary.Add(creep, creep.Team);
                    }
                    else if (creep.Health < damage + 88)
                    {
                        if (CreepsDictionary.TryGetValue(creep, out creepType))
                        {
                            continue;
                        }
                        creepType = "passive";
                        CreepsDictionary.Add(creep, creepType);
                    }
                }
                else
                {
                    CreepsDictionary.Remove(creep);
                    CreepsTeamDictionary.Remove(creep);
                }
            }
        }
Esempio n. 18
0
 static EnemyTowers()
 {
     Towers =
         ObjectMgr.GetEntities <Building>()
         .Where(x => x.ClassID == ClassID.CDOTA_BaseNPC_Tower && x.Team == AbilityMain.Me.Team && x.IsAlive)
         .ToList();
 }
Esempio n. 19
0
        private static void Game_OnUpdate(System.EventArgs args)
        {
            var player = ObjectMgr.LocalPlayer;

            if (player == null || player.Team == Team.Observer)
            {
                return;
            }
            // check allied heroes
            var units = ObjectMgr.GetEntities <Unit>().Where(
                x =>
                // heroes
                (Menu.Item("heroes").GetValue <bool>() && x is Hero && x.Team == player.Team)
                // wards
                || (Menu.Item("wards").GetValue <bool>() &&
                    (x.ClassID == ClassID.CDOTA_NPC_Observer_Ward ||
                     x.ClassID == ClassID.CDOTA_NPC_Observer_Ward_TrueSight) && x.Team == player.Team)
                // techies mines
                || (Menu.Item("mines").GetValue <bool>() && x.ClassID == ClassID.CDOTA_NPC_TechiesMines &&
                    x.Team == player.Team)
                // units
                || (Menu.Item("units").GetValue <bool>() && !(x is Hero) && !(x is Building) && x.ClassID != ClassID.CDOTA_BaseNPC_Creep_Lane &&
                    x.ClassID != ClassID.CDOTA_NPC_TechiesMines && x.ClassID != ClassID.CDOTA_NPC_Observer_Ward &&
                    x.ClassID != ClassID.CDOTA_NPC_Observer_Ward_TrueSight && x.Team == player.Team)
                // buildings
                || (Menu.Item("buildings").GetValue <bool>() && x is Building && x.Team == player.Team)).ToList();


            foreach (var unit in units)
            {
                HandleEffect(unit);
            }
        }
Esempio n. 20
0
        public static void GetRunes()
        {
            bool isRunes = false;

            if (Variables.DeveloperMode)
            {
                Print.Info("Checking for runes");
            }
            foreach (Rune r in ObjectMgr.GetEntities <Rune>().Where(rune => rune.IsVisibleForTeam(Variables.me.Team)).ToList())
            {
                isRunes = true;
                if (Variables.DeveloperMode)
                {
                    Print.Info("Rune found");
                }
                switch (r.Position.X.ToString())
                {
                case "2812.563":                       //Bot Rune
                    if (!Variables.BottomRune.current) //if rune should be updated
                    {
                        if (Variables.DeveloperMode)
                        {
                            Print.Info(r.RuneType.ToString());
                        }
                        Variables.BottomRune.rune    = r;
                        Variables.BottomRune.current = true;
                    }
                    break;

                case "-2237.438":                   //Top Rune
                    if (!Variables.TopRune.current) //if rune should be updated
                    {
                        if (Variables.DeveloperMode)
                        {
                            Print.Info(r.RuneType.ToString());
                        }
                        Variables.TopRune.rune    = r;
                        Variables.TopRune.current = true;
                    }
                    break;
                    //  default: Print.Success(r.Position.X.ToString()); break;
                }
                if (Variables.TopRune.current && Variables.BottomRune.current)
                {
                    Utils.Sleep(Variables.TimeTillNextRune * 1000, "runeCheck");
                    if (Variables.DeveloperMode)
                    {
                        Print.Info(string.Format("runeCheck sleeping for {0} seconds", Variables.TimeTillNextRune));
                    }
                }
                else
                {
                    Utils.Sleep(250, "runeCheck");
                }
            }
            if (!isRunes)
            {
                Utils.Sleep(250, "runeCheck");
            }
        }
Esempio n. 21
0
        public static Hero GetClosestToMouseTarget(Hero source, float range = 1000)
        {
            if (source == null)
            {
                return(null);
            }
            var mousePosition = Game.MousePosition;
            var enemyHeroes   =
                ObjectMgr.GetEntities <Hero>()
                .Where(
                    x => x.IsValid &&
                    x.Team != source.Team && !x.IsIllusion && x.IsAlive && x.IsVisible &&
                    x.Distance2D(mousePosition) <= range);

            if (enemyHeroes == null)
            {
                return(null);
            }
            Hero closestHero = null;

            foreach (var enemyHero in enemyHeroes)
            {
                if (closestHero == null || closestHero.Distance2D(mousePosition) > enemyHero.Distance2D(mousePosition))
                {
                    closestHero = enemyHero;
                }
            }
            return(closestHero);
        }
Esempio n. 22
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!Utils.SleepCheck("acd.cd"))
            {
                return;
            }

            if (!Menu.Item("Lock").GetValue <bool>() /* && !Menu.Item("AntiReuse").GetValue<bool>()*/)
            {
                return;
            }

            var me = ObjectMgr.LocalHero;

            if (!_loaded)
            {
                if (!Game.IsInGame || me == null)
                {
                    return;
                }
                _loaded = true;
                Game.PrintMessage(
                    "<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + Menu.DisplayName +
                    " By Jumpering" +
                    " loaded!</font> <font color='#aa0000'>v" + Assembly.GetExecutingAssembly().GetName().Version,
                    MessageType.LogMessage);
                _fountain = null;
            }

            if (!Game.IsInGame || me == null)
            {
                _loaded = false;
                return;
            }
            if (Game.IsPaused)
            {
                return;
            }

            var couriers = ObjectMgr.GetEntities <Courier>().Where(x => x.IsAlive && x.Team == me.Team);

            if (_fountain == null || !_fountain.IsValid)
            {
                _fountain = ObjectMgr.GetEntities <Unit>()
                            .FirstOrDefault(x => x.Team == me.Team && x.ClassID == ClassID.CDOTA_Unit_Fountain);
            }
            foreach (var courier in couriers.Where(courier => courier.Distance2D(_fountain) > Menu.Item("MaxRange").GetValue <Slider>().Value))
            {
                Debug.Assert(_fountain != null, "_fountain != null");
                var angle = (float)Math.Max(
                    Math.Abs(courier.RotationRad - Utils.DegreeToRadian(courier.FindAngleBetween(_fountain.Position))) - 0.20, 0);
                // ReSharper disable once CompareOfFloatsByEqualityOperator
                if (angle == 0)
                {
                    continue;
                }
                courier.Move(_fountain.Position);
                Utils.Sleep(Menu.Item("Cd").GetValue <Slider>().Value, "acd.cd");
            }
        }
Esempio n. 23
0
        private static void Drawing_OnDraw(EventArgs args)
        {
            if (!Game.IsInGame || Game.GameTime > 1800)
            {
                return;
            }

            var creeps = ObjectMgr.GetEntities <Unit>().Where(creep => (creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane || creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege) && creep.IsSpawned).ToList();

            foreach (var creep in creeps)
            {
                Vector2 screenPos;
                var     enemyPos = creep.Position + new Vector3(0, 0, creep.HealthBarOffset);
                if (!Drawing.WorldToScreen(enemyPos, out screenPos))
                {
                    continue;
                }

                var start = screenPos + new Vector2(-5, -30);

                string creepType;
                if (!CreepsDictionary.TryGetValue(creep, out creepType))
                {
                    continue;
                }

                var screenX = Drawing.Width / (float)1600 * (float)0.8;
                switch (creepType)
                {
                case "active": Drawing.DrawRect(start, new Vector2((float)18 * screenX, (float)18 * screenX), Drawing.GetTexture("materials/vgui/hud/minimap_creep.vmat")); break;

                case "passive": Drawing.DrawRect(start, new Vector2((float)18 * screenX, (float)18 * screenX), Drawing.GetTexture("materials/vgui/hud/minimap_glow.vmat")); break;
                }
            }
        }
Esempio n. 24
0
        public static void ChangeColor(Team team, int value, Color color, Vector2[] towerLocations, string towers)
        {
            foreach (
                var tower in
                from tower in
                ObjectMgr.GetEntities <Unit>()
                .Where(x => x.ClassID == ClassID.CDOTA_BaseNPC_Tower && x.Team == team && x.IsAlive)
                from towerLocation in towerLocations
                where tower.Distance2D(towerLocation.ToVector3()) < 300
                select tower)
            {
                ParticleDictionary.TryGetValue(tower.Handle.ToString(), out particleEffect);

                if (particleEffect == null)
                {
                    continue;
                }

                var key = Main.Hero.Team == team ? "allyTowers" : "enemyTowers";

                particleEffect.SetControlPoint(1, new Vector3(
                                                   color == Color.Red ? value : MainMenu.Menu.Item(key + "R" + towers).GetValue <Slider>().Value,
                                                   color == Color.Green ? value : MainMenu.Menu.Item(key + "G" + towers).GetValue <Slider>().Value,
                                                   color == Color.Blue ? value : MainMenu.Menu.Item(key + "B" + towers).GetValue <Slider>().Value));
            }
        }
Esempio n. 25
0
        public static void BlockCheck()
        {
            var units =
                ObjectMgr.GetEntities <Unit>().Where(x => x.IsAlive && x.IsVisible && x.Team != Team.Neutral).ToList();

            foreach (var box in SpawnBoxLocations)
            {
                var center = box.GetBoxCenter();

                var blocked = false;

                if (units.Select(unit => unit.Position).Any(position => position.IsInCube(box)))
                {
                    blocked = true;

                    if (ParticleEffectsChanged.ContainsKey(center))
                    {
                        continue;
                    }

                    IEnumerable <ParticleEffect> effects;
                    ParticleEffects.TryGetValue(center, out effects);

                    if (effects == null)
                    {
                        continue;
                    }

                    var particleEffects = effects as ParticleEffect[] ?? effects.ToArray();
                    ParticleEffectsChanged.Add(center, particleEffects);

                    foreach (var effect in particleEffects)
                    {
                        effect.SetControlPoint(1, new Vector3(
                                                   Program.GetMenuValue("redB"),
                                                   Program.GetMenuValue("greenB"),
                                                   Program.GetMenuValue("blueB")));
                    }
                }

                if (blocked)
                {
                    continue;
                }

                foreach (
                    var effect in
                    ParticleEffectsChanged.Where(x => x.Key == center)
                    .SelectMany(particleEffect => particleEffect.Value))
                {
                    effect.SetControlPoint(1, new Vector3(
                                               Program.GetMenuValue("red"),
                                               Program.GetMenuValue("green"),
                                               Program.GetMenuValue("blue")));
                }

                ParticleEffectsChanged.Remove(center);
            }
        }
Esempio n. 26
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!_loaded)
            {
                _me     = ObjectMgr.LocalHero;
                _player = ObjectMgr.LocalPlayer;
                if (!Game.IsInGame || _me == null)
                {
                    return;
                }
                _loaded = true;
                PrintSuccess("> AutoDeward Loaded");
            }

            if (!Game.IsInGame || _me == null)
            {
                _loaded = false;
                PrintInfo("> AutoDeward unLoaded");
                return;
            }

            if (Game.IsPaused || !Utils.SleepCheck(_me.Handle.ToString()))
            {
                return;
            }

            if (_player == null || _player.Team == Team.Observer)
            {
                return;
            }
            var wards = ObjectMgr.GetEntities <Unit>()
                        .Where(
                x =>
                (x.ClassID == ClassID.CDOTA_NPC_Observer_Ward ||
                 x.ClassID == ClassID.CDOTA_NPC_Observer_Ward_TrueSight) &&
                x.Team != _player.Team && GetDistance2D(x.NetworkPosition, _me.NetworkPosition) < TangoRange &&
                x.IsVisible && x.IsAlive);
            var enumerable = wards as Unit[] ?? wards.ToArray();

            if (!enumerable.Any())
            {
                return;
            }
            var tango =
                _me.Inventory.Items.FirstOrDefault(
                    x => x.ClassID == ClassID.CDOTA_Item_Tango || x.ClassID == ClassID.CDOTA_Item_Tango_Single);
            var qblade = _me.Inventory.Items.FirstOrDefault(x => x.ClassID == ClassID.CDOTA_Item_QuellingBlade);

            if (qblade != null && qblade.CanBeCasted() &&
                GetDistance2D(enumerable.First().NetworkPosition, _me.NetworkPosition) < QbladeRange)
            {
                qblade.UseAbility(enumerable.First());
            }
            else if (tango != null && tango.CanBeCasted())
            {
                tango.UseAbility(enumerable.First());
            }
            Utils.Sleep(250, _me.Handle.ToString());
        }
Esempio n. 27
0
        private static void V****a(EventArgs T**s)
        {
            if (!Game.IsInGame)
            {
                return;
            }

            var me = ObjectMgr.LocalHero;

            if (me == null || !me.IsAlive)
            {
                return;
            }

            foreach (var v in ObjectMgr.GetEntities <Hero>().Where(x => x.Team != me.Team && !x.IsIllusion))
            {
                if (!enemies.ContainsKey(v.Name))
                {
                    if (enemies.Count > 4)
                    {
                        enemies.Clear();
                    }
                    enemies.Add(v.Name, true);
                    Menu.Item("enemies").SetValue(new HeroToggler(enemies));
                }
            }

            var dagon = me.Inventory.Items.FirstOrDefault(Anal => Anal.Name.Contains("item_dagon"));
            var enemy = ObjectMgr.GetEntities <Hero>()
                        .Where(F**k => F**k.Team != me.Team && F**k.IsAlive && F**k.IsVisible && !F**k.IsIllusion && !F**k.UnitState.HasFlag(UnitState.MagicImmune))
                        .ToList();

            if (me.Inventory.Items.Any(v => v.IsChanneling) || me.Spellbook.Spells.Any(v => v.IsChanneling))
            {
                return;
            }

            foreach (var v in enemy)
            {
                var linkens = v.Inventory.Items.FirstOrDefault(Gay => Gay.Name == "item_sphere");

                if (dagon != null && Menu.Item("keyBind").GetValue <KeyBind>().Active == true && Menu.Item("enemies").GetValue <HeroToggler>().IsEnabled(v.Name))
                {
                    if (dagon.Cooldown == 0 && me.Mana > dagon.ManaCost)
                    {
                        if ((linkens != null && linkens.Cooldown == 0) || v.Modifiers.Any(x => Ignore.Contains(x.Name)))
                        {
                            return;
                        }
                        var range  = ShitDickFuck[dagon.Level - 1];
                        var damage = Math.Floor(Penis[dagon.Level - 1] * (1 - v.MagicDamageResist));
                        if (LowUsageDistance(me, v) < (range * range) && v.Health < damage)
                        {
                            dagon.UseAbility(v);
                        }
                    }
                }
            }
        }
Esempio n. 28
0
 public static List <Player> GetPlayersNoSpecsNoIllusionsNoNull()
 {
     try
     {
         return(ObjectMgr.GetEntities <Player>().Where(player => player != null && player.Team != Team.Observer && player.Hero != null && !player.Hero.IsIllusion).ToList());
     }
     catch { return(new List <Player>()); }
 }
Esempio n. 29
0
 private static List <Hero> GetHeroes(bool inAction)
 {
     if (inAction)
     {
         return(ObjectMgr.GetEntities <Hero>().Where(x => x.Team != MyHero.Team && x.Distance2D(MyHero) <= 1450 && x.Health > 0).ToList());
     }
     return(ObjectMgr.GetEntities <Hero>().ToList());
 }
Esempio n. 30
0
 public static void Tick(EventArgs args)
 {
     if (!Game.IsInGame || Game.IsWatchingGame)
     {
         return;
     }
     me = ObjectMgr.LocalHero;
     if (me == null)
     {
         return;
     }
     if (me.ClassID == ClassID.CDOTA_Unit_Hero_Meepo)
     {
         List <Hero> meepo = ObjectMgr.GetEntities <Hero>().Where(x => x.Team == me.Team && x.Name == me.Name).ToList();
         uint        i     = 0;
         foreach (Hero m in meepo)
         {
             i++;
             if (m.IsAlive)
             {
                 if (rangedisplay_meepo[i] == null)
                 {
                     rangedisplay_meepo[i] = m.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf");
                 }
                 if (rangedisplay_meepo[i].GetHighestControlPoint() != 2)
                 {
                     rangedisplay_meepo[i] = m.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf");
                     rangedisplay_meepo[i].SetControlPoint(1, new Vector3(255, 255, 0));
                     rangedisplay_meepo[i].SetControlPoint(2, new Vector3(_range_exp, 255, 0));
                 }
             }
             else
             {
                 rangedisplay_meepo[i].Dispose();
             }
         }
     }
     else
     {
         if (me.IsAlive)
         {
             if (rangedisplay == null)
             {
                 rangedisplay = me.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf");
             }
             if (rangedisplay.GetHighestControlPoint() != 2)
             {
                 rangedisplay = me.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf");
                 rangedisplay.SetControlPoint(1, new Vector3(255, 255, 0));
                 rangedisplay.SetControlPoint(2, new Vector3(_range_exp, 255, 0));
             }
         }
         else
         {
             rangedisplay.Dispose();
         }
     }
 }