Пример #1
0
        public static SpellModes GetDefaultSpellMode(EvadeSpellData spell)
        {
            if ((int)spell.Dangerlevel > (int)SpellDangerLevel.High)
            {
                return SpellModes.Undodgeable;
            }

            return SpellModes.ActivationTime;
        }
        public EvadeSpellConfigControl(Menu menu, string menuName, EvadeSpellData spell )
        {

            UseSpellCheckBox = new DynamicCheckBox(ConfigDataType.EvadeSpell, spell.Name, "Use Spell", true, 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) });
        }
        public static void LoadSpecialSpell(EvadeSpellData spellData)
        {
            if (spellData.SpellName == "EkkoEAttack")
            {
                spellData.UseSpellFunc = UseEkkoE2;
            }

            if (spellData.SpellName == "EkkoR")
            {
                spellData.UseSpellFunc = UseEkkoR;
            }
        }
Пример #4
0
 public static void CastSpell(EvadeSpellData spellData, Vector2 movePos)
 {
     EvadeSpell.LastSpellEvadeCommand = new EvadeCommand
     {
         Order = EvadeOrderCommand.CastSpell,
         TargetPosition = movePos,
         EvadeSpellData = spellData,
         Timestamp = EvadeUtils.TickCount,
         IsProcessed = false
     };
     ConsoleDebug.WriteLine("CastSpell: " + movePos);
     MyHero.Spellbook.CastSpell(spellData.SpellKey, movePos.To3D(), false);
 }
Пример #5
0
 public static void CastSpell(EvadeSpellData spellData, Obj_AI_Base target)
 {
     EvadeSpell.LastSpellEvadeCommand = new EvadeCommand
     {
         Order = EvadeOrderCommand.CastSpell,
         Target = target,
         EvadeSpellData = spellData,
         Timestamp = EvadeUtils.TickCount,
         IsProcessed = false
     };
     ConsoleDebug.WriteLine("CastSpell: " + target.Name);
     MyHero.Spellbook.CastSpell(spellData.SpellKey, target, false);
 }
Пример #6
0
 public static void Attack(EvadeSpellData spellData, Obj_AI_Base target)
 {
     EvadeSpell.LastSpellEvadeCommand = new EvadeCommand
     {
         Order = EvadeOrderCommand.Attack,
         Target = target,
         EvadeSpellData = spellData,
         Timestamp = EvadeUtils.TickCount,
         IsProcessed = false
     };
     ConsoleDebug.WriteLine("Attack: " + target.Name);
     Player.IssueOrder(GameObjectOrder.AttackUnit, target, false);
 }
Пример #7
0
        private static Menu CreateEvadeSpellMenu(EvadeSpellData spell)
        {

            string menuName = spell.Name + " (" + spell.SpellKey + ") Settings";

            if (spell.IsItem)
            {
                menuName = spell.Name + " Settings";
            }
            var evadeSpellConfig = new EvadeSpellConfigControl(EvadeSpellMenu, menuName, spell);

            return evadeSpellConfig.GetMenu();
        }
        public static bool UseEkkoE2(EvadeSpellData evadeSpell, bool process = true)
        {
            if (MyHero.HasBuff("ekkoeattackbuff"))
            {
                var posInfo = EvadeHelper.GetBestPositionTargetedDash(evadeSpell);
                if (posInfo != null && posInfo.Target != null)
                {
                    EvadeSpell.CastEvadeSpell(() => EvadeCommand.Attack(evadeSpell, posInfo.Target), process);
                    //DelayAction.Add(50, () => myHero.IssueOrder(GameObjectOrder.MoveTo, posInfo.position.To3D()));
                    return true;
                }
            }

            return false;
        }
        public static bool UseEkkoR(EvadeSpellData evadeSpell, bool process = true)
        {
            foreach (var obj in ObjectManager.Get<Obj_AI_Minion>())
            {
                if (obj != null && obj.IsValid && !obj.IsDead && obj.Name == "Ekko" && obj.IsAlly)
                {
                    Vector2 blinkPos = obj.ServerPosition.To2D();
                    if (!blinkPos.CheckDangerousPos(10))
                    {
                        EvadeSpell.CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell), process);
                        //DelayAction.Add(50, () => myHero.IssueOrder(GameObjectOrder.MoveTo, posInfo.position.To3D()));
                        return true;
                    }

                }
            }

            return false;
        }
