Beispiel #1
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 #2
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");
                }
            }
        }