Beispiel #1
0
        private static JungleCamps GetClosestCamp(Meepo illusion, bool stack, bool any)
        {
            JungleCamps[] closest =
            {
                new JungleCamps {
                    WaitPosition = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue), Id = 0
                }
            };
            var Camps =
                JungleCamps.Where(
                    x =>
                    illusion.Distance2D(x.WaitPosition) < illusion.Distance2D(closest[0].WaitPosition) &&
                    !x.Farming &&
                    !x.Stacking && !x.Empty);

            if (stack)
            {
                Camps =
                    JungleCamps.Where(
                        x =>
                        illusion.Distance2D(x.WaitPosition) < illusion.Distance2D(closest[0].WaitPosition) &&
                        !x.Farming &&
                        !x.Stacking && !x.Empty && x.Team == me.Team);
            }
            foreach (var x in Camps)
            {
                closest[0] = x;
            }
            return(closest[0]);
        }
Beispiel #2
0
        public void UpdateEscapeState(Meepo me)
        {
            var  handle = me.Handle;
            bool nh;

            if (!Variables.NeedHeal.TryGetValue(handle, out nh))
            {
                Variables.NeedHeal.Add(handle, false);
            }
            var perc = me.Health / (float)me.MaximumHealth * 100;

            if (Variables.NeedHeal[handle])
            {
                if ((perc > 95 &&
                     me.HasModifiers(new[] { "modifier_fountain_aura", "modifier_fountain_aura_buff" }, false)) ||
                    Variables.OrderStates[handle] != Variables.OrderState.Escape)
                {
                    Variables.NeedHeal[handle]    = false;
                    Variables.OrderStates[handle] = Variables.OrderState.Idle;
                }
            }
            else
            {
                if (perc < Variables.MenuManager.EscapeMenu.Item("Escape.MinRangePercent").GetValue <Slider>().Value || me.Health <= Variables.MenuManager.EscapeMenu.Item("Escape.MinRange").GetValue <Slider>().Value)
                {
                    Variables.NeedHeal[handle]        = true;
                    Variables.LastOrderStates[handle] = Variables.OrderStates[handle] == Variables.OrderState.Escape
                        ? Variables.OrderState.Idle
                        : Variables.OrderStates[handle];

                    Variables.OrderStates[handle] = Variables.OrderState.Escape;
                }
            }
        }
Beispiel #3
0
 internal AbilityUnitMeepo(Meepo meepo)
     : base(meepo)
 {
     this.SourceMeepo    = meepo;
     this.DividedWeStand =
         this.SourceMeepo.Spellbook.Spells.FirstOrDefault(x => x is DividedWeStand) as DividedWeStand;
     this.MeepoId = this.DividedWeStand.UnitIndex + 1;
 }
Beispiel #4
0
 public MeepoSettings(Meepo meepo)
 {
     Hero              = meepo;
     Handle            = meepo.Handle;
     MainMenu          = false;
     CurrentOrderState = Program.OrderState.Idle;
     Id = (byte)(Program.MeepoSet.Count + 1);
     Game.PrintMessage("Init new Meepo: " + string.Format("Menu: {0}; CurrentOderState: {1}; Id:{2} ;", MainMenu, CurrentOrderState, Id), MessageType.ChatMessage);
 }
Beispiel #5
0
        public void Escaping(Meepo me, EarthBind earthBind, Poof poof, Hero _globalTarget)
        {
            var handle = me.Handle;
            //bool nh;
            //if (!Variables.NeedHeal.TryGetValue(handle, out nh))
            //    Variables.NeedHeal.Add(handle, false);
            var perc = me.Health / (float)me.MaximumHealth * 100;

            if (!me.HasModifiers(new[] { "modifier_fountain_aura", "modifier_fountain_aura_buff" }, false))
            {
                if (Utils.SleepCheck("move check" + handle))
                {
                    var anyEnemyHero =
                        Heroes.GetByTeam(me.GetEnemyTeam())
                        .FirstOrDefault(x => x.IsAlive && x.IsVisible && x.Distance2D(me) <= 800);
                    if (anyEnemyHero != null)
                    {
                        //var earthBind = Variables.earthBindList[handle];
                        if (earthBind != null && earthBind.CanBeCasted() && !anyEnemyHero.HasModifier("modifier_meepo_earthbind"))
                        {
                            earthBind.CastSpell(anyEnemyHero);
                        }
                    }
                    var anyAllyMeepoNearBase =
                        Variables.MeepoList.Where(
                            x =>
                            !Heroes.GetByTeam(me.GetEnemyTeam()).Any(y => y.Distance2D(x) <= 1500))
                        .OrderBy(z => z.Distance2D(Fountain.GetAllyFountain())).FirstOrDefault();
                    if (anyAllyMeepoNearBase == null)
                    {
                        me.Move(Fountain.GetAllyFountain().Position);
                    }
                    else
                    {
                        if (anyAllyMeepoNearBase == me)
                        {
                            me.Move(Fountain.GetAllyFountain().Position);
                        }
                        else
                        {
                            if (poof.CanBeCasted())
                            {
                                poof.Use(anyAllyMeepoNearBase.Position);
                            }
                            else
                            {
                                me.Move(Fountain.GetAllyFountain().Position);
                            }
                        }
                    }

                    Utils.Sleep(500, "move check" + handle);
                }
            }
        }