Пример #10
0
 public static void CastSpell(EvadeSpellData spellData)
 {
     EvadeSpell.LastSpellEvadeCommand = new EvadeCommand
     {
         Order = EvadeOrderCommand.CastSpell,
         EvadeSpellData = spellData,
         Timestamp = EvadeUtils.TickCount,
         IsProcessed = false
     };
     ConsoleDebug.WriteLine("CastSpell");
     MyHero.Spellbook.CastSpell(spellData.SpellKey,false);
 }
Пример #11
0
 public static SpellDangerLevel GetSpellDangerLevel(EvadeSpellData spell)
 {
     return Config.Properties.GetEvadeSpell(spell.Name).DangerLevel;
 }
Пример #12
0
        public static PositionInfo GetBestPositionTargetedDash(EvadeSpellData spell)
        {
            /*if (spell.spellDelay > 0)
            {
                if (CheckWindupTime(spell.spellDelay))
                {
                    return null;
                }
            }*/

            var extraDelayBuffer = Config.Properties.GetInt(ConfigValue.ExtraPingBuffer);
            var extraDist = ConfigValue.ExtraCpaDistance.GetInt();

            Vector2 heroPoint = GameData.HeroInfo.ServerPos2DPing;
            Vector2 lastMovePos = Game.CursorPos.To2D();

            List<PositionInfo> posTable = new List<PositionInfo>();
            List<int> spellList = SpellDetector.GetSpellList();

            //int minDistance = 50; //Math.Min(spell.range, minDistance)
            //int maxDistance = int.MaxValue;

            //if (spell.FixedRange)
            //{
            //    minDistance = maxDistance = (int)spell.Range;
            //}

            List<Obj_AI_Base> collisionCandidates = new List<Obj_AI_Base>();

            if (spell.SpellTargets.Contains(SpellTargets.Targetables))
            {
                foreach (var obj in ObjectManager.Get<Obj_AI_Base>()
                    .Where(h => !h.IsMe && h.IsValidTarget(spell.Range)))
                {
                    if (obj.GetType() == typeof(Obj_AI_Turret) && ((Obj_AI_Turret)obj).IsValid())
                    {
                        collisionCandidates.Add(obj);
                    }
                }
            }
            else
            {
                List<AIHeroClient> heroList = new List<AIHeroClient>();

                if (spell.SpellTargets.Contains(SpellTargets.EnemyChampions)
                    && spell.SpellTargets.Contains(SpellTargets.AllyChampions))
                {
                    heroList = EntityManager.Heroes.AllHeroes;
                }
                else if (spell.SpellTargets.Contains(SpellTargets.EnemyChampions))
                {
                    heroList = EntityManager.Heroes.Enemies;
                }
                else if (spell.SpellTargets.Contains(SpellTargets.AllyChampions))
                {
                    heroList = EntityManager.Heroes.Allies;
                }


                foreach (var hero in heroList.Where(h => !h.IsMe && h.IsValidTarget(spell.Range)))
                {
                    collisionCandidates.Add(hero);
                }

                List<Obj_AI_Minion> minionList = new List<Obj_AI_Minion>();

                if (spell.SpellTargets.Contains(SpellTargets.EnemyMinions)
                    && spell.SpellTargets.Contains(SpellTargets.AllyMinions))
                {
                    minionList = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Both, Player.Instance.ServerPosition, spell.Range).ToList();
                }
                else if (spell.SpellTargets.Contains(SpellTargets.EnemyMinions))
                {
                    minionList = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Instance.ServerPosition, spell.Range).ToList();
                }
                else if (spell.SpellTargets.Contains(SpellTargets.AllyMinions))
                {
                    minionList = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Ally, Player.Instance.ServerPosition, spell.Range).ToList();
                }

                foreach (var minion in minionList.Where(h => h.IsValidTarget(spell.Range)))
                {
                    collisionCandidates.Add(minion);
                }
            }

            foreach (var candidate in collisionCandidates)
            {
                var pos = candidate.ServerPosition.To2D();

                PositionInfo posInfo;

                if (spell.SpellName == "YasuoDashWrapper")
                {
                    bool hasDashBuff = false;

                    foreach (var buff in candidate.Buffs)
                    {
                        if (buff.Name == "YasuoDashWrapper")
                        {
                            hasDashBuff = true;
                            break;
                        }
                    }

                    if (hasDashBuff)
                        continue;
                }

                if (spell.BehindTarget)
                {
                    var dir = (pos - heroPoint).Normalized();
                    pos = pos + dir * (candidate.BoundingRadius + GameData.HeroInfo.BoundingRadius);
                }

                if (spell.InfrontTarget)
                {
                    var dir = (pos - heroPoint).Normalized();
                    pos = pos - dir * (candidate.BoundingRadius + GameData.HeroInfo.BoundingRadius);
                }

                if (spell.FixedRange)
                {
                    var dir = (pos - heroPoint).Normalized();
                    pos = heroPoint + dir * spell.Range;
                }

                if (spell.EvadeType == EvadeType.Dash)
                {
                    posInfo = CanHeroWalkToPos(pos, spell.Speed, extraDelayBuffer + Game.Ping, extraDist);
                    posInfo.IsDangerousPos = pos.CheckDangerousPos(6);
                    posInfo.DistanceToMouse = pos.GetPositionValue();
                    posInfo.SpellList = spellList;
                }
                else
                {
                    bool isDangerousPos = pos.CheckDangerousPos(6);
                    var dist = pos.GetPositionValue();

                    posInfo = new PositionInfo(pos, isDangerousPos, dist);
                }

                posInfo.Target = candidate;
                posTable.Add(posInfo);
            }

            if (spell.EvadeType == EvadeType.Dash)
            {
                var sortedPosTable =
                posTable.OrderBy(p => p.IsDangerousPos)
                        .ThenBy(p => p.PosDangerLevel)
                        .ThenBy(p => p.PosDangerCount)
                        .ThenBy(p => p.DistanceToMouse);

                var first = sortedPosTable.FirstOrDefault();
                if (first != null && AdEvade.LastPosInfo != null && first.IsDangerousPos == false
                    && AdEvade.LastPosInfo.PosDangerLevel > first.PosDangerLevel)
                {
                    return first;
                }
            }
            else
            {
                var sortedPosTable =
                posTable.OrderBy(p => p.IsDangerousPos)
                        //.ThenByDescending(p => p.hasComfortZone)
                        //.ThenBy(p => p.hasExtraDistance)
                        .ThenBy(p => p.DistanceToMouse);

                var first = sortedPosTable.FirstOrDefault();

                return first;
            }

            return null;

        }
