Beispiel #1
0
        public static bool CheckColision(SPrediction.Prediction.Result prediction) //Returns if a colision is meet
        {
            var commonOutput = new PredictionOutput {
                Hitchance = prediction.HitChance, CollisionObjects = prediction.CollisionResult.Units, CastPosition = (Vector3)prediction.CastPosition, UnitPosition = (Vector3)prediction.UnitPosition
            };

            StaticObjects.ProjectLogger.WriteLog("SPrediction=>Common Colision Check");
            return(CheckColision(commonOutput));
        }
Beispiel #2
0
        void KillSteal()
        {
            var target = TargetSelector.GetTarget(1300, TargetSelector.DamageType.Magical);

            if (target == null)
            {
                return;
            }
            double       dmg    = 0;
            List <Spell> spells = new List <Spell>();

            SPrediction.Prediction.Result qres, wres;
            qres = new SPrediction.Prediction.Result();
            wres = new SPrediction.Prediction.Result();
            if (GetBool("ks.q") && SpellManager.Q.IsReady() && target.IsValidTarget(SpellManager.Q.Range))
            {
                var pred = SpellManager.Q.GetSPrediction(target);
                if (pred.HitChance >= HitChance.Low)
                {
                    qres = pred;
                    var qdmg = SpellManager.Q.GetDamage(target);
                    dmg += qdmg;
                    spells.Add(SpellManager.Q);
                }
            }

            if (GetBool("ks.w") && SpellManager.W.IsReady() && target.IsValidTarget(SpellManager.W.Range))
            {
                var wdmg = SpellManager.W.GetDamage(target);
                if (target.Health < wdmg)
                {
                    CastW(target);
                }
            }

            if (GetBool("ks.e") && SpellManager.E.IsReady() && target.IsValidTarget(SpellManager.E.Range))
            {
                var edmg = SpellManager.E.GetDamage(target);
                if (target.Health < edmg)
                {
                    CastE();
                }
            }

            if (GetBool("ks.r") && SpellManager.R.IsReady() && target.IsValidTarget(SpellManager.R.Range))
            {
                if (!target.IsBlackListed())
                {
                    var rdmg = SpellManager.R.GetDamage(target);
                    dmg += rdmg;
                    spells.Add(SpellManager.R);
                }
            }

            if (GetBool("ks.ignite") && SpellManager.Ignite.IsReady() && target.IsValidTarget(SpellManager.Ignite.Range))
            {
                var igdmg = SpellManager.Ignite.GetDamage(target);
                dmg += igdmg;
                spells.Add(SpellManager.Ignite);
            }

            if (dmg > target.Health)
            {
                foreach (var spell in spells)
                {
                    if (spell.Slot == SpellSlot.Q)
                    {
                        SpellManager.Q.Cast(qres.CastPosition);
                    }

                    if (spell.Slot == SpellSlot.R)
                    {
                        CastRSpecific(target);
                    }

                    if (spell.Slot == SpellManager.Ignite.Slot)
                    {
                        SpellManager.Ignite.Cast(target);
                    }
                }
            }
        }