示例#1
0
                internal static void Farm(Spell.Skillshot spell, int minHit = 1)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
                    {
                        return;
                    }
                    if (!spell.IsReady() || IsAutoAttacking)
                    {
                        return;
                    }

                    var minions =
                        MinionManager.GetMinions(Player.ServerPosition, spell.Range + spell.Radius)
                        .Select(
                            minion =>
                            Prediction.Position.PredictUnitPosition(minion,
                                                                    (int)(spell.CastDelay + (Player.Distance(minion) / spell.Speed))))
                        .ToList();

                    if (MinionManager.GetBestCircularFarmLocation(minions, spell.Width, spell.Range).MinionsHit <
                        minHit)
                    {
                        return;
                    }
                    spell.Cast(
                        MinionManager.GetBestCircularFarmLocation(minions, spell.Width, spell.Range).Position.To3D());
                }
示例#2
0
                internal static void Optimized(Spell.Skillshot spell, DamageType damageType,
                                               int range = 0, int minHit = 1, HitChance?hitChance = HitChance.Medium,
                                               AIHeroClient targetHero = null)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
                    {
                        return;
                    }

                    if (!spell.IsReady() || IsAutoAttacking)
                    {
                        return;
                    }

                    AIHeroClient target;

                    if (targetHero == null)
                    {
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    }
                    else
                    {
                        target = targetHero;
                    }

                    if (target == null)
                    {
                        return;
                    }

                    if (!target.IsValidTarget(spell.Range + spell.Radius) ||
                        spell.GetPrediction(target).HitChance < hitChance)
                    {
                        return;
                    }

                    var champs = EntityManager.Heroes.Enemies.Where(e => e.Distance(target) < spell.Radius).Select(champ => Prediction.Position.PredictUnitPosition(champ, ((int)Player.Distance(champ) / spell.Speed) + spell.CastDelay)).ToList();

                    var posAndHits = GetOptimizedCircleLocation(champs, spell.Width, spell.Range);

                    if (posAndHits.ChampsHit >= minHit)
                    {
                        spell.Cast(posAndHits.Position.To3DWorld());
                    }
                }
示例#3
0
 internal void UpdateValues()
 {
     if (!TickManager.NoLag(0) || PlayerData.Spells.Count == 0)
     {
         return;
     }
     if (!_initialized)
     {
         _initialized = true;
     }
     _q = PlayerData.Spells.Find(s => s.Slot == SpellSlot.Q);
     _w = PlayerData.Spells.Find(s => s.Slot == SpellSlot.W);
     _e = PlayerData.Spells.Find(s => s.Slot == SpellSlot.E);
     _r = PlayerData.Spells.Find(s => s.Slot == SpellSlot.R);
 }
示例#4
0
        protected override void Volatile_OnHeartBeat(EventArgs args)
        {
            Cleansers();
            Smite();

            if (!TickManager.NoLag(0) || Player.IsRecalling() || Player.IsDead)
            {
                return;
            }

            PotionManagement();
            Ignite();
            Exhaust();
            Offensive();
            Defensive();
            ZhonyaCast();
        }
示例#5
0
                internal static void SingleTargetHero(Spell.Skillshot spell, DamageType damageType,
                                                      int range = 0, HitChance?hitChance = HitChance.Medium, AIHeroClient targetHero = null)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
                    {
                        return;
                    }

                    if (!spell.IsReady() || IsAutoAttacking)
                    {
                        return;
                    }

                    AIHeroClient target;

                    if (targetHero == null)
                    {
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    }
                    else
                    {
                        target = targetHero;
                    }

                    if (target == null)
                    {
                        return;
                    }

                    if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).HitChance < hitChance)
                    {
                        return;
                    }
                    spell.Cast(spell.GetPrediction(target).CastPosition);
                }
