Ejemplo n.º 1
0
        /// <summary>
        ///     The callback when called spell hit detected
        /// </summary>
        /// <param name="direction">The skillshot direction.</param>
        /// <param name="target">The target.</param>
        public void OnSpellHitDetected(Vector2 direction, AIHeroClient target)
        {
            EvadeData edata;

            var evade_direction = direction.Perpendicular();
            var evade_pos       = ObjectManager.Player.ServerPosition.To2D() + evade_direction * EvadeSpell.Range;

            var position_needed = SpecialMethod.HasFlag(EvadeMethods.Dash) || SpecialMethod.HasFlag(EvadeMethods.Blink);

            if (position_needed)
            {
                switch (getSliderItem("EVADEMETHOD"))
                {
                case 0:     //near turret
                    CorrectNearTurret(ref evade_pos, evade_direction);
                    break;

                case 1:     //less enemies
                    CorrectLessEnemies(ref evade_pos, evade_direction);
                    break;

                case 2:     //both
                    if (!CorrectLessEnemies(ref evade_pos, evade_direction))
                    {
                        CorrectNearTurret(ref evade_pos, evade_direction);
                    }
                    break;
                }
            }

            edata = new EvadeData
                        (evade_pos,
                        ObjectManager.Player.CharData.BaseSkinName == "Morgana" ||
                        ObjectManager.Player.CharData.BaseSkinName == "Lissandra",
                        ObjectManager.Player.CharData.BaseSkinName == "Sivir" ||
                        ObjectManager.Player.CharData.BaseSkinName == "Nocturne" ||
                        ObjectManager.Player.CharData.BaseSkinName == "Vladimir",
                        target);

            m_evade_queue.Enqueue(edata);
        }
Ejemplo n.º 2
0
        public void OnSpellHitDetected(Vector2 direction, Obj_AI_Base target)
        {
            EvadeData edata;

            Vector2 evade_direction = direction.Perpendicular();
            Vector2 evade_pos = ObjectManager.Player.ServerPosition.To2D() + evade_direction * EvadeSpell.Range;

            bool position_needed = SpecialMethod.HasFlag(EvadeMethods.Dash) || SpecialMethod.HasFlag(EvadeMethods.Blink);

            if (position_needed)
            {
                switch (evade.Item("EVADEMETHOD").GetValue<StringList>().SelectedIndex)
                {
                    case 0: //near turret
                        CorrectNearTurret(ref evade_pos, evade_direction);
                        break;

                    case 1: //less enemies
                        CorrectLessEnemies(ref evade_pos, evade_direction);
                        break;

                    case 2: //both
                        if (!CorrectLessEnemies(ref evade_pos, evade_direction))
                            CorrectNearTurret(ref evade_pos, evade_direction);
                        break;
                }
            }

            edata = new EvadeData
                (evade_pos,
                ObjectManager.Player.CharData.BaseSkinName == "Morgana" || ObjectManager.Player.CharData.BaseSkinName == "Lissandra",
                ObjectManager.Player.CharData.BaseSkinName == "Sivir" || ObjectManager.Player.CharData.BaseSkinName == "Nocturne" || ObjectManager.Player.CharData.BaseSkinName == "Vladimir",
                target);

            m_evade_queue.Enqueue(edata);
        }