Esempio n. 1
0
 /// <summary>
 /// Gets the prediction.
 /// </summary>
 /// <param name="input">The input.</param>
 /// <returns>PredictionOutput.</returns>
 public PredictionOutput GetPrediction(PredictionInput input)
 {
     return(Implementation.GetPrediction(input));
 }
Esempio n. 2
0
        public static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            try
            {
                if (sender.Owner.IsMe)
                {
                    if (Enabled.CurrentValue && (Combo.CurrentValue || Harass.CurrentValue))
                    {
                        if (!Utility.IsValidSlot(args.Slot))
                        {
                            return;
                        }

                        if (Spells[(int)args.Slot] == null)
                        {
                            return;
                        }

                        if (!skillshots[string.Format("{0}{1}", ObjectManager.Player.ChampionName, args.Slot)].Cast <EloBuddy.SDK.Menu.Values.CheckBox>().CurrentValue)
                        {
                            return;
                        }

                        if (handleEvent[(int)args.Slot])
                        {
                            args.Process = false;
                            var enemy = TargetSelector.GetTarget(Spells[(int)args.Slot].Range, DamageType.Physical);



                            if (enemy != null)
                            {
                                SexsiPrediction.Skillshots.PredictionInput input = Spells[(int)args.Slot].GetPredictionInput(enemy);

                                if (input != null)
                                {
                                    var pred = SexsiPrediction.Skillshots.Prediction.Implementation.GetPrediction(input);

                                    if (!(pred.HitChance >= Utility.HitchanceArray[Hitc.SelectedIndex]))
                                    {
                                        args.Process = false;
                                        return;
                                    }


                                    if (ObjectManager.Player.ChampionName == "Viktor" && args.Slot == SpellSlot.E)
                                    {
                                        handleEvent[(int)args.Slot]      = false;
                                        Spells[(int)args.Slot].Range     = 500;
                                        Spells[(int)args.Slot].HitChance = Utility.HitchanceArray[Hitc.SelectedIndex];
                                        Spells[(int)args.Slot].Cast(pred.CastPosition);
                                    }
                                    else if (ObjectManager.Player.ChampionName == "Diana" && args.Slot == SpellSlot.Q)
                                    {
                                        handleEvent[(int)args.Slot]      = false;
                                        Spells[(int)args.Slot].HitChance = Utility.HitchanceArray[Hitc.SelectedIndex];
                                        Spells[(int)args.Slot].Cast(pred.CastPosition);
                                    }
                                    else
                                    {
                                        Spells[(int)args.Slot].HitChance = Utility.HitchanceArray[Hitc.SelectedIndex];
                                        Spells[(int)args.Slot].Cast(pred.CastPosition);
                                        handleEvent[(int)args.Slot] = false;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }