Beispiel #1
0
        public static PositionInfo SetAllUndodgeable()
        {
            ConsoleDebug.WriteLineColor("Setting all Undodgeable", ConsoleColor.Red);
            List <int> dodgeableSpells   = new List <int>();
            List <int> undodgeableSpells = new List <int>();

            var posDangerLevel = 0;
            var posDangerCount = 0;

            foreach (KeyValuePair <int, Spell> entry in SpellDetector.Spells)
            {
                Spell spell = entry.Value;
                undodgeableSpells.Add(entry.Key);

                var spellDangerLevel = spell.Dangerlevel;

                posDangerLevel  = Math.Max(posDangerLevel, (int)spellDangerLevel);
                posDangerCount += (int)spellDangerLevel;
            }

            return(new PositionInfo(
                       MyHero.Position.To2D(),
                       posDangerLevel,
                       posDangerCount,
                       true,
                       0,
                       dodgeableSpells,
                       undodgeableSpells));
        }
Beispiel #2
0
 private void Orbwalking_BeforeAttack(AttackableUnit target, Orbwalker.PreAttackArgs args)
 {
     if (IsDodging)
     {
         args.Process = false; //Block orbwalking
         ConsoleDebug.WriteLineColor("Blocked Orbwalk Before Attack", ConsoleColor.Red);
     }
 }
Beispiel #3
0
 private void Game_OnGameLoad_Disabled(EventArgs args)
 {
     ConsoleDebug.WriteLineColor("Failed loading Evade...", ConsoleColor.Red);
     ConsoleDebug.WriteLine("   Disabled due to needed core update (as of 5.24), please be patient!");
     Chat.Print("<font color='#ff0000'>Failed loading Evade...</font>");
     Chat.Print("   Disabled due to needed core update (as of 5.24), please be patient!");
     Menu = MainMenu.AddMenu("Evade (Disabled)", "Evade", "Evade (Disabled)");
     Menu.AddGroupLabel("Disabled due to needed core update!");
     Menu.AddLabel("As the latest update has caused issues with getting buffs and sending movement commands\n" +
                   " Evade can not be fixed.\n");
     Menu.AddSeparator();
     Menu.AddLabel("Please be patient for an update and in the mean time use EvadePlus");
 }
Beispiel #4
0
        private void Game_OnGameUpdate(EventArgs args)
        {
            try
            {
                CheckHeroInDanger();
                CheckDodgeOnlyDangerous();
                if (IsChanneling && ChannelPosition.Distance(GameData.HeroInfo.ServerPos2D) > 50) //TODO: !GameData.MyHero.IsChannelingImportantSpell()
                {
                    IsChanneling = false;
                    ConsoleDebug.WriteLineColor("Stopped Channeling.", ConsoleColor.Yellow);
                }

                //if (() Properties.Properties.Data["ResetConfig"].Cast<CheckBox>().CurrentValue)
                //{
                //    ResetConfig();
                //    menu["ResetConfig"].Cast<CheckBox>().CurrentValue = false;
                //}

                //if (() Properties.Properties.Data["ResetConfig200"].Cast<CheckBox>().CurrentValue)
                //{
                //    SetPatchConfig();
                //    menu["ResetConfig200"].Cast<CheckBox>().CurrentValue = false;
                //}

                var limitDelay = ConfigValue.TickLimiter.GetInt();
                //Tick limiter
                if (EvadeUtils.TickCount - LastTickCount > limitDelay && EvadeUtils.TickCount > LastStopEvadeTime)
                {
                    DodgeSkillShots(); //walking


                    ContinueLastBlockedCommand();
                    LastTickCount = EvadeUtils.TickCount;
                }

                EvadeSpell.UseEvadeSpell(); //using spells
                RecalculatePath();
            }
            catch (Exception e)
            {
                ConsoleDebug.WriteLine(e);
            }
        }
