コード例 #1
0
ファイル: Vayne.cs プロジェクト: firas500/LSharpDZiJava
        /// <summary>
        /// <c>OnDraw</c> subscribed event function.
        /// </summary>
        /// <param name="args">
        /// The event data
        /// </param>
        public override void OnDraw(EventArgs args)
        {
            var drakeWallQPos = new Vector2(11514, 4462);

            if (this.GetItemValue<bool>("com.iseries.vayne.drawE"))
            {
                Render.Circle.DrawCircle(ObjectManager.Player.Position, this.spells[SpellSlot.E].Range, Color.Red);
            }

            if (this.GetItemValue<bool>("com.iseries.vayne.drawSpots"))
            {
                if (ObjectManager.Player.Distance(drakeWallQPos) <= 1500f && this.IsSummonersRift())
                {
                    Render.Circle.DrawCircle(drakeWallQPos.To3D2(), 65f, Color.AliceBlue);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Delegate used for drawings.
        /// </summary>
        /// <param name="args">The event's args.</param>
        private static void Drawing_OnDraw(EventArgs args)
        {
            var drawE = Menu.Item("VayneDrawE").GetValue<Circle>();
            var drakeWallQPos = new Vector2(11514, 4462);

            if (drawE.Active)
            {
                Render.Circle.DrawCircle(ObjectManager.Player.Position, _spells[SpellSlot.E].Range, drawE.Color);
            }

            if (MenuHelper.isMenuEnabled("dz191.vhr.drawing.drawstun"))
            {
                Obj_AI_Hero myTarget;
            }

            if (MenuHelper.isMenuEnabled("dz191.vhr.drawing.drawspots"))
            {
                if (ObjectManager.Player.Distance(drakeWallQPos) <= 1500f && Helpers.IsSummonersRift())
                {
                    Render.Circle.DrawCircle(drakeWallQPos.To3D2(), 65f, Color.AliceBlue);
                }
            }
        }
コード例 #3
0
ファイル: Prediction.cs プロジェクト: ShineSharp/LeagueSharp
        /// <summary>
        /// Gets Prediction result
        /// </summary>
        /// <param name="target">Target for spell</param>
        /// <param name="width">Spell width</param>
        /// <param name="delay">Spell delay</param>
        /// <param name="missileSpeed">Spell missile speed</param>
        /// <param name="range">Spell range</param>
        /// <param name="collisionable">Spell collisionable</param>
        /// <param name="type">Spell skillshot type</param>
        /// <param name="path">Waypoints of target</param>
        /// <param name="avgt">Average reaction time (in ms)</param>
        /// <param name="movt">Passed time from last movement change (in ms)</param>
        /// <param name="avgp">Average Path Lenght</param>
        /// <param name="from">Spell casted position</param>
        /// <param name="rangeCheckFrom"></param>
        /// <returns>Prediction result as <see cref="Prediction.Result"/></returns>
        internal static Result GetPrediction(Obj_AI_Base target, float width, float delay, float missileSpeed, float range, bool collisionable, SkillshotType type, List<Vector2> path, float avgt, float movt, float avgp, float anglediff, Vector2 from, Vector2 rangeCheckFrom)
        {
            Prediction.AssertInitializationMode();

            Result result = new Result();
            result.Input = new Input(target, delay, missileSpeed, width, range, collisionable, type, from.To3D2(), rangeCheckFrom.To3D2());
            result.Unit = target;

            try
            {
                if (type == SkillshotType.SkillshotCircle)
                    range += width;

                //to do: hook logic ? by storing average movement direction etc
                if (path.Count <= 1 && movt > 100 && (Environment.TickCount - PathTracker.EnemyInfo[target.NetworkId].LastAATick > 300 || !ConfigMenu.CheckAAWindUp)) //if target is not moving, easy to hit (and not aaing)
                {
                    result.HitChance = HitChance.VeryHigh;
                    result.CastPosition = target.ServerPosition.To2D();
                    result.UnitPosition = result.CastPosition;
                    result.Lock();

                    return result;
                }

                if (target is Obj_AI_Hero)
                {
                    if (((Obj_AI_Hero)target).IsChannelingImportantSpell())
                    {
                        result.HitChance = HitChance.VeryHigh;
                        result.CastPosition = target.ServerPosition.To2D();
                        result.UnitPosition = result.CastPosition;
                        result.Lock();

                        return result;
                    }

                    if (Environment.TickCount - PathTracker.EnemyInfo[target.NetworkId].LastAATick < 300 && ConfigMenu.CheckAAWindUp)
                    {
                        if (target.AttackCastDelay * 1000 + PathTracker.EnemyInfo[target.NetworkId].AvgOrbwalkTime + avgt - width / 2f / target.MoveSpeed >= GetArrivalTime(target.ServerPosition.To2D().Distance(from), delay, missileSpeed))
                        {
                            result.HitChance = HitChance.High;
                            result.CastPosition = target.ServerPosition.To2D();
                            result.UnitPosition = result.CastPosition;
                            result.Lock();

                            return result;
                        }
                    }

                    //to do: find a fuking logic
                    if (avgp < 400 && movt < 100 && path.PathLength() <= avgp)
                    {
                        result.HitChance = HitChance.High;
                        result.CastPosition = path.Last();
                        result.UnitPosition = result.CastPosition;
                        result.Lock();

                        return result;
                    }
                }

                if (target.IsDashing()) //if unit is dashing
                    return GetDashingPrediction(target, width, delay, missileSpeed, range, collisionable, type, from, rangeCheckFrom);

                if (Utility.IsImmobileTarget(target)) //if unit is immobile
                    return GetImmobilePrediction(target, width, delay, missileSpeed, range, collisionable, type, from, rangeCheckFrom);

                result = WaypointAnlysis(target, width, delay, missileSpeed, range, collisionable, type, path, avgt, movt, avgp, anglediff, from);

                float d = result.CastPosition.Distance(target.ServerPosition.To2D());
                if (d >= (avgt - movt) * target.MoveSpeed && d >= avgp)
                    result.HitChance = HitChance.Medium;

                result.Lock();

                return result;
            }
            finally
            {
                //check if movement changed while prediction calculations
                if (!target.GetWaypoints().SequenceEqual(path))
                    result.HitChance = HitChance.Medium;
            }
        }
コード例 #4
0
ファイル: Prediction.cs プロジェクト: ShineSharp/LeagueSharp
        /// <summary>
        /// Gets Prediction result while unit is immobile
        /// </summary>
        /// <param name="target">Target for spell</param>
        /// <param name="width">Spell width</param>
        /// <param name="delay">Spell delay</param>
        /// <param name="missileSpeed">Spell missile speed</param>
        /// <param name="range">Spell range</param>
        /// <param name="collisionable">Spell collisionable</param>
        /// <param name="type">Spell skillshot type</param>
        /// <param name="from">Spell casted position</param>
        /// <returns></returns>
        internal static Result GetImmobilePrediction(Obj_AI_Base target, float width, float delay, float missileSpeed, float range, bool collisionable, SkillshotType type, Vector2 from, Vector2 rangeCheckFrom)
        {
            Result result = new Result();
            result.Input = new Input(target, delay, missileSpeed, width, range, collisionable, type, from.To3D2(), rangeCheckFrom.To3D2());
            result.Unit = target;
            result.CastPosition = target.ServerPosition.To2D();
            result.UnitPosition = result.CastPosition;

            //calculate spell arrival time
            float t = delay + Game.Ping / 2000f;
            if (missileSpeed != 0)
                t += from.Distance(target.ServerPosition) / missileSpeed;

            if (type == SkillshotType.SkillshotCircle)
                t += width / target.MoveSpeed / 2f;

            if (t >= Utility.LeftImmobileTime(target))
            {
                result.HitChance = HitChance.Immobile;
                result.Lock();

                return result;
            }

            if (target is Obj_AI_Hero)
                result.HitChance = GetHitChance(t - Utility.LeftImmobileTime(target), ((Obj_AI_Hero)target).AvgMovChangeTime(), 0, 0, 0);
            else
                result.HitChance = HitChance.High;

            result.Lock();

            return result;
        }
コード例 #5
0
ファイル: Prediction.cs プロジェクト: ShineSharp/LeagueSharp
        /// <summary>
        /// Gets Prediction result while unit is dashing
        /// </summary>
        /// <param name="target">Target for spell</param>
        /// <param name="width">Spell width</param>
        /// <param name="delay">Spell delay</param>
        /// <param name="missileSpeed">Spell missile speed</param>
        /// <param name="range">Spell range</param>
        /// <param name="collisionable">Spell collisionable</param>
        /// <param name="type">Spell skillshot type</param>
        /// <param name="from">Spell casted position</param>
        /// <returns></returns>
        internal static Result GetDashingPrediction(Obj_AI_Base target, float width, float delay, float missileSpeed, float range, bool collisionable, SkillshotType type, Vector2 from, Vector2 rangeCheckFrom)
        {
            Result result = new Result();
            result.Input = new Input(target, delay, missileSpeed, width, range, collisionable, type, from.To3D2(), rangeCheckFrom.To3D2());
            result.Unit = target;

            if (target.IsDashing())
            {
                var dashInfo = target.GetDashInfo();
                if (dashInfo.IsBlink)
                {
                    result.HitChance = HitChance.Impossible;
                    result.CastPosition = dashInfo.EndPos;
                    return result;
                }

                result.CastPosition = GetFastUnitPosition(target, dashInfo.Path, delay, missileSpeed, from, dashInfo.Speed);
                result.HitChance = HitChance.Dashing;

                result.Lock(false);
            }
            else
            {
                result = GetPrediction(target, width, delay, missileSpeed, range, collisionable, type, target.GetWaypoints(), 0, 0, 0, 0, from, rangeCheckFrom);
                result.Lock(false);
            }
            return result;
        }
コード例 #6
0
ファイル: Condemn.cs プロジェクト: JelloBeans/SAC
        public static bool IsValidTarget(Obj_AI_Hero target)
        {
            if (!IsWhitelisted(target))
                return false;

            var targetPosition = Geometry.PositionAfter(target.GetWaypoints(), 300, (int)target.MoveSpeed);

            if (target.Distance(ObjectManager.Player.ServerPosition) < 650f && IsCondemnable(ObjectManager.Player.ServerPosition.To2D(), targetPosition, target.BoundingRadius))
            {
                if (target.Path.Length == 0)
                {
                    var outRadius = (0.3f * target.MoveSpeed) / (float)Math.Cos(2 * Math.PI / Accuracy);
                    int count = 0;
                    for (int i = 1; i <= Accuracy; i++)
                    {
                        if (count + (Accuracy - i) < Accuracy / 3)
                            return false;

                        var angle = i * 2 * Math.PI / Accuracy;
                        float x = target.Position.X + outRadius * (float)Math.Cos(angle);
                        float y = target.Position.Y + outRadius * (float)Math.Sin(angle);
                        if (IsCondemnable(ObjectManager.Player.ServerPosition.To2D(), new Vector2(x, y), target.BoundingRadius))
                            count++;
                    }
                    return count >= Accuracy / 3;
                }
                else
                    return true;
            }
            else
            {
                if (TumbleCondemn && s_Champion.Spells[Champion.Q].IsReady())
                {
                    var outRadius = 300 / (float)Math.Cos(2 * Math.PI / TumbleCondemnCount);

                    for (int i = 1; i <= TumbleCondemnCount; i++)
                    {
                        var angle = i * 2 * Math.PI / TumbleCondemnCount;
                        float x = ObjectManager.Player.Position.X + outRadius * (float)Math.Cos(angle);
                        float y = ObjectManager.Player.Position.Y + outRadius * (float)Math.Sin(angle);
                        targetPosition = Geometry.PositionAfter(target.GetWaypoints(), 300, (int)target.MoveSpeed);
                        var vec = new Vector2(x, y);
                        if (targetPosition.Distance(vec) < 550f && IsCondemnable(vec, targetPosition, target.BoundingRadius, 300f))
                        {
                            if (!TumbleCondemnSafe || Tumble.IsSafe(target, vec.To3D2(), false).IsValid())
                            {
                                s_Champion.Spells[Champion.Q].Cast(vec);
                                break;
                            }
                        }
                    }

                    return false;
                }
            }

            return false;
        }
コード例 #7
0
ファイル: VayneHunterReborn.cs プロジェクト: GodLS/LSharpWIP
 void Drawing_OnDraw(EventArgs args)
 {
     var drawE = Menu.Item("VayneDrawE").GetValue<Circle>();
     var midWallQPos = new Vector2(6707.485f, 8802.744f);
     var drakeWallQPos = new Vector2(11514, 4462);
     if (drawE.Active)
     {
         Render.Circle.DrawCircle(ObjectManager.Player.Position,_spells[SpellSlot.E].Range,drawE.Color);
     }
     if (MenuHelper.isMenuEnabled("dz191.vhr.drawing.drawstun"))
     {
         Obj_AI_Hero myTarget;
         if (CondemnCheck(ObjectManager.Player.ServerPosition, out myTarget))
         {
             if (myTarget != null)
             {
                 Drawing.DrawText(myTarget.Position.X, myTarget.Position.Y, Color.Aqua, "Stunnable!");
             }
         }
     }
     if (MenuHelper.isMenuEnabled("dz191.vhr.drawing.drawspots"))
     {
         if (ObjectManager.Player.Distance(midWallQPos) <= 1500f)
         {
             Render.Circle.DrawCircle(midWallQPos.To3D2(), 65f, Color.AliceBlue);
         }
         if (ObjectManager.Player.Distance(drakeWallQPos) <= 1500f)
         {
             Render.Circle.DrawCircle(drakeWallQPos.To3D2(), 65f, Color.AliceBlue);
         }
     }
 }