public static Vector3?CanQVital(FioraVital v, bool shortVital, bool longVital) { var target = v?.Caster; if (target == null) { return(null); } var center = v.QpredVitalsector.CenterOfPolygon().To3DWorld(); var qpos = v.QPredVitalPos; if (shortVital) { if (Q1.IsInRange(qpos)) { return(qpos); } if (Q1.IsInRange(center)) { return(center); } } if (longVital) { var vitdis = v.QPredVitalPos.Distance(Player.Instance, true); var tardis = target.Distance(Player.Instance, true); var farvit = tardis > vitdis || Q1.IsInRange(center); var maxQCast = Player.Instance.ServerPosition.Extend(v.QPredVitalPos, Q2.IsInRange(v.QPredVitalPos) ? Player.Instance.Distance(v.QPredVitalPos) : Q2.Range).To3D(); var qrect = new Geometry.Polygon.Rectangle(Player.Instance.ServerPosition, maxQCast, Q2.Width + target.BoundingRadius); var insidepoint = v.QpredVitalsector.Points.Any(p => qrect.IsInside(p)) && !qrect.IsInside(target); if (Q2.IsInRange(v.QPredVitalPos) && (farvit || insidepoint)) { return(v.QPredVitalPos); } } return(null); }
public override void OnJungleClear() { var minions = EntityManager.MinionsAndMonsters.Monsters.Where(t => t.IsValidTarget(spiderForm ? E2.Range : E1.Range)); var jungleclear = Features.Find(f => f.NameFeature == "Jungle Clear"); if (minions == null || !minions.Any(t => t.IsValidTarget(spiderForm ? E2.Range : E1.Range)) || jungleclear.SliderValue("jungleclear.mana") > Player.Instance.ManaPercent) { return; } var target = minions.Aggregate((curMax, x) => ((curMax == null && x.IsValid) || x.MaxHealth > curMax.MaxHealth ? x : curMax)); if (!target.IsValidTarget(spiderForm ? E2.Range : E1.Range)) { target = minions.FirstOrDefault(); } if (spiderForm) { if (R.IsReady() && jungleclear.IsChecked("jungleclear.r")) { if (W1.IsReady() && Q1.IsReady()) { R.Cast(); } } if (Q2.IsReady() && jungleclear.IsChecked("jungleclear.q2") && Q2.IsInRange(target)) { Q2.Cast(target); } if (W2.IsReady() && jungleclear.IsChecked("jungleclear.w2") && Player.Instance.IsInAutoAttackRange(target)) { W2.Cast(); } } else { if (R.IsReady() && jungleclear.IsChecked("jungleclear.r")) { if (!Q1.IsReady() && !W1.IsReady()) { if (W1.IsReady() && jungleclear.IsChecked("jungleclear.w") && W1.IsInRange(target)) { W1.Cast(target.Position); EloBuddy.SDK.Core.DelayAction(() => R.Cast(), 250); } else { R.Cast(); } } } if (Q1.IsReady() && jungleclear.IsChecked("jungleclear.q") && Q1.IsInRange(target)) { Q1.Cast(target); } if (W1.IsReady() && jungleclear.IsChecked("jungleclear.w") && W1.IsInRange(target)) { W1.Cast(target.Position); } } }
public override void OnHarass() { var target = TargetSelector.GetTarget(spiderForm ? E2.Range : E1.Range, DamageType.Magical); var harass = Features.Find(f => f.NameFeature == "Harass"); if (target == null || !target.IsValidTarget(1000) || harass.SliderValue("harass.mana") > Player.Instance.ManaPercent) { return; } if (spiderForm) { if (R.IsReady() && harass.IsChecked("harass.r")) { if (!W2.IsReady() && !Q2.IsReady() && !Player.Instance.IsInAutoAttackRange(target)) { R.Cast(); } } if (Q2.IsReady() && harass.IsChecked("harass.q2") && Q2.IsInRange(target)) { Q2.Cast(target); } if (E2.IsReady() && harass.IsChecked("harass.e2") && E2.IsInRange(target) && !Q2.IsInRange(target)) { E2.Cast(target); } if (W2.IsReady() && harass.IsChecked("harass.w2") && Player.Instance.IsInAutoAttackRange(target)) { W2.Cast(); } } else { if (R.IsReady() && harass.IsChecked("harass.r")) { if (!Q1.IsReady() && !E1.IsReady()) { if (W1.IsReady() && harass.IsChecked("harass.w") && W1.IsInRange(target)) { W1.Cast(W1.GetPrediction(target).CastPosition); EloBuddy.SDK.Core.DelayAction(() => R.Cast(), 250); } else { R.Cast(); } } } if (E1.IsReady() && harass.IsChecked("harass.e") && E1.IsInRange(target)) { SpellsUtil.HitChanceCast(E1, target); } if (Q1.IsReady() && harass.IsChecked("harass.q") && Q1.IsInRange(target)) { Q1.Cast(target); } if (W1.IsReady() && harass.IsChecked("harass.w") && W1.IsInRange(target)) { W1.Cast(W1.GetPrediction(target).CastPosition); } } }
public override void OnCombo() { var target = TargetSelector.GetTarget(spiderForm ? E2.Range : E1.Range, DamageType.Magical); if (target == null || !target.IsValidTarget()) { return; } var combo = Features.Find(f => f.NameFeature == "Combo"); if (spiderForm) { if (R.IsReady() && combo.IsChecked("combo.r")) { if (W1.IsReady() && Q1.IsReady() && E1.IsReady()) { R.Cast(); } } if (Q2.IsReady() && combo.IsChecked("combo.q2") && Q2.IsInRange(target)) { Q2.Cast(target); } if (E2.IsReady() && combo.IsChecked("combo.e2") && E2.IsInRange(target) && !Q2.IsInRange(target)) { E2.Cast(target); } if (W2.IsReady() && combo.IsChecked("combo.w2") && Player.Instance.IsInAutoAttackRange(target)) { W2.Cast(); } } else { if (R.IsReady() && combo.IsChecked("combo.r")) { if (!Q1.IsReady()) { if (W1.IsReady() && combo.IsChecked("combo.w") && W1.IsInRange(target)) { W1.Cast(W1.GetPrediction(target).CastPosition); EloBuddy.SDK.Core.DelayAction(() => R.Cast(), 250); } else { R.Cast(); } } } if (E1.IsReady() && combo.IsChecked("combo.e") && E1.IsInRange(target)) { SpellsUtil.HitChanceCast(E1, target); } if (Q1.IsReady() && combo.IsChecked("combo.q") && Q1.IsInRange(target)) { Q1.Cast(target); } } }