Beispiel #1
0
        CheckAxe CheckAxe(GameObject axe, float time)
        {
            CheckAxe output = new CheckAxe(false, false);

            if (axe != null && axe.IsValid && Utils.TickCount + Game.Ping / 2000 - time <= LimitTime && InRadius(axe) && !InTurret(axe))
            {
                float   timeLeft  = LimitTime - (Utils.TickCount + Game.Ping / 2000 - time);
                float   AxeRadius = 1 / 1 * this.AxeRadius;
                Vector3 AxeCatchPositionFromHero = axe.Position + (myHero.Position - axe.Position).Normalized() * Math.Min(AxeRadius, myHero.Position.Distance(axe.Position));
                Vector3 OrbwalkPosition          = myHero.Position + (Utils.GetCursorPos().To3D() - axe.Position).Normalized() * AxeRadius;
                float   Time = timeLeft - ((myHero.Position.Distance(AxeCatchPositionFromHero)) / myHero.MoveSpeed) - (Game.Ping / 2000 - 100 / 1000);

                if (InAxeRadius(axe))
                {
                    output.CanAttack = true;
                }
                else if (Utils.TickCount - time <= 600 && Orbwalking.CanMove(0.5f))
                {
                    output.CanAttack = true;
                }
                else
                {
                    output.CanAttack = false;
                }

                if (myHero.Position.Distance(AxeCatchPositionFromHero) + 100 > myHero.MoveSpeed * (timeLeft * 0.001) * GetDelayCatch())
                {
                    output.CanMove = false;
                    if (!InAxeRadius(axe) && myHero.Position.Distance(AxeCatchPositionFromHero) > (myHero.MoveSpeed * timeLeft * 1.5) && myHero.Position.Distance(AxeCatchPositionFromHero) < (myHero.MoveSpeed * timeLeft * GetBonusSpeed()))
                    {
                        if (Config.GetBool("UseW") && myHero.Spellbook.GetSpell(SpellSlot.W).IsReady())
                        {
                            myHero.Spellbook.CastSpell(SpellSlot.W);
                        }
                    }
                }
                else
                {
                    output.CanMove = true;
                }
            }
            else
            {
                output.CanMove   = true;
                output.CanAttack = true;
            }
            if (Utils.TickCount - time > LimitTime + 0.2)
            {
                RemoveAxe(axe);
            }
            return(output);
        }
Beispiel #2
0
        public void CheckCatch()
        {
            if (AxesAbailables.Count > 0)
            {
                foreach (AxesAbailable obj in AxesAbailables)
                {
                    if (Utils.TickCount - obj.Time > 1200)
                    {
                        //AxesAbailables.Remove(obj);
                    }
                }
                Chat.Print(((Config.GetListIndex("CatchMode") == 0 && (Program.MainOrbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None)) || (Config.GetListIndex("CatchMode") == 1)).ToString());
                if (Config != null && Config.GetKeyToggle("Catch") &&
                    ((Config.GetListIndex("CatchMode") == 0 && (Program.MainOrbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None)) || (Config.GetListIndex("CatchMode") == 1)))
                {
                    CheckAxe v = new CheckAxe(true, true);

                    for (int i = 0; i < AxesAbailables.Count; i++)
                    {
                        if (AxesAbailables[i].Object != null)
                        {
                            AxesAbailable a  = AxesAbailables[i];
                            CheckAxe      c2 = CheckAxe(a.Object, a.Time);
                            if (!c2.CanMove)
                            {
                                v.CanMove = false;
                            }
                            if (!c2.CanAttack)
                            {
                                v.CanAttack = false;
                            }
                        }
                    }
                    if (AxesAbailables[0].Object != null)
                    {
                        if (v.CanAttack)
                        {
                            Program.MainOrbwalker.SetAttack(true);
                        }
                        else
                        {
                            Program.MainOrbwalker.SetAttack(false);
                        }
                        if (v.CanMove)
                        {
                            Program.MainOrbwalker.SetMovement(true);
                        }
                        else
                        {
                            Program.MainOrbwalker.SetMovement(false);
                            if (!InAxeRadius(AxesAbailables[0].Object) && Orbwalking.CanMove(0.2f))
                            {
                                EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, AxesAbailables[0].Object.Position);
                            }
                        }
                    }
                }
                else
                {
                    Program.MainOrbwalker.SetAttack(true);
                    Program.MainOrbwalker.SetMovement(true);
                }
            }
            else
            {
                Program.MainOrbwalker.SetMovement(true);
                Program.MainOrbwalker.SetAttack(true);
            }
        }