Beispiel #6
0
        private void CastEarthBind(Hero target, Meepo m)
        {
            var mod     = target.FindModifier("modifier_meepo_earthbind");
            var remTime = mod != null ? mod.RemainingTime : 0;
            var dist    = m.Distance2D(target) + m.HullRadius + target.HullRadius;
            var q       = Variables.earthBindList[m.Handle];

            if (q != null && q.CanBeCasted() && dist <= q.CastRange() &&
                (mod == null || remTime <= .7) &&
                Utils.SleepCheck("Period_q"))
            {
                q.CastSpell(target);
                Utils.Sleep(q.GetHitDelay(target) * 1000 + 100, "Period_q");
            }
        }
Beispiel #7
0
        public MeepoSettings(Meepo meepo)
        {
            Hero              = meepo;
            Handle            = meepo.Handle;
            MainMenu          = false;
            CurrentOrderState = Program.OrderState.Idle;
            var dividedWeStand = Hero.Spellbook.SpellR as DividedWeStand;

            if (dividedWeStand == null)
            {
                Console.WriteLine("[MeepoAnnihilation][InitNewMeepo] - cant find ultimate!");
                return;
            }
            Id = dividedWeStand.UnitIndex;
            Game.PrintMessage($"Init new Meepo: (Id: {Id})", MessageType.ChatMessage);
        }
 public MeepoSettings(Meepo meepo)
 {
     Hero = meepo;
     Handle = meepo.Handle;
     MainMenu = false;
     CurrentOrderState = Program.OrderState.Idle;
     var dividedWeStand = Hero.Spellbook.SpellR as DividedWeStand;
     if (dividedWeStand == null)
     {
         Console.WriteLine("[MeepoAnnihilation][InitNewMeepo] - cant find ultimate!");
         return;
     }
     Id = dividedWeStand.UnitIndex;
     Game.PrintMessage($"Init new Meepo: (Id: {Id})",MessageType.ChatMessage);
     PoofStartTime = float.MaxValue;
 }
Beispiel #9
0
        public void DrawEffects(Meepo meepo, Hero target)
        {
            ParticleEffect effect;
            var            handle = meepo.Handle;

            if (!Effects.TryGetValue(handle, out effect))
            {
                Effects.Add(handle, new ParticleEffect(@"particles\ui_mouseactions\range_finder_tower_aoe.vpcf", target));
            }
            if (effect == null)
            {
                return;
            }
            effect.SetControlPoint(2, new Vector3(meepo.Position.X, meepo.Position.Y, meepo.Position.Z));
            effect.SetControlPoint(6, new Vector3(1, 0, 0));
            effect.SetControlPoint(7, new Vector3(target.Position.X, target.Position.Y, target.Position.Z));
        }
Beispiel #10
0
        /// <summary>
        ///     Poofs all other meepos to this ones position.
        /// </summary>
        /// <param name="meepo">
        ///     The meepo.
        /// </param>
        public static void PoofAllToThisMeepo(this Meepo meepo)
        {
            var meepoCount = 1 + meepo.Spellbook.SpellR.Level + (meepo.AghanimState() ? 1 : 0);

            if (meeposList.Count(x => x.IsValid) <= meepoCount)
            {
                meeposList = ObjectManager.GetEntities <Meepo>().ToList();
            }

            foreach (var poof in
                     meeposList.Where(x => x.IsValid && !x.Equals(meepo) && x.IsAlive && x.CanCast())
                     .Select(otherMeepo => otherMeepo.Spellbook.Spell2)
                     .Where(poof => poof.CanBeCasted()))
            {
                poof.UseAbility(meepo.Position);
            }
        }