Beispiel #5
0
        private static void DebugIssueOrders(PlayerIssueOrderEventArgs args)
        {
            switch (args.Order)
            {
            case GameObjectOrder.HoldPosition:
                ConsoleDebug.WriteLineColor("HoldPosition: " + args.TargetPosition, ConsoleColor.Blue);
                break;

            case GameObjectOrder.MoveTo:
                ConsoleDebug.WriteLineColor("MoveTo: " + args.TargetPosition, ConsoleColor.Blue);
                break;

            case GameObjectOrder.AttackUnit:
                ConsoleDebug.WriteLineColor("AttackUnit: " + args.Target.Name, ConsoleColor.Blue);
                break;

            case GameObjectOrder.AutoAttackPet:
                ConsoleDebug.WriteLineColor("AutoAttackPet: " + args.Target.Name, ConsoleColor.Blue);
                break;

            case GameObjectOrder.AutoAttack:
                ConsoleDebug.WriteLineColor("AutoAttack: " + args.Target.Name, ConsoleColor.Blue);
                break;

            case GameObjectOrder.MovePet:
                ConsoleDebug.WriteLineColor("MovePet: " + args.TargetPosition, ConsoleColor.Blue);
                break;

            case GameObjectOrder.AttackTo:
                ConsoleDebug.WriteLineColor("AttackTo: " + args.TargetPosition, ConsoleColor.Blue);
                break;

            case GameObjectOrder.Stop:
                ConsoleDebug.WriteLineColor("Stop: " + args.TargetPosition, ConsoleColor.Blue);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            ConsoleDebug.WriteLineColor(NavMesh.GetCollisionFlags(args.TargetPosition), ConsoleColor.DarkMagenta);
        }
Beispiel #6
0
        public bool LoadConfigData()
        {
            ConsoleDebug.WriteLineColor("Please ignore the following errors, as its a EloBuddy issue, and will only happen once per load. (this message will display twice).", ConsoleColor.Green, true);
            if (!Directory.Exists(ConfigDataFolder) || !File.Exists(ConfigDataFile))
            {
                CreateConfigFile();
            }

            FileStream file = File.OpenRead(ConfigDataFile);

            try
            {
                XmlSerializer x    = new XmlSerializer(typeof(SerializableDictionary <ConfigValue, object>));
                var           temp = x.Deserialize(file) as SerializableDictionary <ConfigValue, object>;
                if (temp != null)
                {
                    foreach (var o in temp)
                    {
                        SetValue(o.Key, o.Value);
                    }
                }


                file.Close();
                ConsoleDebug.WriteLineColor("Alright, from now all errors are now an issue!", ConsoleColor.DarkGreen, true);
                return(true);
            }
            catch (Exception ex)
            {
                ConsoleDebug.WriteLineColor("Alright, from now all errors are now an issue!", ConsoleColor.DarkGreen, true);
                ConsoleDebug.WriteLine("Error Loading Config Data File...");
                ConsoleDebug.WriteLine(ex);
            }
            finally
            {
                file.Close();
            }
            return(false);
        }
Beispiel #7
0
        private void ContinueLastBlockedCommand()
        {
            if (ConfigValue.ContinueMovement.GetBool() && Situation.ShouldDodge())
            {
                var movePos    = LastBlockedUserMoveTo.TargetPosition;
                var extraDelay = Config.Properties.GetInt(ConfigValue.ExtraPingBuffer);

                if (IsDodging == false && LastBlockedUserMoveTo.IsProcessed == false && EvadeUtils.TickCount - LastEvadeCommand.Timestamp > Game.Ping + extraDelay && EvadeUtils.TickCount - LastBlockedUserMoveTo.Timestamp < 1500)
                {
                    movePos = movePos + (movePos - GameData.HeroInfo.ServerPos2D).Normalized() * EvadeUtils.Random.NextFloat(1, 65);

                    if (!EvadeHelper.CheckMovePath(movePos, Game.Ping + extraDelay))
                    {
                        //ConsoleDebug.WriteLine("Continue Movement");
                        //GameData.MyHero.IssueOrder(GameObjectOrder.MoveTo, movePos.To3D());
                        ConsoleDebug.WriteLineColor("Continuing Last Blocked Command", ConsoleColor.Yellow);
                        EvadeCommand.MoveTo(movePos);
                        LastBlockedUserMoveTo.IsProcessed = true;
                    }
                }
            }
        }
Beispiel #8
0
        private void Game_OnProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            if (!hero.IsMe)
            {
                return;
            }

            /*if (args.SData.Name.Contains("Recall"))
             * {
             *  var distance = lastStopPosition.Distance(args.Start.To2D());
             *  float moveTime = 1000 * distance / GameData.MyHero.MoveSpeed;
             *
             *  ConsoleDebug.WriteLine("Extra dist: " + distance + " Extra Delay: " + moveTime);
             * }*/

            string name;

            if (SpellDetector.ChanneledSpells.TryGetValue(args.SData.Name, out name))
            {
                IsChanneling    = true;
                ChannelPosition = GameData.MyHero.ServerPosition.To2D();
                ConsoleDebug.WriteLineColor("Channeling...", ConsoleColor.Green);
            }
            if (ConfigValue.CalculateWindupDelay.GetBool())
            {
                var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;

                if (castTime > 0 && !EloBuddy.SDK.Constants.AutoAttacks.IsAutoAttack(args.SData.Name) && Math.Abs(castTime - GameData.MyHero.AttackCastDelay * 1000) > 1)
                {
                    LastWindupTime = EvadeUtils.TickCount + castTime - Game.Ping / 2;
                    if (IsDodging)
                    {
                        SpellDetector_OnProcessDetectedSpells(); //reprocess
                        ConsoleDebug.WriteLineColor("Reprocessing Detected Spells...", ConsoleColor.Yellow);
                    }
                }
            }
        }