示例#6
0
                internal static void NewPredTest(Spell.Skillshot spell, DamageType damageType,
                                                 int range = 0, Utils.HitChance hitChance = Utils.HitChance.Medium, AIHeroClient targetHero = null)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
                    {
                        return;
                    }

                    if (!spell.IsReady() || IsAutoAttacking)
                    {
                        return;
                    }

                    AIHeroClient target;

                    if (targetHero == null)
                    {
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    }
                    else
                    {
                        target = targetHero;
                    }

                    if (target == null)
                    {
                        return;
                    }

                    if (!target.IsValidTarget(spell.Range))
                    {
                        return;
                    }

                    var  coreType2 = SkillshotType.SkillshotLine;
                    bool aoe2      = false;

                    if ((int)spell.Type == (int)SkillshotType.SkillshotCircle)
                    {
                        coreType2 = SkillshotType.SkillshotCircle;
                        aoe2      = true;
                    }
                    if (spell.Width > 80 && spell.AllowedCollisionCount < 100)
                    {
                        aoe2 = true;
                    }
                    var predInput2 = new PredictionInput
                    {
                        Aoe       = aoe2,
                        Collision = spell.AllowedCollisionCount < 100,
                        Speed     = spell.Speed,
                        Delay     = spell.CastDelay,
                        Range     = spell.Range,
                        From      = Player.ServerPosition,
                        Radius    = spell.Radius,
                        Unit      = target,
                        Type      = coreType2
                    };
                    var poutput2 = Utils.VPrediction.GetPrediction(predInput2);

                    //var poutput2 = spell.GetPrediction(target);
                    Chat.Print(spell.Slot + " " + predInput2.Collision + poutput2.Hitchance);
                    if (spell.Speed < float.MaxValue && CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
                    {
                        return;
                    }

                    if (hitChance == Utils.HitChance.VeryHigh)
                    {
                        if (poutput2.Hitchance >= Utils.HitChance.VeryHigh)
                        {
                            spell.Cast(poutput2.CastPosition);
                        }
                        else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 &&
                                 poutput2.Hitchance >= Utils.HitChance.High)
                        {
                            spell.Cast(poutput2.CastPosition);
                        }
                    }
                    else if (hitChance == Utils.HitChance.High)
                    {
                        if (poutput2.Hitchance >= Utils.HitChance.High)
                        {
                            spell.Cast(poutput2.CastPosition);
                        }
                    }
                    else if (hitChance == Utils.HitChance.Medium)
                    {
                        if (poutput2.Hitchance >= Utils.HitChance.Medium)
                        {
                            spell.Cast(poutput2.CastPosition);
                        }
                    }
                }
示例#7
0
                internal static void SingleTargetHero(Spell.Skillshot spell, DamageType damageType,
                                                      int range = 0, HitChance hitChance = HitChance.Medium, AIHeroClient targetHero = null)
                {
                    if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
                        (spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
                        (spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
                        (spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
                    {
                        return;
                    }

                    if (!spell.IsReady() || IsAutoAttacking)
                    {
                        return;
                    }

                    AIHeroClient target;

                    if (targetHero == null)
                    {
                        target = range != 0
                            ? TargetManager.Target(range, damageType)
                            : TargetManager.Target(spell, damageType);
                    }
                    else
                    {
                        target = targetHero;
                    }

                    if (target == null)
                    {
                        return;
                    }

                    if (!VolatileMenu["vpred"].Cast <CheckBox>().CurrentValue)
                    {
                        if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).HitChance < hitChance)
                        {
                            return;
                        }

                        spell.Cast(spell.GetPrediction(target).CastPosition);
                    }

                    /*else
                     * {
                     *  var CoreType2 = SkillshotType.SkillshotLine;
                     *  bool aoe2 = false;
                     *  if ((int) spell.Type == (int) SkillshotType.SkillshotCircle)
                     *  {
                     *      CoreType2 = SkillshotType.SkillshotCircle;
                     *      aoe2 = true;
                     *  }
                     *  if (spell.Width > 80 && spell.AllowedCollisionCount < 100)
                     *      aoe2 = true;
                     *  var predInput2 = new PredictionInput
                     *  {
                     *      Aoe = aoe2,
                     *      Collision = spell.AllowedCollisionCount < 100,
                     *      Speed = spell.Speed,
                     *      Delay = spell.CastDelay,
                     *      Range = spell.Range,
                     *      From = Player.ServerPosition,
                     *      Radius = spell.Radius,
                     *      Unit = target,
                     *      Type = CoreType2
                     *  };
                     *  var poutput2 = Test.TopSecret.Prediction.GetPrediction(predInput2);
                     *  //var poutput2 = spell.GetPrediction(target);
                     *  Chat.Print(spell.Slot+" "+predInput2.Collision+poutput2.Hitchance);
                     *  if (spell.Speed != float.MaxValue && CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
                     *      return;
                     *
                     *  if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 0)
                     *  {
                     *      if (poutput2.Hitchance >= Test.TopSecret.HitChance.VeryHigh)
                     *          spell.Cast(poutput2.CastPosition);
                     *      else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 &&
                     *               poutput2.Hitchance >= Test.TopSecret.HitChance.High)
                     *      {
                     *          spell.Cast(poutput2.CastPosition);
                     *      }
                     *
                     *  }
                     *  else if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 1)
                     *  {
                     *      if (poutput2.Hitchance >= Test.TopSecret.HitChance.High)
                     *          spell.Cast(poutput2.CastPosition);
                     *
                     *  }
                     *  else if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 2)
                     *  {
                     *      if (poutput2.Hitchance >= Test.TopSecret.HitChance.Medium)
                     *          spell.Cast(poutput2.CastPosition);
                     *  }
                     * }*/
                }