Ejemplo n.º 1
0
        private void CompareSpellLocation(Spell spell, Vector2 pos, float time)
        {
            var pos2 = spell.currentSpellPosition;

            if (spell.spellObject != null)
            {
                ConsolePrinter.Print("Compare: " + (pos2.Distance(pos)) / (EvadeUtils.TickCount - time));
            }
        }
Ejemplo n.º 2
0
        private void Game_OnDoCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!testMenu.Item("ShowDoCastInfo").GetValue <bool>())
            {
                return;
            }

            ConsolePrinter.Print("DoCast " + sender.Name + ": " + args.SData.Name);
        }
Ejemplo n.º 3
0
        private void Game_OnDoCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!testMenu["ShowDoCastInfo"].Cast <CheckBox>().CurrentValue)
            {
                return;
            }

            ConsolePrinter.Print("DoCast " + sender.Name + ": " + args.SData.Name);
        }
Ejemplo n.º 4
0
 private void Game_onSendPacket(GamePacketEventArgs args)
 {
     if (args.GetPacketId() == 160)
     {
         if (testMenu["EvadeTesterPing"].Cast <CheckBox>().CurrentValue)
         {
             ConsolePrinter.Print("Send Path ClickTime: " + (EvadeUtils.TickCount - lastRightMouseClickTime));
         }
     }
 }
Ejemplo n.º 5
0
 private void GameObject_OnIntegerPropertyChange(GameObject obj, GameObjectIntegerPropertyChangeEventArgs args)
 {
     if (obj.IsMe)
     {
         if (args.Property != "mExp" && args.Property != "mGold" && args.Property != "mGoldTotal")
         {
             ConsolePrinter.Print("Int" + args.Property + ": " + args.NewValue);
         }
     }
 }
Ejemplo n.º 6
0
 private void Game_onSendPacket(GamePacketEventArgs args)
 {
     //    if (args.HashAlgorithm == 160)
     {
         if (testMenu.Get <CheckBox>("EvadeTesterPing").CurrentValue)
         {
             ConsolePrinter.Print("Send Path ClickTime: " + (EvadeUtils.TickCount - lastRightMouseClickTime));
         }
     }
 }
Ejemplo n.º 7
0
 private void Game_onSendPacket(GamePacketEventArgs args)
 {
     if (args.GetPacketId() == 160)
     {
         if (testMenu.Item("EvadeTesterPing").GetValue <bool>())
         {
             ConsolePrinter.Print("Send Path ClickTime: " + (EvadeUtils.TickCount - lastRightMouseClickTime));
         }
     }
 }
Ejemplo n.º 8
0
        private void Game_OnGameLoad()
        {
            ConsolePrinter.Print("EvadeTester loaded");
            //menu.AddSubMenu(new Menu("Test", "Test"));

            //ConsolePrinter.Print("Ping:" + ObjectCache.gamePing);
            if (testMenu.Item("ShowBuffs").GetValue <bool>())
            {
                //ConsolePrinter.Print(myHero);
            }
        }
Ejemplo n.º 9
0
        private void Game_OnGameLoad()
        {
            ConsolePrinter.Print("EvadeTester loaded");
            //menu.AddSubMenu("Test", "Test");

            //ConsolePrinter.Print("Ping:" + ObjectCache.gamePing);
            if (testMenu["ShowBuffs"].Cast <CheckBox>().CurrentValue)
            {
                //ConsolePrinter.Print(myHero);
            }
        }
Ejemplo n.º 10
0
        private void CompareSpellLocation2(Spell spell)
        {
            var pos1    = spell.currentSpellPosition;
            var timeNow = EvadeUtils.TickCount;

            if (spell.spellObject != null)
            {
                ConsolePrinter.Print("start distance: " + (spell.startPos.Distance(pos1)));
            }

            DelayAction.Add(250, () => CompareSpellLocation(spell, pos1, timeNow));
        }
