示例#1
0
 internal static void CheckRKillable(Obj_AI_Base target)
 {
     KillSteal.RDamageOnEnemies[target.NetworkId] = SpellSlot.R.GetSpellDamage(target);
     if (target.TotalShieldHealth() + target.HPRegenRate * 2 <= KillSteal.RDamageOnEnemies[target.NetworkId])
     {
         var distance = Vector3.Distance(Util.MyHero.Position, target.Position);
         R.Speed = (int)InitialSpeed;
         if (distance >= ChangerSpeedDistance)
         {
             var travelTime = ChangerSpeedDistance / InitialSpeed + (distance - ChangerSpeedDistance) / FinalSpeed;
             R.Speed = (int)(distance / travelTime);
         }
         var pred     = R.GetPrediction(target);
         var firstHit =
             pred.GetCollisionObjects <AIHeroClient>()
             .OrderBy(h => Util.MyHero.Distance(h, true))
             .FirstOrDefault() ?? target;
         KillSteal.RDamageOnEnemies[target.NetworkId] = SpellSlot.R.GetSpellDamage(target,
                                                                                   firstHit.IdEquals(target) ? 1 : 2);
         if (target.TotalShieldHealth() + target.HPRegenRate * 2 <= KillSteal.RDamageOnEnemies[target.NetworkId] && Util.MyHero.Distance(target, true) <= RRangeSqr)
         {
             KillSteal.RKillableBases.Add(target);
             if (pred.HitChance >= HitChance.High &&
                 firstHit.Distance(target, true) <= (225 + target.BoundingRadius).Pow())
             {
                 if ((KillSteal.Menu.CheckBox("R") && target.WillBeHittedByR() &&
                      !MyTargetSelector.PowPowTarget.IdEquals(target) && target.CountAlliesInRange(500) == 0) || MenuManager.TapKeyPressed)
                 {
                     KillSteal.RHittableBases.Add(pred.CastPosition);
                 }
             }
         }
     }
 }
示例#2
0
        private void steal(Obj_AI_Base monster)
        {
            if (monster == null || monster.CountEnemiesInRange(600) == 0 || monster.CountAlliesInRange(500) > 0)
            {
                return;
            }
            float distance   = Player.Instance.Position.Distance(monster.Position);
            int   travelTime = 0;

            if (distance > 1500)
            {
                travelTime = 1000;
                distance  -= 1500;
            }
            else
            {
                travelTime = (int)distance / 1500 * 1000;
                distance   = 0;
            }
            travelTime += (int)(distance / 2500) * 1000;
            float health = Prediction.Health.GetPrediction(monster, travelTime);

            if (health - 300 > 0 && health < SpellManager.getRDamage(monster) * 0.8)
            {
                R.Cast(monster);
            }
        }
示例#3
0
        /// <summary>
        ///     Handles the buff.
        /// </summary>
        /// <param name="unit">The unit.</param>
        /// <param name="type">The type.</param>
        private void HandleBuff(Obj_AI_Base unit, ObjectiveType type)
        {
            if (!Config.Instance.buffMenu["Steal" + type + "Buff"].Cast <CheckBox>().CurrentValue)
            {
                return;
            }

            var alliesinRange = unit.CountAlliesInRange(1000);

            if (!Config.Instance.buffMenu["StealAllyBuffs"].Cast <CheckBox>().CurrentValue&& alliesinRange > 0)
            {
                return;
            }

            this.StealObject(unit, StealType.BuffSteal);
        }
        /// <summary>
        ///     Handles the buff.
        /// </summary>
        /// <param name="unit">The unit.</param>
        /// <param name="type">The type.</param>
        private void HandleBuff(Obj_AI_Base unit, ObjectiveType type)
        {
            if (!Config.Instance["Steal" + type + "Buff"].IsActive())
            {
                return;
            }

            var alliesinRange = unit.CountAlliesInRange(1000);

            if (!Config.Instance["StealAllyBuffs"].IsActive() && alliesinRange > 0)
            {
                return;
            }

            this.StealObject(unit, StealType.BuffSteal);
        }
        /// <summary>
        ///     Handles the objective.
        /// </summary>
        /// <param name="unit">The unit.</param>
        /// <param name="type">The type.</param>
        private void HandleObjective(Obj_AI_Base unit, ObjectiveType type)
        {
            if ((Config.Instance["SmartObjectiveSteal"].IsActive()
                 && !Config.Instance["StealObjectiveKeyBind"].IsActive() && unit.CountAlliesInRange(500) != 0)
                || !Config.Instance["StealObjectiveKeyBind"].IsActive())
            {
                return;
            }

            if (!Config.Instance["Steal" + type].IsActive())
            {
                return;
            }

            this.StealObject(unit, StealType.ObjectiveSteal);
        }
