Exemplo n.º 1
1
        private void SpellDetector_OnCreateSpell(Spell newSpell)
        {
            var posInfo = EvadeHelper.GetBestPosition();
            lastPosInfo = posInfo;

            //Game.PrintChat("SkillsDodged: " + lastPosInfo.dodgeableSpells.Count + " DangerLevel: " + lastPosInfo.posDangerLevel);

            DodgeSkillShots(); //walking
            EvadeSpell.UseEvadeSpell(); //using spells

        }
        private void SpellDetector_OnProcessDetectedSpells()
        {
            if (EvadeHelper.CheckDangerousPos(myHero.ServerPosition.To2D(), 0))
            {
                if (Evade.menu.SubMenu("Main").Item("DodgeSkillShots").GetValue <KeyBind>().Active == false ||
                    EvadeSpell.PreferEvadeSpell())
                {
                    lastPosInfo = EvadeHelper.SetAllUndodgeable();
                    EvadeSpell.UseEvadeSpell(); //using spells
                }
                else
                {
                    var posInfo = EvadeHelper.GetBestPosition();

                    /*if (EvadeHelper.GetHighestDetectedSpellID() > EvadeHelper.GetHighestSpellID(posInfo))
                     * {
                     *  return;
                     * }*/

                    if (lastPosInfo != null && posInfo != null && lastPosInfo.posDangerCount < posInfo.posDangerCount)
                    {
                        return;
                    }

                    lastPosInfo = posInfo;

                    CheckHeroInDanger();
                    DodgeSkillShots();          //walking
                    EvadeSpell.UseEvadeSpell(); //using spells
                }
            }
            else
            {
                lastPosInfo = EvadeHelper.SetAllDodgeable();
            }


            //Game.PrintChat("SkillsDodged: " + lastPosInfo.dodgeableSpells.Count + " DangerLevel: " + lastPosInfo.undodgeableSpells.Count);
        }
        private void DodgeSkillShots()
        {
            if (!Situation.ShouldDodge())
            {
                isDodging = false;
                return;
            }

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

            if (isDodging)
            {
                if (lastPosInfo != null)
                {
                    /*foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells)
                     * {
                     *  Spell spell = entry.Value;
                     *
                     *  Game.PrintChat("" + (int)(GetTickCount()-spell.startTime));
                     * }*/


                    Vector2 lastBestPosition = lastPosInfo.position;

                    if (menu.SubMenu("MiscSettings").Item("RecalculatePosition").GetValue <bool>())//recheck path
                    {
                        var path = myHero.Path;
                        if (path.Length > 0)
                        {
                            var movePos = path[path.Length - 1].To2D();

                            if (movePos.Distance(lastPosInfo.position) < 5) //more strict checking
                            {
                                var posInfo = EvadeHelper.CanHeroWalkToPos(movePos, myHero.MoveSpeed, 0, 0, false);
                                if (EvadeHelper.isSamePosInfo(posInfo, lastPosInfo) && posInfo.posDangerCount > lastPosInfo.posDangerCount)
                                {
                                    var newPosInfo = EvadeHelper.GetBestPosition();
                                    if (newPosInfo.posDangerCount < posInfo.posDangerCount)
                                    {
                                        lastPosInfo = newPosInfo;
                                        CheckHeroInDanger();
                                    }
                                    else if (EvadeSpell.PreferEvadeSpell())
                                    {
                                        lastPosInfo = EvadeHelper.SetAllUndodgeable();
                                        EvadeSpell.UseEvadeSpell(); //using spells)
                                    }
                                }
                            }
                        }
                    }

                    EvadeCommand.MoveTo(lastBestPosition);
                }
            }
            else //if not dodging
            {
                //Check if hero will walk into a skillshot
                var path = myHero.Path;
                if (path.Length > 0)
                {
                    var movePos = path[path.Length - 1].To2D();

                    if (EvadeHelper.CheckMovePath(movePos))
                    {
                        var posInfo = EvadeHelper.GetBestPositionMovementBlock(movePos);
                        if (posInfo != null)
                        {
                            EvadeCommand.MoveTo(posInfo.position);
                        }
                        return;
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void DodgeSkillShots()
        {
            if (myHero.IsDead || isChanneling || menu.SubMenu("Main").Item("DodgeSkillShots").GetValue<KeyBind>().Active == false)
            {
                isDodging = false;
                return;
            }

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

            /*
            if (menu.SubMenu("KeySettings").Item("DodgeDangerousKey").GetValue<KeyBind>().Active == true)
            {
                VirtualMouse.VirtualClick(VirtualCommand.RightClick, myHero.ServerPosition);
            }*/

            if (isDodging)
            {
                Vector2 lastBestPosition = lastPosInfo.position;

                if (lastBestPosition.Distance(myHero.ServerPosition.To2D()) < 3) //a bit faulty
                {
                    //isDodging = false;
                }

                if (menu.SubMenu("MiscSettings").Item("RecalculatePosition").GetValue<bool>() && lastPosInfo != null)//recheck path
                {
                    var path = myHero.Path;
                    if (path.Length > 0)
                    {
                        var movePos = path[path.Length - 1].To2D();

                        if (movePos.Distance(lastPosInfo.position) < 5) //more strict checking
                        {
                            var posInfo = EvadeHelper.canHeroWalkToPos(movePos, myHero.MoveSpeed, 0, 0);
                            if (EvadeHelper.isSamePosInfo(posInfo, lastPosInfo) && posInfo.posDangerCount > lastPosInfo.posDangerCount)
                            {
                                lastPosInfo = EvadeHelper.GetBestPosition();
                            }
                        }
                    }
                }

                EvadeCommand.MoveTo(lastBestPosition);
            }
            else //if not dodging
            {
                //Check if hero will walk into a skillshot
                var path = myHero.Path;
                if (path.Length > 0)
                {
                    var movePos = path[path.Length - 1].To2D();

                    if (EvadeHelper.checkMovePath(movePos))
                    {
                        var posInfo = EvadeHelper.GetBestPositionMovementBlock(movePos);
                        if (posInfo != null)
                        {
                            EvadeCommand.MoveTo(posInfo.position);
                        }
                        return;
                    }
                }
            }
        }