Ejemplo n.º 11
0
 private void Game_OnDelete(GameObject sender, EventArgs args)
 {
     if (testMenu.Item("ShowMissileInfo").GetValue <bool>())
     {
         if (testMissile != null && testMissile.NetworkId == sender.NetworkId)
         {
             var range = sender.Position.To2D().Distance(testMissile.StartPosition.To2D());
             ConsolePrinter.Print("[" + testMissile.SData.Name + "]: Est.Missile range: " + range);
             ConsolePrinter.Print("[" + testMissile.SData.Name + "]: Est.Missile speed: " + 1000 * (range / (EvadeUtils.TickCount - testMissileStartTime)));
         }
     }
 }
Ejemplo n.º 12
0
        private void Game_OnDelete(GameObject sender, EventArgs args)
        {
            if (testMenu["ShowMissileInfo"].Cast <CheckBox>().CurrentValue)
            {
                if (testMissile != null && testMissile.NetworkId == sender.NetworkId)
                {
                    var range = sender.Position.LSTo2D().LSDistance(testMissile.StartPosition.LSTo2D());
                    ConsolePrinter.Print("Est.Missile range: " + range);

                    ConsolePrinter.Print("Est.Missile speed: " + range / (EvadeUtils.TickCount - testMissileStartTime));
                }
            }
        }
Ejemplo n.º 13
0
        private void Game_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
        {
            if (testMenu.Item("TestSpellEndTime").GetValue <bool>() == false)
            {
                return;
            }

            if (!sender.IsMe)
            {
                return;
            }

            ConsolePrinter.Print("Damage taken time: " + (EvadeUtils.TickCount - lastSpellCastTime));
        }
Ejemplo n.º 14
0
        private void Game_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
        {
            if (testMenu["TestSpellEndTime"].Cast <CheckBox>().CurrentValue == false)
            {
                return;
            }

            if (!sender.IsMe)
            {
                return;
            }

            ConsolePrinter.Print("Damage taken time: " + (EvadeUtils.TickCount - lastSpellCastTime));
        }
Ejemplo n.º 15
0
        private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            if (!(hero is Obj_AI_Hero))
            {
                return;
            }



            if (testMenu.Item("ShowProcessSpell").GetValue <bool>())
            {
                ConsolePrinter.Print(args.SData.Name + " CastTime: " + (hero.Spellbook.CastTime - Game.Time));

                ConsolePrinter.Print("CastRadius: " + args.SData.CastRadius);

                /*foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(args.SData))
                 * {
                 *  string name = descriptor.Name;
                 *  object value = descriptor.GetValue(args.SData);
                 *  ConsolePrinter.Print("{0}={1}", name, value);
                 * }*/
            }

            if (args.SData.Name == "YasuoQW")
            {
                Draw.RenderObjects.Add(
                    new Draw.RenderCircle(args.Start.To2D(), 500));
                Draw.RenderObjects.Add(
                    new Draw.RenderCircle(args.End.To2D(), 500));
            }

            //ConsolePrinter.Print(EvadeUtils.TickCount - lastProcessPacketTime);
            //circleRenderPos = args.SData.ParticleStartOffset.To2D();

            /*Draw.RenderObjects.Add(
             *  new Draw.RenderPosition(args.Start.To2D(), Evade.GetTickCount + 500));
             * Draw.RenderObjects.Add(
             *  new Draw.RenderPosition(args.End.To2D(), Evade.GetTickCount + 500));*/

            /*float testTime;
             *
             *
             * testTime = Evade.GetTickCount;
             * for (int i = 0; i < 100000; i++)
             * {
             *  var testVar = ObjectCache.myHeroCache.boundingRadius;
             * }
             * ConsolePrinter.Print("Test time1: " + (Evade.GetTickCount - testTime));
             *
             * testTime = Evade.GetTickCount;
             * var cacheVar = ObjectCache.myHeroCache.boundingRadius;
             * for (int i = 0; i < 100000; i++)
             * {
             *  var testVar = cacheVar;
             * }
             * ConsolePrinter.Print("Test time1: " + (Evade.GetTickCount - testTime));*/

            ConsolePrinter.Print("NetworkID: " + args.MissileNetworkId);

            lastHeroSpellCastTime = EvadeUtils.TickCount;

            foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells)
            {
                Spell spell = entry.Value;

                if (spell.info.spellName == args.SData.Name &&
                    spell.heroID == hero.NetworkId)
                {
                    if (spell.info.isThreeWay == false && spell.info.isSpecial == false)
                    {
                        ConsolePrinter.Print("Time diff: " + (EvadeUtils.TickCount - spell.startTime));
                    }
                }
            }

            if (hero.IsMe)
            {
                lastSpellCastTime = EvadeUtils.TickCount;
            }
        }