Beispiel #11
0
        private static Unit GetNearestCreepToPull(Meepo illusion, int dis)
        {
            var creeps =
                ObjectManager.GetEntities <Unit>().Where(x => x.IsAlive && x.IsSpawned && x.IsVisible && illusion.Distance2D(x) <= dis && x.Team != me.Team).ToList();
            Unit bestCreep    = null;
            var  bestDistance = float.MaxValue;

            foreach (var creep in creeps)
            {
                var distance = GetDistance2DFast(illusion, creep);
                if (bestCreep == null || distance < bestDistance)
                {
                    bestDistance = distance;
                    bestCreep    = creep;
                }
            }
            return(bestCreep);
        }
Beispiel #12
0
        public void Lane(Meepo me)
        {
            var handle         = me.Handle;
            var creeps         = Creeps.All.Where(x => x != null && x.IsValid && x.IsAlive && x.IsVisible).ToList();
            var creepsEnemy    = creeps.Where(x => x.Team != me.Team).ToList();
            var creepsAlly     = creeps.Where(x => x.Team == me.Team).ToList();
            var enemyHeroes    = Heroes.GetByTeam(me.GetEnemyTeam()).Where(x => x.IsAlive).ToList();
            var towers         = Towers.all.Where(x => x.Team != me.Team).Where(x => x.IsAlive).ToList();
            var creepWithEnemy =
                creepsAlly.FirstOrDefault(
                    x => x.MaximumHealth * 65 / 100 < x.Health && creepsEnemy.Any(y => y.Distance2D(x) <= 1000));
            var travelBoots = me.FindItem("item_travel_boots") ?? me.FindItem("item_travel_boots_2");

            if (travelBoots != null && creepWithEnemy != null && Variables.MenuManager.LanePushMenu.Item("AutoPush.TravelBoots").GetValue <bool>() && Utils.SleepCheck("TravelBoots." + handle))
            {
                if (travelBoots.CanBeCasted() && !creepsEnemy.Any(x => x.Distance2D(me) <= 1000))
                {
                    travelBoots.UseAbility(creepWithEnemy);
                    Utils.Sleep(500, "TravelBoots." + handle);
                    return;
                }
            }

            var nearestTower =
                towers.OrderBy(y => y.Distance2D(me))
                .FirstOrDefault() ?? Fountain.GetEnemyFountain();
            var fountain    = Fountain.GetAllyFountain();
            var curlane     = GetCurrentLane(me);
            var clospoint   = GetClosestPoint(curlane);
            var useThisShit = clospoint.Distance2D(fountain) - 250 > me.Distance2D(fountain);
            var name        = Variables.MeepoSet.Find(x => x.Handle == me.Handle).Handle.ToString();

            if (nearestTower != null && Utils.SleepCheck(name + "attack"))
            {
                var pos  = curlane == "mid" || !useThisShit ? nearestTower.Position : clospoint;
                var dist = Variables.MenuManager.LanePushMenu.Item("AutoPush.EscapeRange").GetValue <Slider>().Value;
                if (Variables.MenuManager.LanePushMenu.Item("AutoPush.EscapeFromAnyEnemyHero").GetValue <bool>() &&
                    enemyHeroes.Any(x => x.Distance2D(me) <= dist)) //escape from hero
                {
                    Variables.OrderStates[handle] = Variables.OrderState.Escape;
                    Variables.NeedHeal[handle]    = true;
                }
                else if (creepsAlly.Any(x => x.Distance2D(nearestTower) <= 800) ||
                         me.Distance2D(nearestTower) > 800)
                {
                    //under tower
                    var hpwasChanged = CheckForChangedHealth(me);
                    if (hpwasChanged)
                    {
                        var allyCreep = creepsAlly.OrderBy(x => x.Distance2D(me)).First();
                        if (allyCreep != null)
                        {
                            var towerPos = nearestTower.Position;
                            var ang      = allyCreep.FindAngleBetween(towerPos, true);
                            var p        = new Vector3((float)(allyCreep.Position.X - 250 * Math.Cos(ang)),
                                                       (float)(allyCreep.Position.Y - 250 * Math.Sin(ang)), 0);
                            me.Move(p);
                            me.Attack(allyCreep, true);
                            Utils.Sleep(1200, name + "attack");
                        }
                        else
                        {
                            var towerPos = nearestTower.Position;
                            var ang      = me.FindAngleBetween(towerPos, true);
                            var p        = new Vector3((float)(towerPos.X - 1250 * Math.Cos(ang)),
                                                       (float)(towerPos.Y - 1250 * Math.Sin(ang)), 0);
                            me.Move(p);
                            Utils.Sleep(500, name + "attack");
                        }
                    }
                    else
                    {
                        var act = me.NetworkActivity;
                        if (!Utils.SleepCheck("attack_time" + name))
                        {
                            return;
                        }

                        if (Variables.MenuManager.LanePushMenu.Item("AutoPush.LastHitMode").GetValue <bool>())
                        {
                            var bestEnemyCreep =
                                creepsEnemy.Where(x => x.Health < me.DamageAverage && x.Distance2D(me) <= 800)
                                .OrderBy(x => x.Distance2D(me))
                                .FirstOrDefault();
                            if (bestEnemyCreep != null)
                            {
                                me.Attack(bestEnemyCreep);
                                Utils.Sleep(UnitDatabase.GetAttackPoint(me) * 1000, "attack_time" + name);
                            }
                            else
                            {
                                /*if (act == NetworkActivity.Attack || act == NetworkActivity.Attack2)
                                 * {
                                 *  me.Stop();
                                 * }*/
                                if (act == NetworkActivity.Idle)
                                {
                                    me.Attack(pos);
                                }
                            }
                        }
                        else
                        {
                            if (act == NetworkActivity.Idle)
                            {
                                me.Attack(pos);
                            }
                        }

                        if (Variables.MenuManager.LanePushMenu.Item("AutoPush.AutoW").GetValue <bool>() && Variables.poofList[handle] != null)
                        {
                            var w         = Variables.poofList[handle];
                            var castRange = w.GetRealCastRange();
                            if (w.CanBeCasted() &&
                                creepsEnemy.Any(x => x.Distance2D(me) <= castRange && x.Health <= 60 + 20 * w.Level) &&
                                Utils.SleepCheck("w_push" + name))
                            {
                                w.Use(me);
                                Utils.Sleep(250, "w_push" + name);
                            }
                        }
                    }
                    Utils.Sleep(100, name + "attack");
                }
                else
                {
                    var towerPos = nearestTower.Position;
                    var ang      = me.FindAngleBetween(towerPos, true);
                    var p        = new Vector3((float)(me.Position.X - 1000 * Math.Cos(ang)),
                                               (float)(me.Position.Y - 1000 * Math.Sin(ang)), 0);
                    me.Move(p);
                    Utils.Sleep(200, name + "attack");
                }
            }
        }
