コード例 #1
0
        public static void UseESpell(Obj_AI_Base target)
        {
            if (target == null)
            {
                return;
            }

            foreach (
                var orb in
                OrbManager.GetOrbs(true)
                .Where(orb => orb.To2D().IsValid() && ObjectManager.Player.Distance(orb, true) < Math.Pow(Spells.E.Range, 2)))
            {
                var sp = orb.To2D() + Vector2.Normalize(ObjectManager.Player.ServerPosition.To2D() - orb.To2D()) * 100f;
                var ep = orb.To2D() + Vector2.Normalize(orb.To2D() - ObjectManager.Player.ServerPosition.To2D()) * 592;

                Spells.QE.Delay = Spells.E.Delay + ObjectManager.Player.Distance(orb) / Spells.E.Speed;
                Spells.QE.UpdateSourcePosition(orb);

                var pPo = Spells.QE.GetPrediction(target).UnitPosition.To2D();

                if (pPo.Distance(sp, ep, true, true) <= Math.Pow(Spells.QE.Width + target.BoundingRadius, 2) &&
                    ObjectManager.Player.Distance(sp) <=
                    Spells.E.Range)
                {
                    Spells.E.Cast(orb);
                }
            }
        }
コード例 #2
0
 public static Vector3 GetGrabableObjectPos(bool onlyOrbs)
 {
     if (onlyOrbs)
     {
         return(OrbManager.GetOrbToGrab((int)Spells.W.Range));
     }
     foreach (var minion in ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget(Spells.W.Range)))
     {
         return(minion.ServerPosition);
     }
     return(OrbManager.GetOrbToGrab((int)Spells.W.Range));
 }