Beispiel #9
0
        public void LoadSpellDictionary()
        {
            LoadSpecialSpellPlugins();
            foreach (var hero in EntityManager.Heroes.AllHeroes)
            {
                try
                {
                    if (hero.IsMe)
                    {
                        foreach (var spell in SpellWindupDatabase.Spells.Where(
                                     s => (s.CharName == hero.ChampionName)))
                        {
                            if (!WindupSpells.ContainsKey(spell.SpellName))
                            {
                                WindupSpells.Add(spell.SpellName, spell);
                            }
                        }
                    }
                    if (hero.Team != MyHero.Team)
                    {
                        ConsoleDebug.WriteLine("        Hero Found: " + hero.ChampionName);
                        foreach (var spell in SpellDatabase.Spells.Where(
                                     s => (s.CharName == hero.ChampionName) || (s.CharName == Constants.AllChampions)))
                        {
                            ConsoleDebug.WriteLine("            Hero Spell Found: " + spell.SpellName);

                            if (!(spell.SpellType == SpellType.Circular ||
                                  spell.SpellType == SpellType.Line ||
                                  spell.SpellType == SpellType.Arc))
                            {
                                continue;
                            }

                            if (spell.CharName == Constants.AllChampions)
                            {
                                SpellSlot slot = hero.GetSpellSlotFromName(spell.SpellName);
                                if (slot == SpellSlot.Unknown)
                                {
                                    ConsoleDebug.WriteLineColor("           {0}: Not Found!", ConsoleColor.Yellow, false, spell.SpellName);
                                    continue;
                                }
                            }

                            if (!OnProcessSpells.ContainsKey(spell.SpellName))
                            {
                                if (spell.MissileName == "")
                                {
                                    spell.MissileName = spell.SpellName;
                                }

                                OnProcessSpells.Add(spell.SpellName, spell);
                                OnMissileSpells.Add(spell.MissileName, spell);

                                if (spell.ExtraSpellNames != null)
                                {
                                    foreach (string spellName in spell.ExtraSpellNames)
                                    {
                                        OnProcessSpells.Add(spellName, spell);
                                    }
                                }

                                if (spell.ExtraMissileNames != null)
                                {
                                    foreach (string spellName in spell.ExtraMissileNames)
                                    {
                                        OnMissileSpells.Add(spellName, spell);
                                    }
                                }

                                LoadSpecialSpell(spell);
                                if (!Config.Properties.Spells.Any(x => x.Key == spell.SpellName))
                                {
                                    string menuName    = spell.CharName + " (" + spell.SpellKey + ") Settings";
                                    var    enableSpell = !spell.DefaultOff;
                                    var    spellConfig = new SpellConfigControl(SpellMenu, menuName, spell, false /*enableSpell*/);
                                    spellConfig.AddToMenu();

                                    Config.Properties.SetSpell(spell.SpellName, spell.GetSpellConfig(spellConfig));
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    ConsoleDebug.WriteLine(ex.ToString(), ConsoleColor.Red);
                    throw;
                }
            }
        }
Beispiel #10
0
        private void DodgeSkillShots()
        {
            if (!Situation.ShouldDodge())
            {
                IsDodging = false;
                return;
            }

            /*
             * if (isDodging && playerInDanger == false) //serverpos test
             * {
             *  GameData.MyHero.IssueOrder(GameObjectOrder.HoldPosition, myHero, false);
             * }*/

            if (IsDodging)
            {
                ConsoleDebug.WriteLineColor("Dodging Skill Shots by Ka", ConsoleColor.Green);
                if (LastPosInfo != null)
                {
                    /*foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells)
                     * {
                     *  Spell spell = entry.Value;
                     *
                     *  ConsoleDebug.WriteLine("" + (int)(TickCount-spell.startTime));
                     * }*/


                    Vector2 lastBestPosition = LastPosInfo.Position;

                    if (!ConfigValue.ClickOnlyOnce.GetBool() || !(GameData.MyHero.Path.Length > 0 && LastPosInfo.Position.Distance(GameData.MyHero.Path.Last().To2D()) < 5))
                    //|| lastPosInfo.timestamp > lastEvadeOrderTime)
                    {
                        EvadeCommand.MoveTo(lastBestPosition);
                        LastEvadeOrderTime = EvadeUtils.TickCount;
                    }
                }
            }
            else //if not dodging
            {
                //Check if hero will walk into a skillshot
                var path = GameData.MyHero.Path;
                if (path.Length > 0)
                {
                    var movePos = path[path.Length - 1].To2D();

                    if (EvadeHelper.CheckMovePath(movePos))
                    {
                        /*if (() Properties.Properties.Data["AllowCrossing"].Cast<CheckBox>().CurrentValue)
                         * {
                         *  var extraDelayBuffer = () Properties.Properties.Data["ExtraPingBuffer"]
                         + 30;
                         +  var extraDist = () Properties.Properties.Data["ExtraCPADistance"]
                         + 10;
                         +
                         +  var tPosInfo = EvadeHelper.CanHeroWalkToPos(movePos, GameData.HeroInfo.moveSpeed, extraDelayBuffer + Game.Ping, extraDist);
                         +
                         +  if (tPosInfo.posDangerLevel == 0)
                         +  {
                         +      lastPosInfo = tPosInfo;
                         +      return;
                         +  }
                         + }*/

                        var posInfo = EvadeHelper.GetBestPositionMovementBlock(movePos);
                        if (posInfo != null)
                        {
                            EvadeCommand.MoveTo(posInfo.Position);
                        }
                        return;
                    }
                }
            }
        }
Beispiel #11
0
        private void Game_OnIssueOrder(Obj_AI_Base hero, PlayerIssueOrderEventArgs args)
        {
            if (!hero.IsMe)
            {
                return;
            }

            if (!Situation.ShouldDodge())
            {
                return;
            }
            //DebugIssueOrders(args);

            if (args.Order == GameObjectOrder.MoveTo)
            {
                //movement block code goes in here
                if (IsDodging && SpellDetector.Spells.Count > 0)
                {
                    ConsoleDebug.WriteLineColor("Issue Order detected while spells exist", ConsoleColor.Yellow);
                    CheckHeroInDanger();

                    LastBlockedUserMoveTo = new EvadeCommand
                    {
                        Order          = EvadeOrderCommand.MoveTo,
                        TargetPosition = args.TargetPosition.To2D(),
                        Timestamp      = EvadeUtils.TickCount,
                        IsProcessed    = false,
                    };

                    args.Process = false; //Block the command
                    ConsoleDebug.WriteLineColor("   Blocked Movement Command", ConsoleColor.Red);
                }
                else
                {
                    var movePos    = args.TargetPosition.To2D();
                    var extraDelay = Config.Properties.GetInt(ConfigValue.ExtraPingBuffer);
                    if (EvadeHelper.CheckMovePath(movePos, Game.Ping + extraDelay))
                    {
                        ConsoleDebug.WriteLineColor("Move Path is colliding with spell", ConsoleColor.Yellow);

                        /*if (() Properties.Properties.Data["AllowCrossing"].Cast<CheckBox>().CurrentValue)
                         * {
                         *  var extraDelayBuffer = () Properties.Properties.Data["ExtraPingBuffer"]
                         + 30;
                         +  var extraDist = () Properties.Properties.Data["ExtraCPADistance"]
                         + 10;
                         +
                         +  var tPosInfo = EvadeHelper.CanHeroWalkToPos(movePos, GameData.HeroInfo.moveSpeed, extraDelayBuffer + Game.Ping, extraDist);
                         +
                         +  if (tPosInfo.posDangerLevel == 0)
                         +  {
                         +      lastPosInfo = tPosInfo;
                         +      return;
                         +  }
                         + }*/

                        LastBlockedUserMoveTo = new EvadeCommand
                        {
                            Order          = EvadeOrderCommand.MoveTo,
                            TargetPosition = args.TargetPosition.To2D(),
                            Timestamp      = EvadeUtils.TickCount,
                            IsProcessed    = false,
                        };

                        args.Process = false; //Block the command
                        ConsoleDebug.WriteLineColor("   Blocked Movement Command", ConsoleColor.Red);
                        if (EvadeUtils.TickCount - LastMovementBlockTime < 500 && LastMovementBlockPos.Distance(args.TargetPosition) < 100)
                        {
                            return;
                        }

                        LastMovementBlockPos  = args.TargetPosition;
                        LastMovementBlockTime = EvadeUtils.TickCount;

                        var posInfo = EvadeHelper.GetBestPositionMovementBlock(movePos);
                        if (posInfo != null)
                        {
                            EvadeCommand.MoveTo(posInfo.Position);
                        }
                        return;
                    }
                    else
                    {
                        LastBlockedUserMoveTo.IsProcessed = true;
                    }
                }
            }
            else //need more logic
            {
                if (IsDodging)
                {
                    args.Process = false; //Block the command
                    ConsoleDebug.WriteLineColor("   Blocked IssueOrder(" + args.Order + ") Command", ConsoleColor.Red);
                }
                else
                {
                    if (args.Order == GameObjectOrder.AttackUnit)
                    {
                        var target = args.Target;
                        if (target != null && target.GetType() == typeof(Obj_AI_Base))
                        {
                            var baseTarget = (Obj_AI_Base)target;
                            if (baseTarget.IsValid())
                            {
                                if (GameData.HeroInfo.ServerPos2D.Distance(baseTarget.ServerPosition.To2D()) > GameData.MyHero.AttackRange + GameData.HeroInfo.BoundingRadius + baseTarget.BoundingRadius)
                                {
                                    var movePos    = args.TargetPosition.To2D();
                                    var extraDelay = Config.Properties.GetInt(ConfigValue.ExtraPingBuffer);
                                    if (EvadeHelper.CheckMovePath(movePos, Game.Ping + extraDelay))
                                    {
                                        args.Process = false; //Block the command
                                        ConsoleDebug.WriteLineColor("   Blocked Attack Unit Command", ConsoleColor.Red);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if (args.Process == true)
            {
                LastIssueOrderGameTime = Game.Time * 1000;
                LastIssueOrderTime     = EvadeUtils.TickCount;
                LastIssueOrderArgs     = args;

                if (args.Order == GameObjectOrder.MoveTo)
                {
                    LastMoveToPosition  = args.TargetPosition.To2D();
                    LastMoveToServerPos = GameData.MyHero.ServerPosition.To2D();
                }

                if (args.Order == GameObjectOrder.Stop)
                {
                    LastStopPosition = GameData.MyHero.ServerPosition.To2D();
                }
            }
        }
Beispiel #12
0
        private void Game_OnGameLoad(EventArgs args)
        {
            ConsoleDebug.WriteLineColor("Loading...", ConsoleColor.Blue, true);
            ConfigPluginControler.LoadConfigPresets();

            try
            {
                Menu = MainMenu.AddMenu("EzEvade", "ezEvade");
                ConsoleDebug.WriteLineColor("   Creating Menu...", ConsoleColor.Yellow, true);
                Menu.AddGroupLabel("EzEvade (EzEvade By Ka)");



                Menu.AddLabel("Last Update: " + LastUpdate);

                Menu mainMenu = Menu.AddSubMenu("Main", "Main");
                mainMenu.Add(ConfigValue.DodgeSkillShots.Name(), new DynamicKeyBind(ConfigValue.DodgeSkillShots, "Dodge SkillShots", true, KeyBind.BindTypes.PressToggle, 'K').KeyBind);
                mainMenu.Add(ConfigValue.ActivateEvadeSpells.Name(), new DynamicKeyBind(ConfigValue.ActivateEvadeSpells, "Use Evade Spells", true, KeyBind.BindTypes.PressToggle, 'K').KeyBind);
                mainMenu.Add(ConfigValue.OnlyDodgeDangerous.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.OnlyDodgeDangerous, "Dodge Only Dangerous", false).CheckBox);
                mainMenu.Add(ConfigValue.DodgeFowSpells.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.DodgeFowSpells, "Dodge FOW SkillShots", true).CheckBox);
                mainMenu.Add(ConfigValue.DodgeCircularSpells.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.DodgeCircularSpells, "Dodge Circular SkillShots", true).CheckBox);
                mainMenu.AddSeparator();
                mainMenu.Add(ConfigValue.DodgeDangerousKeysEnabled.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.DodgeDangerousKeysEnabled, "Enable Dodge Only Dangerous Keys", false).CheckBox);

                mainMenu.Add(ConfigValue.DodgeDangerousKey1.Name(), new DynamicKeyBind(ConfigValue.DodgeDangerousKey1, "Dodge Only Dangerous Key", false, KeyBind.BindTypes.HoldActive, 32).KeyBind);
                mainMenu.Add(ConfigValue.DodgeDangerousKey2.Name(), new DynamicKeyBind(ConfigValue.DodgeDangerousKey2, "Dodge Only Dangerous Key 2", false, KeyBind.BindTypes.HoldActive, 'V').KeyBind);

                mainMenu.AddSeparator();
                mainMenu.AddGroupLabel("EzEvade Mode");

                var sliderEvadeMode = new StringSlider(ConfigDataType.Data, "EzEvade", "EzEvade By Ka", 1, SpellConfigProperty.None, Enum.GetNames(typeof(EvadeMode)));
                sliderEvadeMode.Slider.Slider.OnValueChange += OnEvadeModeChange;
                mainMenu.Add("EzEvade", sliderEvadeMode.Slider.Slider);

                ConsoleDebug.WriteLineColor("       Detecting Spells...", ConsoleColor.Yellow, true);
                SpellDetector = new SpellDetector(Menu);
                _evadeSpell   = new EvadeSpell(Menu);

                ConsoleDebug.WriteLineColor("       Adding Humanizer and Miscellaneous Menus...", ConsoleColor.Yellow, true);
                Menu miscMenu = Menu.AddSubMenu("Misc Settings", "MiscSettings");
                miscMenu.Add(ConfigValue.HighPrecision.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.HighPrecision, "Enhanced Dodge Precision", false).CheckBox);
                miscMenu.Add(ConfigValue.RecalculatePath.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.RecalculatePath, "Recalculate Path", true).CheckBox);
                miscMenu.Add(ConfigValue.ContinueMovement.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.ContinueMovement, "Continue Last Movement", true).CheckBox);
                miscMenu.Add(ConfigValue.CalculateWindupDelay.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.CalculateWindupDelay, "Calculate Windup Delay", true).CheckBox);
                miscMenu.Add(ConfigValue.CheckSpellCollision.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.CheckSpellCollision, "Check Spell Collision", false).CheckBox);
                miscMenu.Add(ConfigValue.PreventDodgingUnderTower.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.PreventDodgingUnderTower, "Prevent Dodging Under Tower", false).CheckBox);
                miscMenu.Add(ConfigValue.PreventDodgingNearEnemy.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.PreventDodgingNearEnemy, "Prevent Dodging Near Enemies", false).CheckBox);
                miscMenu.Add(ConfigValue.AdvancedSpellDetection.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.AdvancedSpellDetection, "Advanced Spell Detection", false).CheckBox);
                miscMenu.Add(ConfigValue.ExtraDetectionRange.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraDetectionRange, "Extra Detection Range", 500, 500, 5000).Slider);
                //TODO: Add Reset
                //miscMenu.AddSeparator(100);
                //miscMenu.AddGroupLabel("Reset");
                //miscMenu.Add("ResetConfig", new DynamicCheckBox(ConfigDataType.Data, "ResetConfig", "Reset Properties", false).CheckBox);

                Menu fastEvadeMenu = Menu.AddSubMenu("Fast EzEvade", "FastEvade");
                fastEvadeMenu.Add(ConfigValue.FastMovementBlock.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.FastMovementBlock, "Fast Movement Block", true).CheckBox);
                fastEvadeMenu.Add(ConfigValue.FastEvadeActivationTime.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.FastEvadeActivationTime, "FastEzEvade Activation Time", 65, 0, 500).Slider);
                fastEvadeMenu.Add(ConfigValue.SpellActivationTime.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.SpellActivationTime, "Spell Activation Time", 200, 0, 1000).Slider);
                fastEvadeMenu.Add(ConfigValue.RejectMinDistance.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.RejectMinDistance, "Collision Distance Buffer", 10, 0, 100).Slider);

                Menu limiterMenu = Menu.AddSubMenu("Humanizer", "Limiter");
                limiterMenu.Add(ConfigValue.ClickOnlyOnce.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.ClickOnlyOnce, "Click Only Once", true).CheckBox);
                limiterMenu.Add(ConfigValue.EnableEvadeDistance.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.EnableEvadeDistance, "Extended EzEvade", false).CheckBox);
                limiterMenu.Add(ConfigValue.TickLimiter.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.TickLimiter, "Tick Limiter", 100, 0, 500).Slider);
                limiterMenu.Add(ConfigValue.SpellDetectionTime.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.SpellDetectionTime, "Spell Detection Time", 0, 0, 1000).Slider);
                limiterMenu.Add(ConfigValue.ReactionTime.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.ReactionTime, "Reaction Time", 0, 0, 500).Slider);
                limiterMenu.Add(ConfigValue.DodgeInterval.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.DodgeInterval, "Dodge Interval", 0, 0, 2000).Slider);

                Menu bufferMenu = Menu.AddSubMenu("ExtraBuffers", "ExtraBuffers");
                bufferMenu.Add(ConfigValue.ExtraPingBuffer.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraPingBuffer, "Extra Ping Buffer(hit by a lot of spells:increase)", 65, 0, 200).Slider);
                bufferMenu.Add(ConfigValue.ExtraCpaDistance.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraCpaDistance, "Extra Collision Distance", 10, 0, 150).Slider);
                bufferMenu.Add(ConfigValue.ExtraSpellRadius.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraSpellRadius, "Extra Spell Radius", 0, 0, 100).Slider);
                bufferMenu.Add(ConfigValue.ExtraEvadeDistance.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraEvadeDistance, "Extra EzEvade Distance", 100, 0, 500).Slider);
                //bufferMenu.Add(ConfigValue.ExtraSpellRadius.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraSpellRadius, "Extra Avoid Distance", 50, 0, 300).Slider);
                bufferMenu.Add(ConfigValue.MinimumComfortZone.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.MinimumComfortZone, "Minimum Distance to Champions", 550, 0, 1000).Slider);


                Menu debugMenu = Menu.AddSubMenu("Debug", "DebugMenu");

                debugMenu.AddGroupLabel("Debug");
                debugMenu.Add(ConfigValue.ShowDebugInfo.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.ShowDebugInfo, "Show Debug Info (Console)", false).CheckBox).OnValueChange +=
                    (sender, changeArgs) =>
                {
                    ConsoleDebug.Enabled = sender.CurrentValue;
                };
                //debugMenu.Add("DebugWithMySpells", new DynamicCheckBox(ConfigDataType.Data, "DebugWithMySpells", "Detect and draw my spells", false).CheckBox); //TODO: Remove From Addon

                debugMenu.AddSeparator();
                //debugMenu.Add(ConfigValue.EnableSpellTester.Name(), new DynamicCheckBox(ConfigDataType.Data, ConfigValue.EnableSpellTester, "Enable Spell Tester", false).CheckBox);
                //debugMenu.AddLabel("Press F5 after enabling / disabling the Spell Tester to load / unload it.");
                _spellDrawer = new SpellDrawer(Menu);

                ConsoleDebug.WriteLineColor("   Hooking Events...", ConsoleColor.Yellow, true);
                Player.OnIssueOrder   += Game_OnIssueOrder;
                Spellbook.OnCastSpell += Game_OnCastSpell;
                Game.OnUpdate         += Game_OnGameUpdate;

                ConsoleDebug.WriteLineColor("   Loading Spells...", ConsoleColor.Yellow, true);
                SpellDetector.LoadSpellDictionary();
                SpellDetector.InitChannelSpells();

                AIHeroClient.OnProcessSpellCast += Game_OnProcessSpell;

                Game.OnEnd += Game_OnGameEnd;
                SpellDetector.OnProcessDetectedSpells += SpellDetector_OnProcessDetectedSpells;
                Orbwalker.OnPreAttack += Orbwalking_BeforeAttack;

                Chat.Print(
                    "<font color='#23ADDB'>ezEvade Loading....</font><font color='#E81A0C'>Enjoy your game :-))");

                ConsoleDebug.WriteLineColor("   Setting Loaded Presets Values...", ConsoleColor.Yellow, true);
                ConfigPluginControler.SelectedPreset.LoadConfig();
            }
            catch (Exception)
            {
                Chat.Print("EzEvade Loading", Color.Red);
            }
            ConsoleDebug.WriteLineColor("Successfully Loaded!", ConsoleColor.Green, true);
        }