示例#6
0
文件: Snitched.cs 项目: CONANLXF/AIO
        /// <summary>
        ///     Handles the objective.
        /// </summary>
        /// <param name="unit">The unit.</param>
        /// <param name="type">The type.</param>
        private void HandleObjective(Obj_AI_Base unit, ObjectiveType type)
        {
            if ((Config.Instance.objectiveMenu["SmartObjectiveSteal"].Cast<CheckBox>().CurrentValue
                 && !Config.Instance.objectiveMenu["StealObjectiveKeyBind"].Cast<CheckBox>().CurrentValue && unit.CountAlliesInRange(500) != 0)
                || !Config.Instance.objectiveMenu["StealObjectiveKeyBind"].Cast<CheckBox>().CurrentValue)
            {
                return;
            }

            if (!Config.Instance.objectiveMenu["Steal" + type].Cast<CheckBox>().CurrentValue)
            {
                return;
            }

            this.StealObject(unit, StealType.ObjectiveSteal);
        }
示例#7
0
文件: Snitched.cs 项目: CONANLXF/AIO
        /// <summary>
        ///     Handles the buff.
        /// </summary>
        /// <param name="unit">The unit.</param>
        /// <param name="type">The type.</param>
        private void HandleBuff(Obj_AI_Base unit, ObjectiveType type)
        {
            if (!Config.Instance.buffMenu["Steal" + type + "Buff"].Cast<CheckBox>().CurrentValue)
            {
                return;
            }

            var alliesinRange = unit.CountAlliesInRange(1000);

            if (!Config.Instance.buffMenu["StealAllyBuffs"].Cast<CheckBox>().CurrentValue && alliesinRange > 0)
            {
                return;
            }

            this.StealObject(unit, StealType.BuffSteal);
        }
示例#8
0
        internal static void CheckRKillable(Obj_AI_Base target)
        {
            KillSteal.RDamageOnEnemies[target.NetworkId] = SpellSlot.R.GetSpellDamage(target);
            if (target.TotalShieldHealth() + target.HPRegenRate * 2 <= KillSteal.RDamageOnEnemies[target.NetworkId])
            {
                var distance = Vector3.Distance(Util.MyHero.Position, target.Position);
                R.Speed = (int)InitialSpeed;
                if (distance >= ChangerSpeedDistance)
                {
                    var travelTime = ChangerSpeedDistance / InitialSpeed + (distance - ChangerSpeedDistance) / FinalSpeed;
                    R.Speed = (int)(distance / travelTime);
                }
                var pred = R.GetPrediction(target);
                var hitchance = predi.GetHitChance(SpellSlot.R, 20000, SkillShotType.Linear, 600, 1700, 140,Player.Instance.ServerPosition,target);
                var firstHit =
                    pred.GetCollisionObjects<AIHeroClient>()
                        .OrderBy(h => Util.MyHero.Distance(h, true))
                        .FirstOrDefault() ?? target;
                KillSteal.RDamageOnEnemies[target.NetworkId] = SpellSlot.R.GetSpellDamage(target,
                    firstHit.IdEquals(target) ? 1 : 2);
                if (target.TotalShieldHealth() + target.HPRegenRate * 2 <= KillSteal.RDamageOnEnemies[target.NetworkId] && Util.MyHero.Distance(target, true) <= RRangeSqr)
                {
                    KillSteal.RKillableBases.Add(target);

                    if (pred.HitChance >= HitChance.Low && hitchance >= MenuManager.PredR() &&
                        firstHit.Distance(target, true) <= (225 + target.BoundingRadius).Pow())
                    {
                        if ((KillSteal.Menu.CheckBox("R") /*&& target.WillBeHittedByR()*/ &&
                             !MyTargetSelector.PowPowTarget.IdEquals(target) && target.CountAlliesInRange(500) == 0) || MenuManager.TapKeyPressed)
                        {
                            KillSteal.RHittableBases.Add(pred.CastPosition);
                        }
                    }
                }
            }
        }