Beispiel #13
0
        private static Unit GetNearestCreepToPull(Meepo illusion, int dis)
        {
            var creeps =
                ObjectManager.GetEntities<Unit>().Where(x => x.IsAlive && x.IsSpawned && x.IsVisible && illusion.Distance2D(x) <= dis && x.Team != me.Team).ToList();
            Unit bestCreep = null;
            var bestDistance = float.MaxValue;
            foreach (var creep in creeps)
            {
                var distance = GetDistance2DFast(illusion, creep);
                if (bestCreep == null || distance < bestDistance)
                {
                    bestDistance = distance;
                    bestCreep = creep;
                }

            }
            return bestCreep;
        }
Beispiel #14
0
 private static JungleCamps GetClosestCamp(Meepo illusion, bool stack, bool any)
 {
     JungleCamps[] closest =
     {
         new JungleCamps {WaitPosition = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue), Id = 0}
     };
     var Camps =
             JungleCamps.Where(
                 x =>
                     illusion.Distance2D(x.WaitPosition) < illusion.Distance2D(closest[0].WaitPosition) &&
                     !x.Farming &&
                     !x.Stacking && !x.Empty);
     if (stack)
     {
         Camps =
         JungleCamps.Where(
             x =>
                 illusion.Distance2D(x.WaitPosition) < illusion.Distance2D(closest[0].WaitPosition) &&
                 !x.Farming &&
                 !x.Stacking && !x.Empty && x.Team == me.Team);
     }
     foreach (var x in Camps)
     {
         closest[0] = x;
     }
     return closest[0];
 }
Beispiel #15
0
 private static JungleCamps CheckMeepo(Meepo clone)
 {
     var a = new JungleCamps();
     return JungleCamps.Where(x => x.meepos != null).Aggregate(a, (current, x) => (x.meepos.Handle == clone.Handle ? x : current));
 }