Beispiel #13
0
        private void Game_OnGameLoad(EventArgs args)
        {
            ConsoleDebug.WriteLineColor("Loading...", ConsoleColor.Blue, true);

            try
            {
                Menu = MainMenu.AddMenu("Evade", "Evade");
                ConsoleDebug.WriteLineColor("   Creating Menu...", ConsoleColor.Yellow, true);
                Menu.AddGroupLabel("Evade (EzEvade Port)");
                Menu.AddLabel("Please report any bugs or anything you think is a ");
                Menu.AddLabel("problem / issue, on the GitHub Issues Section, or with a reply to the Evade forum thread.");
                Menu.Add("OpenGithub", new CheckBox("Open Github's Issues Section in browser", false)).OnValueChange +=
                    delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs changeArgs)
                {
                    if (changeArgs.OldValue == false && changeArgs.NewValue)
                    {
                        sender.CurrentValue = false;
                        Process.Start(@"https://github.com/coman3/EloBuddy.Addons/issues");
                    }
                };
                Menu.AddLabel("All Credit for the actual evading (Movement and detection) in this assembly ");
                Menu.AddLabel("goes to the creator of EzEvade.");
                Menu.AddSeparator(100);

                Menu.AddLabel("Created By: Coman3");
                Menu.AddLabel("     Github: https://github.com/coman3/");
                Menu.Add("OpenGithubComan3", new CheckBox("Open Coman3's Github in Browser", false)).OnValueChange +=
                    delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs changeArgs)
                {
                    if (changeArgs.OldValue == false && changeArgs.NewValue)
                    {
                        sender.CurrentValue = false;
                        Process.Start(@"https://github.com/coman3/");
                    }
                };
                Menu.AddLabel("Last Update: " + LastUpdate);

                Menu mainMenu = Menu.AddSubMenu("Main", "Main");
                mainMenu.Add(new DynamicKeyBind(ConfigValue.DodgeSkillShots, "Dodge SkillShots", true, KeyBind.BindTypes.PressToggle, 'K'));
                mainMenu.Add(new DynamicKeyBind(ConfigValue.ActivateEvadeSpells, "Use Evade Spells", true, KeyBind.BindTypes.PressToggle, 'K'));
                mainMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.OnlyDodgeDangerous, "Dodge Only Dangerous", false));
                mainMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.DodgeFowSpells, "Dodge FOW SkillShots", false));
                mainMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.DodgeCircularSpells, "Dodge Circular SkillShots", true));
                mainMenu.AddSeparator();
                mainMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.DodgeDangerousKeysEnabled, "Enable Dodge Only Dangerous Keys", false));
                mainMenu.Add(new DynamicKeyBind(ConfigValue.DodgeDangerousKey1, "Dodge Only Dangerous Key", false, KeyBind.BindTypes.HoldActive, 32));
                mainMenu.Add(new DynamicKeyBind(ConfigValue.DodgeDangerousKey2, "Dodge Only Dangerous Key 2", false, KeyBind.BindTypes.HoldActive, 'V'));
                mainMenu.AddSeparator();
                mainMenu.Add(new DynamicComboBox(ConfigDataType.Data, ConfigValue.EvadeMode, "Evade Mode", 3, Enum.GetNames(typeof(EvadeMode))));

                ConsoleDebug.WriteLineColor("       Detecting Spells...", ConsoleColor.Yellow, true);
                SpellDetector = new SpellDetector(Menu);
                _evadeSpell   = new EvadeSpell(Menu);

                ConsoleDebug.WriteLineColor("       Adding Humanizer and Miscellaneous Menus...", ConsoleColor.Yellow, true);
                Menu miscMenu = Menu.AddSubMenu("Misc Settings", "MiscSettings");
                miscMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.HighPrecision, "Enhanced Dodge Precision", false));
                miscMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.RecalculatePath, "Recalculate Path", true));
                miscMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.ContinueMovement, "Continue Last Movement", true));
                miscMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.CalculateWindupDelay, "Calculate Windup Delay", true));
                miscMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.CheckSpellCollision, "Check Spell Collision", false));
                miscMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.PreventDodgingUnderTower, "Prevent Dodging Under Tower", false));
                miscMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.PreventDodgingNearEnemy, "Prevent Dodging Near Enemies", true));
                miscMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.AdvancedSpellDetection, "Advanced Spell Detection", false));
                miscMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraDetectionRange, "Extra Detection Range", 1000, 500, 5000));
                //TODO: Add Reset
                //miscMenu.AddSeparator(100);
                //miscMenu.AddGroupLabel("Reset");
                //miscMenu.Add("ResetConfig", new DynamicCheckBox(ConfigDataType.Data, "ResetConfig", "Reset Properties", false).CheckBox);

                Menu fastEvadeMenu = Menu.AddSubMenu("Fast Evade", "FastEvade");
                fastEvadeMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.FastMovementBlock, "Fast Movement Block", false));
                fastEvadeMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.FastEvadeActivationTime, "FastEvade Activation Time", 65, 0, 500));
                fastEvadeMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.SpellActivationTime, "Spell Activation Time", 200, 0, 1000));
                fastEvadeMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.RejectMinDistance, "Collision Distance Buffer", 10, 0, 100));

                Menu limiterMenu = Menu.AddSubMenu("Humanizer", "Limiter");
                limiterMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.ClickOnlyOnce, "Click Only Once", true));
                limiterMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.EnableEvadeDistance, "Extended Evade", false));
                limiterMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.TickLimiter, "Tick Limiter", 100, 0, 500));
                limiterMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.SpellDetectionTime, "Spell Detection Time", 0, 0, 1000));
                limiterMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.ReactionTime, "Reaction Time", 200, 0, 500));
                limiterMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.DodgeInterval, "Dodge Interval", 0, 0, 2000));

                Menu randomizerMenu = Menu.AddSubMenu("Randomizer", "Randomizer");
                randomizerMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.EnableRandomizer, "Enable", false));
                randomizerMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.DrawBlockedRandomizerSpells, "Draw Blocked Spells", true));
                randomizerMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.RandomizerPercentage, "Accuracy", 100, 0, 100));
                randomizerMenu.Add(new DynamicComboBox(ConfigDataType.Data, ConfigValue.RandomizerMaxDangerLevel, "Maximum Danger Level", (int)SpellDangerLevel.High, Enum.GetNames(typeof(SpellDangerLevel))));

                Menu bufferMenu = Menu.AddSubMenu("Adv. Humanizer", "ExtraBuffers");
                bufferMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraPingBuffer, "Extra Ping Buffer", 65, 0, 200));
                bufferMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraCpaDistance, "Extra Collision Distance", 10, 0, 150));
                bufferMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraSpellRadius, "Extra Spell Radius", 0, 0, 100));
                bufferMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraEvadeDistance, "Extra Evade Distance", 10, 0, 300));
                //bufferMenu.Add(ConfigValue.ExtraSpellRadius.Name(), new DynamicSlider(ConfigDataType.Data, ConfigValue.ExtraSpellRadius, "Extra Avoid Distance", 50, 0, 300).Slider);
                bufferMenu.Add(new DynamicSlider(ConfigDataType.Data, ConfigValue.MinimumComfortZone, "Minimum Distance to Champions", 300, 0, 1000));

                Menu debugMenu = Menu.AddSubMenu("Debug", "DebugMenu");

                debugMenu.AddGroupLabel("Debug");
                debugMenu.Add(new DynamicCheckBox(ConfigDataType.Data, ConfigValue.ShowDebugInfo, "Show Debug Info (Console)", false)).OnValueChange +=
                    (sender, changeArgs) =>
                {
                    ConsoleDebug.Enabled = sender.CurrentValue;
                };

                debugMenu.AddSeparator();

                _spellDrawer = new SpellDrawer(Menu);

                ConsoleDebug.WriteLineColor("   Hooking Events...", ConsoleColor.Yellow, true);
                Player.OnIssueOrder   += Game_OnIssueOrder;
                Spellbook.OnCastSpell += Game_OnCastSpell;
                Game.OnUpdate         += Game_OnGameUpdate;

                ConsoleDebug.WriteLineColor("   Loading Spells...", ConsoleColor.Yellow, true);
                SpellDetector.LoadSpellDictionary();
                SpellDetector.InitChannelSpells();

                AIHeroClient.OnProcessSpellCast += Game_OnProcessSpell;

                Game.OnEnd += Game_OnGameEnd;
                SpellDetector.OnProcessDetectedSpells += SpellDetector_OnProcessDetectedSpells;
                Orbwalker.OnPreAttack += Orbwalking_BeforeAttack;

                ConsoleDebug.WriteLineColor("   Setting Loaded Presets Values...", ConsoleColor.Yellow, true);
            }
            catch (Exception e)
            {
                ConsoleDebug.WriteLineColor(e, ConsoleColor.Red, true);
            }
            ConsoleDebug.WriteLineColor("Successfully Loaded!", ConsoleColor.Green, true);
        }