예제 #1
0
        private void SpellDetector_OnProcessDetectedSpells()
        {
            GameData.HeroInfo.UpdateInfo();
            if (!ConfigValue.DodgeSkillShots.GetBool())
            {
                LastPosInfo = PositionInfo.SetAllUndodgeable();
                EvadeSpell.UseEvadeSpell();
                return;
            }
            if (GameData.HeroInfo.ServerPos2D.CheckDangerousPos(0) || GameData.HeroInfo.ServerPos2DExtra.CheckDangerousPos(0))
            {
                if (EvadeSpell.PreferEvadeSpell())
                {
                    LastPosInfo = PositionInfo.SetAllUndodgeable();
                }
                else
                {
                    var calculationTimer = EvadeUtils.TickCount;

                    var posInfo = EvadeHelper.GetBestPosition();

                    var caculationTime = EvadeUtils.TickCount - calculationTimer;

                    if (NumCalculationTime > 0)
                    {
                        SumCalculationTime += caculationTime;
                        AvgCalculationTime  = SumCalculationTime / NumCalculationTime;
                    }
                    NumCalculationTime += 1;

                    //ConsoleDebug.WriteLine("CalculationTime: " + caculationTime);

                    /*if (EvadeHelper.GetHighestDetectedSpellID() > EvadeHelper.GetHighestSpellID(posInfo))
                     * {
                     *  return;
                     * }*/
                    if (posInfo != null)
                    {
                        LastPosInfo = posInfo.CompareLastMovePos();

                        var travelTime = GameData.HeroInfo.ServerPos2DPing.Distance(LastPosInfo.Position) / GameData.MyHero.MoveSpeed;

                        LastPosInfo.EndTime = EvadeUtils.TickCount + travelTime * 1000 - 100;
                    }

                    CheckHeroInDanger();
                    DodgeSkillShots();          //walking
                    CheckLastMoveTo();
                    EvadeSpell.UseEvadeSpell(); //using spells
                }
            }
            else
            {
                LastPosInfo = PositionInfo.SetAllDodgeable();
                CheckLastMoveTo();
            }


            //ConsoleDebug.WriteLine("SkillsDodged: " + lastPosInfo.dodgeableSpells.Count + " DangerLevel: " + lastPosInfo.undodgeableSpells.Count);
        }
예제 #2
0
        private void RecalculatePath()
        {
            if (!ObjectCache.MenuCache.Cache["RecalculatePosition"].As <MenuBool>().Enabled || !IsDodging)
            {
                return;
            }

            if (LastPosInfo == null || LastPosInfo.RecalculatedPath)
            {
                return;
            }

            var path = MyHero.Path;

            if (path.Length <= 0)
            {
                return;
            }

            var movePos = path.Last().To2D();

            if (!(movePos.Distance(LastPosInfo.Position) < 5))
            {
                return;
            }

            var posInfo = EvadeHelper.CanHeroWalkToPos(movePos, ObjectCache.MyHeroCache.MoveSpeed, 0, 0, false);

            if (posInfo.PosDangerCount <= LastPosInfo.PosDangerCount)
            {
                return;
            }

            LastPosInfo.RecalculatedPath = true;

            if (EvadeSpell.PreferEvadeSpell())
            {
                LastPosInfo = PositionInfo.SetAllUndodgeable();
            }
            else
            {
                var newPosInfo = EvadeHelper.GetBestPosition();
                if (newPosInfo.PosDangerCount >= posInfo.PosDangerCount)
                {
                    return;
                }

                LastPosInfo = newPosInfo;
                CheckHeroInDanger();
                DodgeSkillShots();
            }
        }
 public EvadeSpellConfigControl(Menu menu, string menuName, EvadeSpellData spell)
 {
     UseSpellCheckBox  = new DynamicCheckBox(ConfigDataType.EvadeSpell, spell.Name, "Use Spell", false, true, SpellConfigProperty.UseEvadeSpell);
     DangerLevelSlider = new StringSlider(ConfigDataType.EvadeSpell, spell.Name, "Danger Level", (int)spell.Dangerlevel, SpellConfigProperty.DangerLevel, SpellConfigControl.DangerLevels);
     SpellModeSlider   = new StringSlider(ConfigDataType.EvadeSpell, spell.Name, "Spell Mode", (int)EvadeSpell.GetDefaultSpellMode(spell), SpellConfigProperty.SpellMode, SpellModes);
     menu.AddGroupLabel(menuName);
     menu.Add(spell.Name + "UseEvadeSpell", UseSpellCheckBox.CheckBox);
     menu.Add(spell.Name + "EvadeSpellDangerLevel", DangerLevelSlider.Slider.Slider);
     menu.Add(spell.Name + "EvadeSpellMode", SpellModeSlider.Slider.Slider);
     Properties.SetEvadeSpell(spell.Name, new EvadeSpellConfig {
         DangerLevel = spell.Dangerlevel, Use = true, SpellMode = EvadeSpell.GetDefaultSpellMode(spell)
     });
 }