Beispiel #16
0
 private static bool Check(Meepo clone)
 {
     return JungleCamps.Where(x => x.meepos != null).Aggregate(false, (current, x) => (x.meepos.Handle == clone.Handle || current));
 }
Beispiel #17
0
 private static bool Check(Meepo clone)
 {
     return(JungleCamps.Where(x => x.meepos != null).Aggregate(false, (current, x) => (x.meepos.Handle == clone.Handle || current)));
 }
Beispiel #18
0
 /// <summary>
 ///     The is illusion.
 /// </summary>
 /// <param name="meepo">
 ///     The meepo.
 /// </param>
 /// <returns>
 ///     The <see cref="bool" />.
 /// </returns>
 public static bool IsIllusion(this Meepo meepo)
 {
     return(meepo.IsIllusion);
 }
Beispiel #19
0
 private static void DrawEffects(Meepo meepo, Hero target)
 {
     ParticleEffect effect;
     var handle = meepo.Handle;
     if (!Effects.TryGetValue(handle, out effect))
     {
         Effects.Add(handle, new ParticleEffect(@"particles\ui_mouseactions\range_finder_tower_aoe.vpcf", target));
     }
     if (effect == null) return;
     effect.SetControlPoint(2, new Vector3(meepo.Position.X, meepo.Position.Y, meepo.Position.Z));
     effect.SetControlPoint(6, new Vector3(1, 0, 0));
     effect.SetControlPoint(7, new Vector3(target.Position.X, target.Position.Y, target.Position.Z));
 }
        public static void RecalculateMeepos(ILogger <Worker> logger)
        {
            Bitmap healthbar = new Bitmap(System.IO.Directory.GetCurrentDirectory() + "\\resources\\img\\healthbar.png");

            Bitmap screenshot = Util.Screenshot();

            screenshot.Save("c:\\Source\\dota\\logs\\screenshot.png", ImageFormat.Png);


            int   meepoCounter = 0;
            Meepo meepo        = new Meepo();

            for (int x = 0; x < screenshot.Height; x += 1)
            {
                int imageStart = 0;
                if (x > 511)
                {
                    break;
                }
                for (int y = 0; y < screenshot.Width; y += 1)
                {
                    if (y > 112)
                    {
                        break;
                    }
                    Boolean meepoFound = false;
                    for (int hbw = 0; hbw < healthbar.Height; hbw++)
                    {
                        Boolean matchPixel = false;
                        int     health     = 3;
                        int     manna      = 10;
                        int     matched    = 0;
                        for (int hbh = 0; hbh < healthbar.Width; hbh++)
                        {
                            Color currentColor   = Util.GetColorAtOnImage(screenshot, y + hbh, x + hbw);
                            Color healthbarColor = Util.GetColorAtOnImage(healthbar, hbh, hbw);
                            if (healthbarColor.Equals(currentColor))
                            {
                                matched++;
                                meepoFound = true;

                                matchPixel = true;
                                if (imageStart == 0)
                                {
                                    imageStart = x;
                                }
                                //
                                //logger.LogDebug("{meepoCounter} ::: {x} {y} = {z} {imageStart}", meepoCounter, x +hbw, y + hbh, healthbar, imageStart);
                            }
                            else
                            {
                                break;
                            }
                        }
                        double percentage = (double)matched / healthbar.Width;
                        if (hbw == health)
                        {
                            meepo.health   = (float)percentage * 100f;
                            meepo.position = new Point(y + 3, x);
                        }
                        if (hbw == manna)
                        {
                            meepo.manna = (float)percentage * 100f;
                        }


                        if (matchPixel == false)
                        {
                            break;
                        }
                    }
                    if (meepoFound)
                    {
                        meepos[meepoCounter] = meepo;
                        meepoCounter        += 1;
                        logger.LogDebug("{meepoCounter} ::: {meepo} =  {imageStart}", meepoCounter, meepo.ToString, imageStart);

                        meepo = new Meepo();
                        x    += 20;
                        break;
                    }
                }
            }
            Monitor.MeepoCount = meepoCounter + 1;

            Log.CloseAndFlush();
        }
Beispiel #21
0
 public static bool IsIllusion(this Meepo unit)
 {
     return(unit.IsIllusion);
 }
Beispiel #22
0
        private static JungleCamps CheckMeepo(Meepo clone)
        {
            var a = new JungleCamps();

            return(JungleCamps.Where(x => x.meepos != null).Aggregate(a, (current, x) => (x.meepos.Handle == clone.Handle ? x : current)));
        }