예제 #1
0
파일: Dash.cs 프로젝트: axantemir/EloBuddy
        public static DashPrediction Prediction(AIHeroClient target)
        {
            var logic = MiscMenu.GetComboBoxValue("dashPrediction");

            // MOUSE LOGIC
            if (logic.ToString().Contains("Mouse"))
            {
                return new DashPrediction {
                           Position = PostPosition(MousePosition), Score = 0
                }
            }
            ;

            // S-CLASS LOGIC
            // Calculate positions
            var playerPosition = Self.ServerPosition.To2D();
            var targetPosition = EloBuddy.SDK.Prediction.Position.PredictUnitPosition(target, E.CastDelay);

            // Default mode is to mouse
            var position = PostPosition(MousePosition);
            var score    = GetPositionScore(target, position);

            // Check if to target is better
            var toTargetPosition = PostPosition(targetPosition.To3D());
            var toTargetScore    = GetPositionScore(target, toTargetPosition);

            if (target.WithinRange(toTargetPosition, EffectiveAttackRange) &&
                (toTargetScore > score || !target.WithinRange(position, EffectiveAttackRange)))
            {
                position = toTargetPosition;

                score = toTargetScore;
            }

            // Check if prediction angles are better
            foreach (var angle in PredictionDashAngles)
            {
                var predictedPosition = PostPosition(Deviation(playerPosition, targetPosition, angle).To3D());
                var predictedScore    = GetPositionScore(target, predictedPosition);

                if (predictedScore < score || !target.WithinRange(predictedPosition, EffectiveAttackRange))
                {
                    continue;
                }

                score    = predictedScore;
                position = predictedPosition;
            }

            return(new DashPrediction {
                Position = position, Score = score
            });
        }
예제 #2
0
        /// <summary>
        /// It will level up the spell using the values of the comboboxes on the menu as a priority
        /// </summary>
        private static void LevelUPSpells()
        {
            if (Player.Instance.Spellbook.CanSpellBeUpgraded(SpellSlot.R))
            {
                Player.Instance.Spellbook.LevelSpell(SpellSlot.R);
            }

            var firstFocusSlot  = GetSlotFromComboBox(MiscMenu.GetComboBoxValue("firstFocus"));
            var secondFocusSlot = GetSlotFromComboBox(MiscMenu.GetComboBoxValue("secondFocus"));
            var thirdFocusSlot  = GetSlotFromComboBox(MiscMenu.GetComboBoxValue("thirdFocus"));

            var secondSpell = Player.GetSpell(secondFocusSlot);
            var thirdSpell  = Player.GetSpell(thirdFocusSlot);

            if (Player.Instance.Spellbook.CanSpellBeUpgraded(firstFocusSlot))
            {
                if (!secondSpell.IsLearned)
                {
                    Player.Instance.Spellbook.LevelSpell(secondFocusSlot);
                }
                if (!thirdSpell.IsLearned)
                {
                    Player.Instance.Spellbook.LevelSpell(thirdFocusSlot);
                }
                Player.Instance.Spellbook.LevelSpell(firstFocusSlot);
            }

            if (Player.Instance.Spellbook.CanSpellBeUpgraded(secondFocusSlot))
            {
                if (!thirdSpell.IsLearned)
                {
                    Player.Instance.Spellbook.LevelSpell(thirdFocusSlot);
                }
                Player.Instance.Spellbook.LevelSpell(firstFocusSlot);
                Player.Instance.Spellbook.LevelSpell(secondFocusSlot);
            }

            if (Player.Instance.Spellbook.CanSpellBeUpgraded(thirdFocusSlot))
            {
                Player.Instance.Spellbook.LevelSpell(thirdFocusSlot);
            }
        }
        /// <summary>
        /// It will level up the spell using the values of the comboboxes on the menu as a priority
        /// </summary>
        private static void LevelUPSpells()
        {
            if (Player.Instance.Spellbook.CanSpellBeUpgraded(SpellSlot.R))
            {
                Player.Instance.Spellbook.LevelSpell(SpellSlot.R);
            }

            if (Player.Instance.Spellbook.CanSpellBeUpgraded(GetSlotFromComboBox(MiscMenu.GetComboBoxValue("firstFocus"))))
            {
                Player.Instance.Spellbook.LevelSpell(GetSlotFromComboBox(MiscMenu.GetComboBoxValue("firstFocus")));
            }

            if (Player.Instance.Spellbook.CanSpellBeUpgraded(GetSlotFromComboBox(MiscMenu.GetComboBoxValue("secondFocus"))))
            {
                Player.Instance.Spellbook.LevelSpell(GetSlotFromComboBox(MiscMenu.GetComboBoxValue("secondFocus")));
            }

            if (Player.Instance.Spellbook.CanSpellBeUpgraded(GetSlotFromComboBox(MiscMenu.GetComboBoxValue("thirdFocus"))))
            {
                Player.Instance.Spellbook.LevelSpell(GetSlotFromComboBox(MiscMenu.GetComboBoxValue("thirdFocus")));
            }
        }