예제 #4
0
        public static bool CanHeroEvade(this Spell spell, Obj_AI_Base hero, out float rEvadeTime, out float rSpellHitTime)
        {
            var   heroPos      = hero.ServerPosition.To2D();
            float evadeTime    = 0;
            float spellHitTime = 0;
            var   speed        = hero.MoveSpeed;
            float delay        = 0;

            var moveBuff = EvadeSpell.EvadeSpells.OrderBy(s => s.Dangerlevel).FirstOrDefault(s => s.EvadeType == EvadeType.MovementSpeedBuff);

            if (moveBuff != null && EvadeSpell.ShouldUseMovementBuff(spell))
            {
                speed += speed * moveBuff.SpeedArray[ObjectManager.GetLocalPlayer().GetSpell(moveBuff.SpellKey).Level - 1] / 100;
                delay += (moveBuff.SpellDelay > 50 ? moveBuff.SpellDelay : 0) + ObjectCache.GamePing;
            }

            switch (spell.SpellType)
            {
            case SpellType.Line:
                var projection = heroPos.ProjectOn(spell.StartPos, spell.EndPos).SegmentPoint;
                evadeTime    = 1000 * (spell.Radius - heroPos.Distance(projection) + hero.BoundingRadius) / speed;
                spellHitTime = spell.GetSpellHitTime(projection);
                break;

            case SpellType.Circular:
                evadeTime    = 1000 * (spell.Radius - heroPos.Distance(spell.EndPos)) / speed;
                spellHitTime = spell.GetSpellHitTime(heroPos);
                break;

            case SpellType.Cone:
                var sides = new[]
                {
                    heroPos.ProjectOn(spell.CnStart, spell.CnLeft).SegmentPoint,
                    heroPos.ProjectOn(spell.CnLeft, spell.CnRight).SegmentPoint,
                    heroPos.ProjectOn(spell.CnRight, spell.CnStart).SegmentPoint
                };

                var p = sides.OrderBy(x => x.Distance(x)).First();
                evadeTime    = 1000 * (spell.Info.Range / 2 - heroPos.Distance(p) + hero.BoundingRadius) / speed;
                spellHitTime = spell.GetSpellHitTime(heroPos);
                break;
            }

            rEvadeTime    = evadeTime;
            rSpellHitTime = spellHitTime;

            return(spellHitTime - delay > evadeTime);
        }
예제 #5
0
        private void SpellDetector_OnProcessDetectedSpells()
        {
            ObjectCache.MyHeroCache.UpdateInfo();

            if (!ObjectCache.MenuCache.Cache["DodgeSkillShots"].As <MenuKeyBind>().Enabled)
            {
                LastPosInfo = PositionInfo.SetAllUndodgeable();
                EvadeSpell.UseEvadeSpell();
                return;
            }

            if (ObjectCache.MyHeroCache.ServerPos2D.CheckDangerousPos(0) || ObjectCache.MyHeroCache.ServerPos2DExtra.CheckDangerousPos(0))
            {
                if (EvadeSpell.PreferEvadeSpell())
                {
                    LastPosInfo = PositionInfo.SetAllUndodgeable();
                }
                else
                {
                    var posInfo = EvadeHelper.GetBestPosition();

                    if (posInfo != null)
                    {
                        LastPosInfo = posInfo.CompareLastMovePos();

                        var travelTime = ObjectCache.MyHeroCache.ServerPos2DPing.Distance(LastPosInfo.Position) / MyHero.MoveSpeed;

                        LastPosInfo.EndTime = Environment.TickCount + travelTime * 1000 - 100;
                    }

                    CheckHeroInDanger();

                    if (Environment.TickCount > LastStopEvadeTime)
                    {
                        DodgeSkillShots();
                    }

                    CheckLastMoveTo();
                    EvadeSpell.UseEvadeSpell();
                }
            }
            else
            {
                LastPosInfo = PositionInfo.SetAllDodgeable();
                CheckLastMoveTo();
            }
        }
예제 #6
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);
            }
        }
예제 #7
0
        private void RecalculatePath()
        {
            if (ConfigValue.RecalculatePath.GetBool() && IsDodging) //recheck path
            {
                if (LastPosInfo != null && !LastPosInfo.RecalculatedPath)
                {
                    var path = GameData.MyHero.Path;
                    if (path.Length > 0)
                    {
                        var movePos = path.Last().To2D();

                        if (movePos.Distance(LastPosInfo.Position) < 5) //more strict checking
                        {
                            var posInfo = EvadeHelper.CanHeroWalkToPos(movePos, GameData.HeroInfo.MoveSpeed, 0, 0, false);
                            if (posInfo.PosDangerCount > LastPosInfo.PosDangerCount)
                            {
                                LastPosInfo.RecalculatedPath = true;

                                if (EvadeSpell.PreferEvadeSpell())
                                {
                                    LastPosInfo = PositionInfo.SetAllUndodgeable();
                                }
                                else
                                {
                                    var newPosInfo = EvadeHelper.GetBestPosition();
                                    if (newPosInfo.PosDangerCount < posInfo.PosDangerCount)
                                    {
                                        LastPosInfo = newPosInfo;
                                        CheckHeroInDanger();
                                        DodgeSkillShots();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #8
0
 public static void Setup()
 {
     JadeSpace = new EvadeSpell("JadeSpace");
     RuhKaanR  = new EvadeSpell("Ruh KaanR");
     BakkoEx1  = new EvadeSpell("BakkoEX1");
 }
예제 #9
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);
        }
예제 #10
0
 public static void Setup()
 {
     RuhKaanR = new EvadeSpell("Ruh KaanR");
 }