Exemple #1
0
        private void Render_OnPresent()
        {
            //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 (var entry in SpellDetector.drawSpells)
            {
                var spell = entry.Value;

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

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

                    /*spellPos = spellPos + spell.Orientation * spell.info.projectileSpeed * (60 / 1000); //move the spellPos by 50 miliseconds forwards
                     * spellPos = spellPos + spell.Orientation * 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["(TestHeroPos)"].As <MenuBool>().Enabled)
            {
                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(new Vector3(heroPos2.X, heroPos2.Y, myHero.ServerPosition.Z),
                                  ObjectCache.myHeroCache.boundingRadius, 50, Color.Red);
                    Render.Circle(
                        new Vector3(myHero.ServerPosition.X, myHero.ServerPosition.Y, myHero.ServerPosition.Z),
                        ObjectCache.myHeroCache.boundingRadius, 50, Color.White);

                    Vector2 heroPos;
                    Render.WorldToScreen(ObjectManager.GetLocalPlayer().Position, out heroPos);
                    //var dimension = Render.GetTextExtent("Evade: ON");
                    Render.Text(heroPos.X - 10, heroPos.Y, Color.Red, "" + (int)heroPos2.Distance(heroPos1));

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

            if (testMenu["(DrawHeroPos)"].As <MenuBool>().Enabled)
            {
                Render.Circle(new Vector3(myHero.ServerPosition.X, myHero.ServerPosition.Y, myHero.ServerPosition.Z),
                              ObjectCache.myHeroCache.boundingRadius, 50, Color.White);
            }

            if (testMenu["(TestMoveTo)"].As <MenuKeyBind>().Enabled)
            {
                // fix ? wtf
                var MenuKeyBind = testMenu["(TestMoveTo)"].As <MenuKeyBind>();
                testMenu["(TestMoveTo)"].As <MenuKeyBind>().Value = false;

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

                myHero.IssueOrder(OrderType.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(OrderType.MoveTo, pos2.To3D()));
                //myHero.IssueOrder(OrderType.MoveTo, pos2, false);
            }

            if (testMenu["(TestPath)"].As <MenuBool>().Enabled)
            {
                var tPath     = myHero.GetPath(Game.CursorPos);
                var lastPoint = Vector2.Zero;

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

                    lastPoint = point2D;
                }
            }

            if (testMenu["(TestPath)"].As <MenuBool>().Enabled)
            {
                var tPath     = myHero.GetPath(Game.CursorPos);
                var lastPoint = Vector2.Zero;

                foreach (var 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 (var entry in SpellDetector.spells)
                {
                    var spell = entry.Value;

                    var     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["(ShowBuffs)"].As <MenuBool>().Enabled)
            {
                var target = myHero;

                foreach (var hero in GameObjects.EnemyHeroes)
                {
                    target = hero;
                }

                var buffs = target.Buffs;

                //ConsolePrinter.Print(myHero.ChampionName);

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

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

                var height = 20;

                foreach (var buff in buffs)
                {
                    if (buff.IsValid)
                    {
                        Render.Text(10, height, Color.White, buff.Name);
                        height += 20;

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

            if (testMenu["(TestTracker)"].As <MenuBool>().Enabled)
            {
                foreach (var entry in ObjectTracker.objTracker)
                {
                    var info = entry.Value;

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

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

            if (testMenu["(ShowMissileInfo)"].As <MenuBool>().Enabled)
            {
                if (testMissile != null)
                {
                    //Render.Circle.DrawCircle(testMissile.Position, testMissile.BoundingRadius, Color.White, 3);
                }
            }

            if (testMenu["(TestWall)"].As <MenuBool>().Enabled)
            {
                /*foreach (var posInfo in sortedBestPos)
                 * {
                 *  var posOnScreen = Drawing.WorldToScreen(posInfo.position.To3D());
                 *  //Render.Text(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance);
                 *
                 *
                 *  if (!posInfo.rejectPosition)
                 *  {
                 *      Render.Text(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance);
                 *  }
                 *
                 *  Render.Text(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);
                 *  }
                 * }*/

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

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

                while (posChecked < maxPosToCheck)
                {
                    radiusIndex++;

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

                    for (var 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(new Vector3(pos.X, pos.Y, myHero.Position.Z), 25, 50, Color.White);
                        }
                    }
                }
            }
        }
