public bool PredictedPosInRange(Obj_AI_Base target, GameObject sourceObj = null) { var source = sourceObj ?? RangeCheckSource; var pred = GetPrediction(target); switch (Type) { case SpellType.Targeted: return(RangeCheckSource.IsInRange(pred.CastPosition, Range + AIO.MyHero.BoundingRadius + target.BoundingRadius - 65)); case SpellType.Circular: return(source.IsInRange(pred.CastPosition, Range + Radius + target.BoundingRadius)); case SpellType.Linear: return(source.IsInRange(pred.CastPosition, Range + Width + target.BoundingRadius)); } //Self return(source.IsInRange(pred.CastPosition, Range + target.BoundingRadius)); }
public void Cast(Obj_AI_Base target, CustomSettings custom = null) { if (!IsReady || Chat.IsOpen || !IsInRange(target)) { return; } if (ModeManager.Harass && target.Type == GameObjectType.AIHeroClient) { if (Orbwalker.ShouldWait) { return; } } if (ModeManager.LaneClear || ModeManager.LastHit || ModeManager.Harass) { if (Orbwalker.LastTarget != null && Orbwalker.LastTarget.Type == GameObjectType.obj_AI_Minion && !Orbwalker.CanMove) { return; } } if (Type == SpellType.Linear || Type == SpellType.Circular || Type == SpellType.Cone) { var pred = GetPrediction(target, custom); if (pred.HitChancePercent >= HitChancePercent) { if (WillHitYasuoWall(pred.CastPosition) || !RangeCheckSource.IsInRange(pred.CastPosition, Range)) { return; } if (AIO.MyHero.Spellbook.CastSpell(Slot, pred.CastPosition)) { LastSentTime = Core.GameTickCount; LastEndPosition = pred.CastPosition; } } } else if (Type == SpellType.Targeted) { if (WillHitYasuoWall(target.ServerPosition)) { return; } if (AIO.MyHero.Spellbook.CastSpell(Slot, target)) { LastSentTime = Core.GameTickCount; } } else if (Type == SpellType.Self) { var pred = GetPrediction(target, custom); if (pred.HitChancePercent >= HitChancePercent) { if (!PredictedPosInRange(target)) { return; } if (AIO.MyHero.Spellbook.CastSpell(Slot)) { LastSentTime = Core.GameTickCount; } } } }