Пример #13
0
        public static PositionInfo GetBestPositionDash(EvadeSpellData spell)
        {
            int posChecked = 0;
            int maxPosToCheck = 100;
            int posRadius = 50;
            int radiusIndex = 0;

            var extraDelayBuffer = Config.Properties.GetInt(ConfigValue.ExtraPingBuffer);
            var extraEvadeDistance = 100;// Evade.Menu.SubMenu("MiscSettings").SubMenu("ExtraBuffers").Item("ExtraEvadeDistance");
            var extraDist = ConfigValue.ExtraCpaDistance.GetInt();

            Vector2 heroPoint = GameData.HeroInfo.ServerPos2DPing;
            Vector2 lastMovePos = Game.CursorPos.To2D();

            List<PositionInfo> posTable = new List<PositionInfo>();
            List<int> spellList = SpellDetector.GetSpellList();

            int minDistance = 50; //Math.Min(spell.range, minDistance)
            int maxDistance = int.MaxValue;

            if (spell.FixedRange)
            {
                minDistance = maxDistance = (int)spell.Range;
            }

            while (posChecked < maxPosToCheck)
            {
                radiusIndex++;

                int curRadius = radiusIndex * (2 * posRadius) + (minDistance - 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)));

                    var posInfo = CanHeroWalkToPos(pos, spell.Speed, extraDelayBuffer + Game.Ping, extraDist);
                    posInfo.IsDangerousPos = pos.CheckDangerousPos(6);
                    posInfo.HasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;// ? 1 : 0;                    
                    posInfo.DistanceToMouse = pos.GetPositionValue();
                    posInfo.SpellList = spellList;

                    posInfo.PosDistToChamps = pos.GetDistanceToChampions();

                    posTable.Add(posInfo);
                }

                if (curRadius >= maxDistance)
                    break;
            }

            var sortedPosTable =
                posTable.OrderBy(p => p.IsDangerousPos)
                        .ThenBy(p => p.PosDangerLevel)
                        .ThenBy(p => p.PosDangerCount)
                        .ThenBy(p => p.HasExtraDistance)
                        .ThenBy(p => p.DistanceToMouse);

            foreach (var posInfo in sortedPosTable)
            {
                if (CheckPathCollision(MyHero, posInfo.Position) == true)
                {
                    if (PositionInfoStillValid(posInfo, spell.Speed))
                    {
                        return posInfo;
                    }
                }
            }

            return null;
        }