예제 #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 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();
            }
        }
예제 #3
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);
            }
        }