Exemple #1
0
 public static bool isDangerousSpell(string spellName,
                                     Obj_AI_Hero target,
                                     Obj_AI_Hero sender,
                                     Vector3 end,
                                     float spellRange,
                                     bool highDmg = true)
 {
     if (spellName == "CurseofTheSadMummy")
     {
         if (player.Distance(sender.Position) <= 600f)
         {
             return(true);
         }
     }
     if (CombatHelper.IsFacing(target, player.Position) &&
         (spellName == "EnchantedCrystalArrow" || spellName == "rivenizunablade" ||
          spellName == "EzrealTrueshotBarrage" || spellName == "JinxR" || spellName == "sejuaniglacialprison"))
     {
         if (player.Distance(sender.Position) <= spellRange - 60)
         {
             return(true);
         }
     }
     if (spellName == "InfernalGuardian" || spellName == "UFSlash" ||
         (spellName == "RivenW" && player.HealthPercent < 25))
     {
         if (player.Distance(end) <= 270f)
         {
             return(true);
         }
     }
     if (spellName == "BlindMonkRKick" || spellName == "SyndraR" || spellName == "VeigarPrimordialBurst" ||
         spellName == "AlZaharNetherGrasp" || spellName == "LissandraR")
     {
         if (target.IsMe)
         {
             return(true);
         }
     }
     if (spellName == "TristanaR" || spellName == "ViR")
     {
         if (target.IsMe || player.Distance(target.Position) <= 100f)
         {
             return(true);
         }
     }
     if (spellName == "GalioIdolOfDurand")
     {
         if (player.Distance(sender.Position) <= 600f)
         {
             return(true);
         }
     }
     if (target != null && target.IsMe)
     {
         if (CombatHelper.isTargetedCC(spellName, highDmg) && spellName != "NasusW" && spellName != "ZedUlt")
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #2
0
 /// <summary>
 ///     Orbwalk a target while moving to Position.
 /// </summary>
 public static void Orbwalk(AttackableUnit target,
                            Vector3 position,
                            float extraWindup         = 90,
                            float holdAreaRadius      = 0,
                            bool useFixedDistance     = true,
                            bool randomizeMinDistance = true,
                            bool autoWindup           = false,
                            bool meleePrediction      = true,
                            bool movement             = true)
 {
     try
     {
         if (autoWindup)
         {
             extraWindup = 25 + Game.Ping * (1.4f + Player.AttackCastDelay * 2);
         }
         if (target.IsValidTarget() && CanAttack())
         {
             DisableNextAttack = false;
             FireBeforeAttack(target);
             if (!DisableNextAttack)
             {
                 if (!NoCancelChamps.Contains(Player.ChampionName))
                 {
                     LastAATick = Utils.GameTimeTickCount + Game.Ping + 100 -
                                  (int)(ObjectManager.Player.AttackCastDelay * 1000f);
                     _missileLaunched = false;
                 }
                 Player.IssueOrder(GameObjectOrder.AttackUnit, target);
                 _lastTarget = target;
                 return;
             }
         }
         if (!movement)
         {
             return;
         }
         if (CanMove(extraWindup))
         {
             if (player.IsMelee() && meleePrediction && target != null &&
                 target.Position.Distance(player.Position) < GetAutoAttackRange(player, target) &&
                 target is Obj_AI_Hero && Game.CursorPos.Distance(target.Position) < 450)
             {
                 Obj_AI_Hero tar        = (Obj_AI_Hero)target;
                 var         prediction = AutoAttack.GetPrediction((Obj_AI_Base)target);
                 var         pos        = prediction.UnitPosition;
                 if (player.Distance(target) > target.BoundingRadius &&
                     !CombatHelper.IsFacing((Obj_AI_Base)target, player.Position, 120f) && tar.IsMoving)
                 {
                     AutoAttack.Delay = player.BasicAttack.SpellCastTime;
                     AutoAttack.Speed = player.BasicAttack.MissileSpeed;
                     MoveTo(pos, holdAreaRadius, false, useFixedDistance, randomizeMinDistance);
                 }
             }
             else
             {
                 MoveTo(position, holdAreaRadius, false, useFixedDistance, randomizeMinDistance);
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
 }