public static bool CastSpell(Spell spell, Obj_AI_Base target, SebbyLib.Prediction.HitChance hitChance) { SebbyLib.Prediction.SkillshotType CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotLine; bool aoe2 = false; if (spell.Type == SkillshotType.SkillshotCircle) { CoreType2 = SebbyLib.Prediction.SkillshotType.SkillshotCircle; aoe2 = true; } if (spell.Width > 80 && !spell.Collision) { aoe2 = true; } var predInput2 = new SebbyLib.Prediction.PredictionInput { Aoe = aoe2, Collision = spell.Collision, Speed = spell.Speed, Delay = spell.Delay, Range = spell.Range, From = HeroManager.Player.ServerPosition, Radius = spell.Width, Unit = target, Type = CoreType2 }; var poutput2 = SebbyLib.Prediction.Prediction.GetPrediction(predInput2); if (spell.Speed != float.MaxValue && OktwCommon.CollisionYasuo(HeroManager.Player.ServerPosition, poutput2.CastPosition)) { return(false); } if (poutput2.Hitchance >= hitChance) { return(spell.Cast(poutput2.CastPosition)); } else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 && poutput2.Hitchance >= SebbyLib.Prediction.HitChance.High) { return(spell.Cast(poutput2.CastPosition)); } return(false); }
public static void CastSpell(Spell qwer, Obj_AI_Base target) { switch (GetStringValue("PredictionMode")) { case 0: { const Prediction.SkillshotType coreType2 = Prediction.SkillshotType.SkillshotLine; var predInput2 = new Prediction.PredictionInput { Collision = qwer.Collision, Speed = qwer.Speed, Delay = qwer.Delay, Range = qwer.Range, From = Player.ServerPosition, Radius = qwer.Width, Unit = target, Type = coreType2 }; var poutput2 = Prediction.Prediction.GetPrediction(predInput2); // if (poutput2 == null) return; if (poutput2.Hitchance >= Prediction.HitChance.High || poutput2.Hitchance == Prediction.HitChance.Immobile || poutput2.Hitchance == Prediction.HitChance.Dashing) { qwer.Cast(poutput2.CastPosition); } break; } case 1: var pred = Q.GetPrediction(target); if (pred.Hitchance >= LeagueSharp.Common.HitChance.High || pred.Hitchance == LeagueSharp.Common.HitChance.Immobile) { if (pred.CollisionObjects.Count == 0) { Q.Cast(pred.CastPosition); } } break; } }