Exemple #2
0
        public static void CreateSpellData(Obj_AI_Base hero, Vector3 spellStartPos, Vector3 spellEndPos,
                                           SpellData spellData, GameObject obj = null, float extraEndTick = 0.0f, bool processSpell = true,
                                           SpellType spellType = SpellType.None, bool checkEndExplosion   = true, float spellRadius = 0)
        {
            if (checkEndExplosion && spellData.hasEndExplosion)
            {
                CreateSpellData(hero, spellStartPos, spellEndPos, spellData,
                                obj, extraEndTick, false, spellData.spellType, false);

                CreateSpellData(hero, spellStartPos, spellEndPos, spellData,
                                obj, extraEndTick, true, SpellType.Circular, false);

                return;
            }

            if (spellStartPos.Distance(myHero.Position) < spellData.range + 1000)
            {
                var startPosition = spellStartPos.To2D();
                var endPosition   = spellEndPos.To2D();
                var direction     = (endPosition - startPosition).Normalized();
                var endTick       = 0f;

                if (spellType == SpellType.None)
                {
                    spellType = spellData.spellType;
                }

                if (spellData.fixedRange) //for diana q
                {
                    if (endPosition.Distance(startPosition) > spellData.range)
                    {
                        endPosition = startPosition + direction * spellData.range;
                    }
                }

                if (spellType == SpellType.Line)
                {
                    endTick     = spellData.spellDelay + spellData.range / spellData.projectileSpeed * 1000;
                    endPosition = startPosition + direction * spellData.range;

                    if (spellData.fixedRange) // for all lines
                    {
                        if (endPosition.Distance(startPosition) < spellData.range)
                        {
                            endPosition = startPosition + direction * spellData.range;
                        }
                    }

                    if (endPosition.Distance(startPosition) > spellData.range)
                    {
                        endPosition = startPosition + direction * spellData.range;
                    }

                    if (spellData.useEndPosition)
                    {
                        var range = endPosition.Distance(startPosition);
                        endTick = spellData.spellDelay + range / spellData.projectileSpeed * 1000;
                    }

                    if (obj != null)
                    {
                        endTick -= spellData.spellDelay;
                    }
                }
                else if (spellType == SpellType.Circular)
                {
                    endTick = spellData.spellDelay;

                    if (endPosition.Distance(startPosition) > spellData.range)
                    {
                        endPosition = startPosition + direction * spellData.range;
                    }

                    if (spellData.projectileSpeed == 0 && hero != null)
                    {
                        endPosition = hero.ServerPosition.To2D();
                    }
                    else if (spellData.projectileSpeed > 0)
                    {
                        endTick = endTick + 1000 * startPosition.Distance(endPosition) / spellData.projectileSpeed;

                        if (spellData.spellType == SpellType.Line && spellData.hasEndExplosion)
                        {
                            if (!spellData.useEndPosition)
                            {
                                endPosition = startPosition + direction * spellData.range;
                            }
                        }
                    }
                }
                else if (spellType == SpellType.Arc)
                {
                    endTick = endTick + 1000 * startPosition.Distance(endPosition) / spellData.projectileSpeed;

                    if (obj != null)
                    {
                        endTick -= spellData.spellDelay;
                    }
                }
                else if (spellType == SpellType.Cone)
                {
                    endPosition = startPosition + direction * spellData.range;
                    endTick     = spellData.spellDelay;

                    if (endPosition.Distance(startPosition) > spellData.range)
                    {
                        endPosition = startPosition + direction * spellData.range;
                    }

                    if (spellData.projectileSpeed == 0 && hero != null)
                    {
                        endPosition = hero.ServerPosition.To2D();
                    }
                    else if (spellData.projectileSpeed > 0)
                    {
                        endTick = endTick + 1000 * startPosition.Distance(endPosition) / spellData.projectileSpeed;
                    }
                }
                else
                {
                    return;
                }

                if (spellData.invert)
                {
                    var dir = (startPosition - endPosition).Normalized();
                    endPosition = startPosition + dir * startPosition.Distance(endPosition);
                }

                if (spellData.isPerpendicular)
                {
                    startPosition = spellEndPos.To2D() - direction.Perpendicular() * spellData.secondaryRadius;
                    endPosition   = spellEndPos.To2D() + direction.Perpendicular() * spellData.secondaryRadius;
                }

                endTick += extraEndTick;

                var newSpell = new Spell();
                newSpell.startTime = EvadeUtils.TickCount;
                newSpell.endTime   = EvadeUtils.TickCount + endTick;
                newSpell.startPos  = startPosition;
                newSpell.endPos    = endPosition;
                newSpell.height    = spellEndPos.Z + spellData.extraDrawHeight;
                newSpell.direction = direction;
                newSpell.info      = spellData;
                newSpell.spellType = spellType;
                newSpell.radius    = spellRadius > 0 ? spellRadius : newSpell.GetSpellRadius();

                if (spellType == SpellType.Cone)
                {
                    newSpell.radius  = 100 + newSpell.radius * 3; // for now.. eh
                    newSpell.cnStart = startPosition + direction;
                    newSpell.cnLeft  = endPosition + direction.Perpendicular() * newSpell.radius;
                    newSpell.cnRight = endPosition - direction.Perpendicular() * newSpell.radius;
                }

                if (hero != null)
                {
                    newSpell.heroID = hero.NetworkId;
                }

                if (obj != null)
                {
                    newSpell.spellObject  = obj;
                    newSpell.projectileID = obj.NetworkId;
                }

                var spellID = CreateSpell(newSpell, processSpell);

                if (extraEndTick != 1337f) // traps
                {
                    DelayAction.Add((int)(endTick + spellData.extraEndTime), () => DeleteSpell(spellID));
                }
            }
        }