Ejemplo n.º 16
0
        private void SpellMissile_OnCreate(GameObject obj, EventArgs args)
        {
            /*if (sender.Name.ToLower().Contains("minion")
            || sender.Name.ToLower().Contains("turret")
            || sender.Type == GameObjectType.obj_GeneralParticleEmitter)
            || {
            ||  return;
            || }
            ||
            || if (sender.IsValid<MissileClient>())
            || {
            ||  var tMissile = sender as MissileClient;
            ||  if (tMissile.SpellCaster.Type != GameObjectType.obj_AI_Hero)
            ||  {
            ||      return;
            ||  }
            || }
            ||
            || ConsolePrinter.Print(sender.Type + " : " + sender.Name);*/

            if (obj.IsValid <MissileClient>())
            {
                MissileClient mis = (MissileClient)obj;

                if (mis.SpellCaster is Obj_AI_Hero && mis.SData.IsAutoAttack())
                {
                    ConsolePrinter.Print("[" + mis.SData.Name + "]: Missile Speed " + mis.SData.MissileSpeed);
                    ConsolePrinter.Print("[" + mis.SData.Name + "]: LineWidth " + mis.SData.LineWidth);
                    ConsolePrinter.Print("[" + mis.SData.Name + "]: Range " + mis.SData.CastRange);
                    ConsolePrinter.Print("[" + mis.SData.Name + "]: Accel " + mis.SData.MissileAccel);
                }
            }


            //ConsolePrinter.Print(obj.Name + ": " + obj.Type);

            if (!obj.IsValid <MissileClient>())
            {
                return;
            }

            if (testMenu.Item("ShowMissileInfo").GetValue <bool>() == false)
            {
                return;
            }


            MissileClient missile = (MissileClient)obj;

            if (!(missile.SpellCaster is Obj_AI_Hero))
            {
                return;
            }

            var testMissileSpeedStartTime = EvadeUtils.TickCount;
            var testMissileSpeedStartPos  = missile.Position.To2D();

            DelayAction.Add(250, () =>
            {
                if (missile != null && missile.IsValid && !missile.IsDead)
                {
                    testMissileSpeedStartTime = EvadeUtils.TickCount;
                    testMissileSpeedStartPos  = missile.Position.To2D();
                }
            });

            testMissile          = missile;
            testMissileStartTime = EvadeUtils.TickCount;

            ConsolePrinter.Print("[" + missile.SData.Name + "]: Est.CastTime: " + (EvadeUtils.TickCount - lastHeroSpellCastTime));
            ConsolePrinter.Print("[" + missile.SData.Name + "]: Missile Name " + missile.SData.Name);
            ConsolePrinter.Print("[" + missile.SData.Name + "]: Missile Speed " + missile.SData.MissileSpeed);
            ConsolePrinter.Print("[" + missile.SData.Name + "]: Accel " + missile.SData.MissileAccel);
            ConsolePrinter.Print("[" + missile.SData.Name + "]: Max Speed " + missile.SData.MissileMaxSpeed);
            ConsolePrinter.Print("[" + missile.SData.Name + "]: LineWidth " + missile.SData.LineWidth);
            ConsolePrinter.Print("[" + missile.SData.Name + "]: Range " + missile.SData.CastRange);
            //ConsolePrinter.Print("Angle " + missile.SData.CastConeAngle);

            /*ConsolePrinter.Print("Offset: " + missile.SData.ParticleStartOffset);
             * ConsolePrinter.Print("Missile Speed " + missile.SData.MissileSpeed);
             * ConsolePrinter.Print("LineWidth " + missile.SData.LineWidth);
             * circleRenderPos = missile.SData.ParticleStartOffset.To2D();*/

            //ConsolePrinter.Print("Acquired: " + (EvadeUtils.TickCount - lastSpellCastTime));

            Draw.RenderObjects.Add(
                new Draw.RenderCircle(missile.StartPosition.To2D(), 500));
            Draw.RenderObjects.Add(
                new Draw.RenderCircle(missile.EndPosition.To2D(), 500));

            DelayAction.Add(750, () =>
            {
                if (missile != null && missile.IsValid && !missile.IsDead)
                {
                    var dist = missile.Position.To2D().Distance(testMissileSpeedStartPos);
                    ConsolePrinter.Print("[" + missile.SData.Name + "]: Est.Missile speed: " + 1000 * (dist / (EvadeUtils.TickCount - testMissileSpeedStartTime)));
                }
            });

            SpellData spellData;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != myHero.Team &&
                missile.SData.Name != null && SpellDetector.onMissileSpells.TryGetValue(missile.SData.Name, out spellData) &&
                missile.StartPosition != null && missile.EndPosition != null)
            {
                if (missile.StartPosition.Distance(myHero.Position) < spellData.range + 1000)
                {
                    var hero = missile.SpellCaster;

                    if (hero.IsVisible)
                    {
                        foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells)
                        {
                            Spell spell = entry.Value;

                            if (spell.info.missileName == missile.SData.Name &&
                                spell.heroID == missile.SpellCaster.NetworkId)
                            {
                                if (spell.info.isThreeWay == false && spell.info.isSpecial == false)
                                {
                                    //spell.spellObject = obj;
                                    ConsolePrinter.Print("Acquired: " + (EvadeUtils.TickCount - spell.startTime));
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 17
0
        private void SpellMissile_OnCreate(GameObject obj, EventArgs args)
        {
            if (obj.IsValid <MissileClient>())
            {
                MissileClient autoattack = (MissileClient)obj;

                /*if (!autoattack.SpellCaster.IsMinion)
                 * {
                 *  ConsolePrinter.Print("Missile Name " + autoattack.SData.Name);
                 *  ConsolePrinter.Print("Missile Speed " + autoattack.SData.MissileSpeed);
                 *  ConsolePrinter.Print("LineWidth " + autoattack.SData.LineWidth);
                 *  ConsolePrinter.Print("Range " + autoattack.SData.CastRange);
                 *  ConsolePrinter.Print("Accel " + autoattack.SData.MissileAccel);
                 * }*/
            }


            //ConsolePrinter.Print(obj.Name + ": " + obj.Type);

            if (!obj.IsValid <MissileClient>())
            {
                return;
            }

            if (testMenu.Item("ShowMissileInfo").GetValue <bool>() == false)
            {
                return;
            }


            MissileClient missile = (MissileClient)obj;

            testMissile          = missile;
            testMissileStartTime = EvadeUtils.TickCount;

            ConsolePrinter.Print("Est.CastTime: " + (EvadeUtils.TickCount - lastHeroSpellCastTime));
            ConsolePrinter.Print("Missile Name " + missile.SData.Name);
            ConsolePrinter.Print("Missile Speed " + missile.SData.MissileSpeed);
            ConsolePrinter.Print("LineWidth " + missile.SData.LineWidth);
            ConsolePrinter.Print("Range " + missile.SData.CastRange);
            ConsolePrinter.Print("Accel " + missile.SData.MissileAccel);
            //ConsolePrinter.Print("Angle " + missile.SData.CastConeAngle);

            /*ConsolePrinter.Print("Offset: " + missile.SData.ParticleStartOffset);
             * ConsolePrinter.Print("Missile Speed " + missile.SData.MissileSpeed);
             * ConsolePrinter.Print("LineWidth " + missile.SData.LineWidth);
             * circleRenderPos = missile.SData.ParticleStartOffset.To2D();*/

            //ConsolePrinter.Print("Acquired: " + (EvadeUtils.TickCount - lastSpellCastTime));

            renderPositions.Add(
                new RenderPosition(missile.StartPosition.To2D(), EvadeUtils.TickCount + 500));
            renderPositions.Add(
                new RenderPosition(missile.EndPosition.To2D(), EvadeUtils.TickCount + 500));

            SpellData spellData;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != myHero.Team &&
                missile.SData.Name != null && SpellDetector.onMissileSpells.TryGetValue(missile.SData.Name, out spellData) &&
                missile.StartPosition != null && missile.EndPosition != null)
            {
                if (missile.StartPosition.Distance(myHero.Position) < spellData.range + 1000)
                {
                    var hero = missile.SpellCaster;

                    if (hero.IsVisible)
                    {
                        foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells)
                        {
                            Spell spell = entry.Value;

                            if (spell.info.missileName == missile.SData.Name &&
                                spell.heroID == missile.SpellCaster.NetworkId)
                            {
                                if (spell.info.isThreeWay == false && spell.info.isSpecial == false)
                                {
                                    //spell.spellObject = obj;
                                    ConsolePrinter.Print("Acquired: " + (EvadeUtils.TickCount - spell.startTime));
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 18
0
        private void Game_OnIssueOrder(Obj_AI_Base hero, GameObjectIssueOrderEventArgs args)
        {
            if (!hero.IsMe)
            {
                return;
            }

            if (args.Order == GameObjectOrder.HoldPosition)
            {
                var path      = myHero.Path;
                var heroPoint = ObjectCache.myHeroCache.serverPos2D;


                if (path.Length > 0)
                {
                    var movePos = path[path.Length - 1].To2D();
                    var walkDir = (movePos - heroPoint).Normalized();

                    //circleRenderPos = EvadeHelper.GetRealHeroPos();
                    //heroPoint;// +walkDir * ObjectCache.myHeroCache.moveSpeed * (((float)ObjectCache.gamePing) / 1000);
                }
            }

            if (testMenu.Item("TestPath").GetValue <bool>())
            {
                var     tPath     = myHero.GetPath(args.TargetPosition);
                Vector2 lastPoint = Vector2.Zero;

                foreach (Vector3 point in tPath)
                {
                    var point2D = point.To2D();
                    Draw.RenderObjects.Add(new Draw.RenderCircle(point2D, 500));
                    //Render.Circle.DrawCircle(new Vector3(point.X, point.Y, point.Z), ObjectCache.myHeroCache.boundingRadius, Color.Violet, 3);
                }
            }

            /*
             * if (args.Order == GameObjectOrder.MoveTo)
             * {
             *  if (testingCollision)
             *  {
             *      if (args.TargetPosition.To2D().Distance(testCollisionPos) < 3)
             *      {
             *          //var path = myHero.GetPath();
             *          //circleRenderPos
             *
             *          args.Process = false;
             *      }
             *  }
             * }*/

            if (args.Order == GameObjectOrder.MoveTo)
            {
                if (testMenu.Item("EvadeTesterPing").GetValue <bool>())
                {
                    ConsolePrinter.Print("Sending Path ClickTime: " + (EvadeUtils.TickCount - lastRightMouseClickTime));
                }

                Vector2 heroPos = ObjectCache.myHeroCache.serverPos2D;
                Vector2 pos     = args.TargetPosition.To2D();
                float   speed   = ObjectCache.myHeroCache.moveSpeed;

                startWalkPos  = heroPos;
                startWalkTime = EvadeUtils.TickCount;

                foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells)
                {
                    Spell spell    = entry.Value;
                    var   spellPos = spell.currentSpellPosition;
                    var   walkDir  = (pos - heroPos).Normalized();


                    float spellTime = (EvadeUtils.TickCount - spell.startTime) - spell.info.spellDelay;
                    spellPos = spell.startPos + spell.direction * spell.info.projectileSpeed * (spellTime / 1000);
                    //ConsolePrinter.Print("aaaa" + spellTime);


                    bool  isCollision         = false;
                    float movingCollisionTime = MathUtils.GetCollisionTime(heroPos, spellPos, walkDir * (speed - 25), spell.direction * (spell.info.projectileSpeed - 200), ObjectCache.myHeroCache.boundingRadius, spell.radius, out isCollision);
                    if (isCollision)
                    {
                        //ConsolePrinter.Print("aaaa" + spellPos.Distance(spell.endPos) / spell.info.projectileSpeed);
                        if (true)//spellPos.Distance(spell.endPos) / spell.info.projectileSpeed > movingCollisionTime)
                        {
                            ConsolePrinter.Print("movingCollisionTime: " + movingCollisionTime);
                            //circleRenderPos = heroPos + walkDir * speed * movingCollisionTime;
                        }
                    }
                }
            }
        }
Ejemplo n.º 19
0
        private void Drawing_OnDraw(EventArgs args)
        {
            //PrintTimers();

            //EvadeHelper.CheckMovePath(Game.CursorPos.To2D());

            //TestUnderTurret();


            /*if (EvadeHelper.CheckPathCollision(myHero, Game.CursorPos.To2D()))
             * {
             *  var paths = myHero.GetPath(ObjectCache.myHeroCache.serverPos2DExtra.To3D(), Game.CursorPos);
             *  foreach (var path in paths)
             *  {
             *      Render.Circle.DrawCircle(path, ObjectCache.myHeroCache.boundingRadius, Color.Red, 3);
             *  }
             * }
             * else
             * {
             *  Render.Circle.DrawCircle(Game.CursorPos, ObjectCache.myHeroCache.boundingRadius, Color.White, 3);
             * }*/

            foreach (KeyValuePair <int, Spell> entry in SpellDetector.drawSpells)
            {
                Spell spell = entry.Value;

                if (spell.spellType == SpellType.Line)
                {
                    Vector2 spellPos = spell.currentSpellPosition;

                    Render.Circle.DrawCircle(new Vector3(spellPos.X, spellPos.Y, myHero.Position.Z), spell.info.radius, Color.White, 3);

                    /*spellPos = spellPos + spell.direction * spell.info.projectileSpeed * (60 / 1000); //move the spellPos by 50 miliseconds forwards
                     * spellPos = spellPos + spell.direction * 200; //move the spellPos by 50 units forwards
                     *
                     * Render.Circle.DrawCircle(new Vector3(spellPos.X, spellPos.Y, myHero.Position.Z), spell.info.radius, Color.White, 3);*/
                }
            }

            if (testMenu.Item("TestHeroPos").GetValue <bool>())
            {
                var path = myHero.Path;
                if (path.Length > 0)
                {
                    var heroPos2 = EvadeHelper.GetRealHeroPos(ObjectCache.gamePing + 50);// path[path.Length - 1].To2D();
                    var heroPos1 = ObjectCache.myHeroCache.serverPos2D;

                    Render.Circle.DrawCircle(new Vector3(heroPos2.X, heroPos2.Y, myHero.ServerPosition.Z), ObjectCache.myHeroCache.boundingRadius, Color.Red, 3);
                    Render.Circle.DrawCircle(new Vector3(myHero.ServerPosition.X, myHero.ServerPosition.Y, myHero.ServerPosition.Z), ObjectCache.myHeroCache.boundingRadius, Color.White, 3);

                    var heroPos   = Drawing.WorldToScreen(ObjectManager.Player.Position);
                    var dimension = Drawing.GetTextExtent("Evade: ON");
                    Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Red, "" + (int)(heroPos2.Distance(heroPos1)));

                    Render.Circle.DrawCircle(new Vector3(circleRenderPos.X, circleRenderPos.Y, myHero.ServerPosition.Z), 10, Color.Red, 3);
                }
            }

            if (testMenu.Item("DrawHeroPos").GetValue <bool>())
            {
                Render.Circle.DrawCircle(new Vector3(myHero.ServerPosition.X, myHero.ServerPosition.Y, myHero.ServerPosition.Z), ObjectCache.myHeroCache.boundingRadius, Color.White, 3);
            }

            if (testMenu.Item("TestMoveTo").GetValue <KeyBind>().Active)
            {
                var keyBind = testMenu.Item("TestMoveTo").GetValue <KeyBind>();
                testMenu.Item("TestMoveTo").SetValue(new KeyBind(keyBind.Key, KeyBindType.Toggle, false));

                /*lastRightMouseClickTime = EvadeUtils.TickCount;
                 * myHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos,false);*/

                myHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);

                var dir = (Game.CursorPos - myHero.Position).Normalized();
                //var pos2 = myHero.Position - dir * Game.CursorPos.Distance(myHero.Position);

                //var pos2 = myHero.Position.To2D() - dir.To2D() * 75;
                var pos2 = Game.CursorPos.To2D() - dir.To2D() * 75;

                //Console.WriteLine(myHero.BBox.Maximum.Distance(myHero.Position));

                DelayAction.Add(20, () => myHero.IssueOrder(GameObjectOrder.MoveTo, pos2.To3D(), false));
                //myHero.IssueOrder(GameObjectOrder.MoveTo, pos2, false);
            }

            if (testMenu.Item("TestPath").GetValue <bool>())
            {
                var     tPath     = myHero.GetPath(Game.CursorPos);
                Vector2 lastPoint = Vector2.Zero;

                foreach (Vector3 point in tPath)
                {
                    var point2D = point.To2D();
                    Render.Circle.DrawCircle(new Vector3(point.X, point.Y, point.Z), ObjectCache.myHeroCache.boundingRadius, Color.Violet, 3);

                    lastPoint = point2D;
                }
            }

            if (testMenu.Item("TestPath").GetValue <bool>())
            {
                var     tPath     = myHero.GetPath(Game.CursorPos);
                Vector2 lastPoint = Vector2.Zero;

                foreach (Vector3 point in tPath)
                {
                    var point2D = point.To2D();
                    //Render.Circle.DrawCircle(new Vector3(point.X, point.Y, point.Z), ObjectCache.myHeroCache.boundingRadius, Color.Violet, 3);

                    lastPoint = point2D;
                }

                foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells)
                {
                    Spell spell = entry.Value;

                    Vector2 to = Game.CursorPos.To2D();
                    var     dir = (to - myHero.Position.To2D()).Normalized();
                    Vector2 cPos1, cPos2;

                    var cpa     = MathUtilsCPA.CPAPointsEx(myHero.Position.To2D(), dir * ObjectCache.myHeroCache.moveSpeed, spell.endPos, spell.direction * spell.info.projectileSpeed, to, spell.endPos);
                    var cpaTime = MathUtilsCPA.CPATime(myHero.Position.To2D(), dir * ObjectCache.myHeroCache.moveSpeed, spell.endPos, spell.direction * spell.info.projectileSpeed);

                    //ConsolePrinter.Print("" + cpaTime);
                    //Render.Circle.DrawCircle(cPos1.To3D(), ObjectCache.myHeroCache.boundingRadius, Color.Red, 3);

                    if (cpa < ObjectCache.myHeroCache.boundingRadius + spell.radius)
                    {
                    }
                }
            }

            if (testMenu.Item("ShowBuffs").GetValue <bool>())
            {
                var target = myHero;

                foreach (var hero in HeroManager.Enemies)
                {
                    target = hero;
                }

                var buffs = target.Buffs;

                //ConsolePrinter.Print(myHero.ChampionName);

                //if(myHero.IsDead)
                //    ConsolePrinter.Print("dead");

                if (!target.IsTargetable)
                {
                    ConsolePrinter.Print("invul" + EvadeUtils.TickCount);
                }

                int height = 20;

                foreach (var buff in buffs)
                {
                    if (buff.IsValidBuff())
                    {
                        Drawing.DrawText(10, height, Color.White, buff.Name);
                        height += 20;

                        ConsolePrinter.Print(buff.Name);
                    }
                }
            }

            if (testMenu.Item("TestTracker").GetValue <bool>())
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

                    Vector3 endPos2;
                    if (info.usePosition == false)
                    {
                        endPos2 = info.obj.Position;
                    }
                    else
                    {
                        endPos2 = info.position;
                    }

                    Render.Circle.DrawCircle(new Vector3(endPos2.X, endPos2.Y, myHero.Position.Z), 50, Color.Green, 3);
                }


                /*foreach (var obj in ObjectManager.Get<Obj_AI_Minion>())
                 * {
                 *  ConsolePrinter.Print("minion: " + obj.Name);
                 *  if (obj.Name == "Ekko")
                 *  {
                 *      var pos = obj.Position;
                 *      Render.Circle.DrawCircle(pos, 100, Color.Green, 3);
                 *  }
                 * }*/
            }

            if (testMenu.Item("ShowMissileInfo").GetValue <bool>())
            {
                if (testMissile != null)
                {
                    //Render.Circle.DrawCircle(testMissile.Position, testMissile.BoundingRadius, Color.White, 3);
                }
            }

            if (testMenu.Item("TestWall").GetValue <bool>())
            {
                /*foreach (var posInfo in sortedBestPos)
                 * {
                 *  var posOnScreen = Drawing.WorldToScreen(posInfo.position.To3D());
                 *  //Drawing.DrawText(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance);
                 *
                 *
                 *  if (!posInfo.rejectPosition)
                 *  {
                 *      Drawing.DrawText(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance);
                 *  }
                 *
                 *  Drawing.DrawText(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance);
                 *
                 *  if (posInfo.posDangerCount <= 0)
                 *  {
                 *      var pos = posInfo.position;
                 *      Render.Circle.DrawCircle(new Vector3(pos.X, pos.Y, myHero.Position.Z), (float)25, Color.White, 3);
                 *  }
                 * }*/

                int posChecked    = 0;
                int maxPosToCheck = 50;
                int posRadius     = 50;
                int radiusIndex   = 0;

                Vector2             heroPoint = ObjectCache.myHeroCache.serverPos2D;
                List <PositionInfo> posTable  = new List <PositionInfo>();

                while (posChecked < maxPosToCheck)
                {
                    radiusIndex++;

                    int curRadius       = radiusIndex * (2 * posRadius);
                    int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));

                    for (int i = 1; i < curCircleChecks; i++)
                    {
                        posChecked++;
                        var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
                        var pos      = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));

                        if (!EvadeHelper.CheckPathCollision(myHero, pos))
                        {
                            Render.Circle.DrawCircle(new Vector3(pos.X, pos.Y, myHero.Position.Z), (float)25, Color.White, 3);
                        }
                    }
                }
            }
        }
Ejemplo n.º 20
0
 private void Game_OnGameInput(GameInputEventArgs args)
 {
     ConsolePrinter.Print("" + args.Input);
 }