示例#9
0
 private void steal(Obj_AI_Base monster)
 {
     if (monster == null || monster.CountEnemiesInRange(600) == 0 || monster.CountAlliesInRange(500) > 0)
         return;
     float distance = Player.Instance.Position.Distance(monster.Position);
     int travelTime = 0;
     if (distance > 1500)
     {
         travelTime = 1000;
         distance -= 1500;
     }
     else
     {
         travelTime = (int)distance / 1500 * 1000;
         distance = 0;
     }
     travelTime += (int)(distance / 2500) * 1000;
     float health = Prediction.Health.GetPrediction(monster, travelTime);
     if (health - 300 > 0 && health < SpellManager.getRDamage(monster) * 0.8)
     {
         R.Cast(monster);
     }
 }
示例#10
0
        /// <summary>
        ///     Handles the objective.
        /// </summary>
        /// <param name="unit">The unit.</param>
        /// <param name="type">The type.</param>
        private void HandleObjective(Obj_AI_Base unit, ObjectiveType type)
        {
            if ((Config.Instance.objectiveMenu["SmartObjectiveSteal"].Cast <CheckBox>().CurrentValue &&
                 !Config.Instance.objectiveMenu["StealObjectiveKeyBind"].Cast <CheckBox>().CurrentValue&& unit.CountAlliesInRange(500) != 0) ||
                !Config.Instance.objectiveMenu["StealObjectiveKeyBind"].Cast <CheckBox>().CurrentValue)
            {
                return;
            }

            if (!Config.Instance.objectiveMenu["Steal" + type].Cast <CheckBox>().CurrentValue)
            {
                return;
            }

            this.StealObject(unit, StealType.ObjectiveSteal);
        }
        /// <summary>
        ///     Casting Logic.
        /// </summary>
        public static void Casting(Spell.SpellBase spellBase, Obj_AI_Base target, bool enabled = true)
        {
            if (spellBase == null || target == null || !enabled)
            {
                return;
            }

            if (spellBase.DontWaste() && ModesManager.LaneClear)
            {
                return;
            }

            if (spellBase.IsDangerDash() && target.CountAlliesInRange(1000) >= target.CountEnemiesInRange(1000) &&
                (target.PredictPosition().UnderEnemyTurret() && Misc.SafeToDive || !target.PredictPosition().UnderEnemyTurret()))
            {
                spellBase.Cast(target);
                return;
            }

            if (spellBase.IsDangerDash())
            {
                return;
            }

            if (spellBase.IsDash())
            {
                spellBase.Cast(target.PredictPosition().Extend(Player.Instance, 300).To3D());
                return;
            }

            if (spellBase.IsToggle())
            {
                if (spellBase is Spell.Active)
                {
                    if (spellBase.Handle.ToggleState != 2 && target.IsValidTarget(spellBase.Range))
                    {
                        spellBase.Cast();
                        return;
                    }
                    if (spellBase.Handle.ToggleState == 2 && !target.IsValidTarget(spellBase.Range))
                    {
                        spellBase.Cast();
                        return;
                    }
                }
                else
                {
                    if (spellBase.Handle.ToggleState != 2 && target.IsValidTarget(spellBase.Range))
                    {
                        spellBase.Cast(target);
                        return;
                    }
                    if (spellBase.Handle.ToggleState == 2 && !target.IsValidTarget(spellBase.Range))
                    {
                        spellBase.Cast(Game.CursorPos);
                        return;
                    }
                }
            }

            if (spellBase is Spell.Active)
            {
                spellBase.Cast();
                return;
            }

            if ((spellBase is Spell.Skillshot || spellBase is Spell.Targeted || spellBase is Spell.Ranged) && !(spellBase is Spell.Chargeable))
            {
                spellBase.Cast(target);
                return;
            }

            if (spellBase is Spell.Chargeable)
            {
                var chargeable = spellBase as Spell.Chargeable;

                if (!chargeable.IsCharging)
                {
                    chargeable.StartCharging();
                    return;
                }
                if (chargeable.IsInRange(target))
                {
                    chargeable.Cast(target);
                }
            }
        }