Exemple #3
0
        private void SpellMissile_OnCreate(GameObject obj)
        {
            /*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 && obj.Type == GameObjectType.MissileClient)
            {
                var mis = (MissileClient)obj;

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


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

            if (!obj.IsValid || obj.Type != GameObjectType.MissileClient)
            {
                return;
            }

            if (testMenu["ShowMissileInfo"].As <MenuBool>().Value == false)
            {
                return;
            }


            var 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.SpellData.Name + "]: Est.CastTime: " +
                                 (EvadeUtils.TickCount - lastHeroSpellCastTime));
            ConsolePrinter.Print("[" + missile.SpellData.Name + "]: Missile Name " + missile.SpellData.Name);
            ConsolePrinter.Print("[" + missile.SpellData.Name + "]: Missile Speed " + missile.SpellData.MissileSpeed);
            ConsolePrinter.Print("[" + missile.SpellData.Name + "]: Accel " + missile.SpellData.MissileAccel);
            ConsolePrinter.Print("[" + missile.SpellData.Name + "]: Max Speed " + missile.SpellData.MissileMaxSpeed);
            ConsolePrinter.Print("[" + missile.SpellData.Name + "]: LineWidth " + missile.SpellData.LineWidth);
            ConsolePrinter.Print("[" + missile.SpellData.Name + "]: Range " + missile.SpellData.CastRange);
            //ConsolePrinter.Print("Angle " + missile.SpellData.CastConeAngle);

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

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

            RenderObjects.Add(
                new RenderCircle(missile.StartPosition.To2D(), 500));
            RenderObjects.Add(
                new 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.SpellData.Name + "]: Est.Missile speed: " +
                                         1000 * (dist / (EvadeUtils.TickCount - testMissileSpeedStartTime)));
                }
            });

            SpellData spellData;

            if (missile.SpellCaster != null && missile.SpellCaster.Team != myHero.Team &&
                missile.SpellData.Name != null &&
                SpellDetector.onMissileSpells.TryGetValue(missile.SpellData.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 (var entry in SpellDetector.spells)
                        {
                            var spell = entry.Value;

                            if (spell.info.missileName == missile.SpellData.Name &&
                                spell.heroID == missile.SpellCaster.NetworkId)
                            {
                                if (spell.info.isThreeWay == false && spell.info.isSpecial == false)
                                {
                                    ConsolePrinter.Print("Acquired: " + (EvadeUtils.TickCount - spell.startTime));
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #4
0
        public static bool ActivateEvadeSpell(Spell spell, bool checkSpell = false)
        {
            if (spell.info.spellName.Contains("_trap"))
            {
                return(false);
            }

            var sortedEvadeSpells = evadeSpells.OrderBy(s => s.dangerlevel);

            var extraDelayBuffer    = ObjectCache.menuCache.cache["ExtraPingBuffer"].As <MenuSlider>().Value;
            var spellActivationTime = ObjectCache.menuCache.cache["SpellActivationTime"].As <MenuSlider>().Value +
                                      ObjectCache.gamePing + extraDelayBuffer;

            if (ObjectCache.menuCache.cache["CalculateWindupDelay"].As <MenuBool>().Enabled)
            {
                var extraWindupDelay = Evade.lastWindupTime - EvadeUtils.TickCount;
                if (extraWindupDelay > 0)
                {
                    return(false);
                }
            }

            foreach (var evadeSpell in sortedEvadeSpells)
            {
                var processSpell = true;

                if (Evade.evadeSpellMenu[evadeSpell.charName + evadeSpell.name + "EvadeSpellSettings"][
                        evadeSpell.name + "UseEvadeSpell"].As <MenuBool>().Value == false ||
                    GetSpellDangerLevel(evadeSpell) > spell.GetSpellDangerLevel() ||
                    !myHero.SpellBook.CanUseSpell(evadeSpell.spellKey) || evadeSpell.checkSpellName &&
                    myHero.SpellBook.GetSpell(evadeSpell.spellKey).Name != evadeSpell.spellName)
                {
                    continue; //can't use spell right now
                }
                float evadeTime, spellHitTime;
                spell.CanHeroEvade(myHero, out evadeTime, out spellHitTime);

                var finalEvadeTime = spellHitTime - evadeTime;

                if (checkSpell)
                {
                    var mode =
                        Evade.evadeSpellMenu[evadeSpell.charName + evadeSpell.name + "EvadeSpellSettings"][
                            evadeSpell.name + "EvadeSpellMode"]
                        .As <MenuList>().Value;

                    if (mode == 0)
                    {
                        continue;
                    }
                    if (mode == 1)
                    {
                        if (spellActivationTime < finalEvadeTime)
                        {
                            continue;
                        }
                    }
                }
                else
                {
                    //if (Evade.menu[evadeSpell.name + "LastResort"].As<MenuBool>().Enabled)
                    if (evadeSpell.spellDelay <= 50 && evadeSpell.evadeType != EvadeType.Dash)
                    {
                        var path = myHero.Path;
                        if (path.Length > 0)
                        {
                            var movePos = path[path.Length - 1].To2D();
                            var posInfo =
                                EvadeHelper.CanHeroWalkToPos(movePos, ObjectCache.myHeroCache.moveSpeed, 0, 0);

                            if (GetSpellDangerLevel(evadeSpell) > posInfo.posDangerLevel)
                            {
                                continue;
                            }
                        }
                    }
                }

                if (evadeSpell.evadeType != EvadeType.Dash && spellHitTime > evadeSpell.spellDelay + 100 + Game.Ping +
                    ObjectCache.menuCache.cache["ExtraPingBuffer"].As <MenuSlider>().Value)
                {
                    processSpell = false;

                    if (checkSpell == false)
                    {
                        continue;
                    }
                }

                if (evadeSpell.isSpecial)
                {
                    if (evadeSpell.useSpellFunc != null)
                    {
                        if (evadeSpell.useSpellFunc(evadeSpell, processSpell))
                        {
                            return(true);
                        }
                    }
                }
                else if (evadeSpell.evadeType == EvadeType.Blink)
                {
                    if (evadeSpell.castType == CastType.Position)
                    {
                        var posInfo = EvadeHelper.GetBestPositionBlink();
                        if (posInfo != null)
                        {
                            if (processSpell)
                            {
                                myHero.SpellBook.CastSpell(evadeSpell.spellKey, posInfo.position.To3D());
                            }
                            //CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell, posInfo.position), processSpell);
                            //DelayAction.Add(50, () => myHero.IssueOrder(OrderType.MoveTo, posInfo.position.To3D()));
                            return(true);
                        }
                    }
                    else if (evadeSpell.castType == CastType.Target)
                    {
                        var posInfo = EvadeHelper.GetBestPositionTargetedDash(evadeSpell);
                        if (posInfo != null && posInfo.target != null && posInfo.posDangerLevel == 0)
                        {
                            if (processSpell)
                            {
                                myHero.SpellBook.CastSpell(evadeSpell.spellKey, posInfo.target);
                            }
                            //CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell, posInfo.target), processSpell);
                            //DelayAction.Add(50, () => myHero.IssueOrder(OrderType.MoveTo, posInfo.position.To3D()));
                            return(true);
                        }
                    }
                }
                else if (evadeSpell.evadeType == EvadeType.Dash)
                {
                    if (evadeSpell.castType == CastType.Position)
                    {
                        var posInfo = EvadeHelper.GetBestPositionDash(evadeSpell);
                        if (posInfo != null && CompareEvadeOption(posInfo, checkSpell))
                        {
                            if (evadeSpell.isReversed)
                            {
                                var dir   = (posInfo.position - ObjectCache.myHeroCache.serverPos2D).Normalized();
                                var range = ObjectCache.myHeroCache.serverPos2D.Distance(posInfo.position);
                                var pos   = ObjectCache.myHeroCache.serverPos2D - dir * range;

                                posInfo.position = pos;
                            }

                            if (processSpell)
                            {
                                myHero.SpellBook.CastSpell(evadeSpell.spellKey, posInfo.position.To3D());
                            }
                            //DelayAction.Add(50, () => myHero.IssueOrder(OrderType.MoveTo, posInfo.position.To3D()));
                            return(true);
                        }
                    }
                    else if (evadeSpell.castType == CastType.Target)
                    {
                        var posInfo = EvadeHelper.GetBestPositionTargetedDash(evadeSpell);
                        if (posInfo != null && posInfo.target != null && posInfo.posDangerLevel == 0)
                        {
                            if (processSpell)
                            {
                                myHero.SpellBook.CastSpell(evadeSpell.spellKey, posInfo.target);
                            }
                            //CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell, posInfo.target), processSpell);
                            //DelayAction.Add(50, () => myHero.IssueOrder(OrderType.MoveTo, posInfo.position.To3D()));
                            return(true);
                        }
                    }
                }
                else if (evadeSpell.evadeType == EvadeType.WindWall)
                {
                    if (spell.hasProjectile() || evadeSpell.spellName == "FioraW") //temp fix, don't have fiora :'(
                    {
                        var dir = (spell.startPos - ObjectCache.myHeroCache.serverPos2D).Normalized();
                        var pos = ObjectCache.myHeroCache.serverPos2D + dir * 100;

                        if (processSpell)
                        {
                            myHero.SpellBook.CastSpell(evadeSpell.spellKey, pos.To3D());
                        }
                        //CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell, pos), processSpell);
                        return(true);
                    }
                }
                else if (evadeSpell.evadeType == EvadeType.SpellShield)
                {
                    if (evadeSpell.isItem)
                    {
                        if (processSpell)
                        {
                            myHero.SpellBook.CastSpell(evadeSpell.spellKey);
                        }
                        //CastEvadeSpell(() => myHero.SpellBook.CastSpell(evadeSpell.spellKey), processSpell);
                        return(true);
                    }

                    if (evadeSpell.castType == CastType.Target)
                    {
                        if (processSpell)
                        {
                            myHero.SpellBook.CastSpell(evadeSpell.spellKey, myHero);
                        }
                        // CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell, myHero), processSpell);
                        return(true);
                    }

                    if (evadeSpell.castType == CastType.Self)
                    {
                        if (processSpell)
                        {
                            myHero.SpellBook.CastSpell(evadeSpell.spellKey);
                        }
                        //CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell), processSpell);
                        return(true);
                    }
                }
                else if (evadeSpell.evadeType == EvadeType.MovementSpeedBuff)
                {
                    if (evadeSpell.isItem)
                    {
                        var posInfo = EvadeHelper.GetBestPosition();
                        if (posInfo != null)
                        {
                            if (processSpell)
                            {
                                myHero.SpellBook.CastSpell(evadeSpell.spellKey);
                            }
                            //CastEvadeSpell(() => myHero.SpellBook.CastSpell(evadeSpell.spellKey), processSpell);
                            DelayAction.Add(5, () => EvadeCommand.MoveTo(posInfo.position));
                            return(true);
                        }
                    }
                    else
                    {
                        if (evadeSpell.castType == CastType.Self)
                        {
                            var posInfo = EvadeHelper.GetBestPosition();
                            if (posInfo != null)
                            {
                                if (processSpell)
                                {
                                    myHero.SpellBook.CastSpell(evadeSpell.spellKey);
                                }
                                //CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell), processSpell);
                                DelayAction.Add(5, () => EvadeCommand.MoveTo(posInfo.position));
                                return(true);
                            }
                        }

                        else if (evadeSpell.castType == CastType.Position)
                        {
                            var posInfo = EvadeHelper.GetBestPosition();
                            if (posInfo != null)
                            {
                                if (processSpell)
                                {
                                    myHero.SpellBook.CastSpell(evadeSpell.spellKey, posInfo.position.To3D());
                                }
                                //CastEvadeSpell(() => EvadeCommand.CastSpell(evadeSpell, posInfo.position), processSpell);
                                DelayAction.Add(5, () => EvadeCommand.MoveTo(posInfo.position));
                                return(true);
                            }
                        }
                    }
                }
            }

            return(false);
        }