private static void CastW(Obj_AI_Hero target, bool isCombo = false) { if (WState != 0 || Variables.TickCount - W.LastCastAttemptT <= 500) { return; } var castPos = default(Vector3); var spellQ = new Spell(SpellSlot.Q, Q.Range); spellQ.SetSkillshot(Q.Delay, Q.Width, Q.Speed - 100, Q.Collision, Q.Type); var posPred = spellQ.VPrediction(target, true, new[] { CollisionableObjects.YasuoWall }).CastPosition; if (isCombo) { switch (MainMenu["Orbwalk"]["WAdv"].GetValue<MenuList>().Index) { case 1: castPos = Player.ServerPosition + (posPred - rShadow.ServerPosition).Normalized() * W.Range; break; case 2: var subPos1 = Player.ServerPosition + (posPred - rShadow.ServerPosition).Normalized().Perpendicular() * W.Range; var subPos2 = Player.ServerPosition + (rShadow.ServerPosition - posPred).Normalized().Perpendicular() * W.Range; if (subPos1.IsWall() && !subPos2.IsWall() && target.Distance(subPos2) < target.Distance(subPos1)) { castPos = subPos2; } if (!subPos1.IsWall() && subPos2.IsWall() && target.Distance(subPos1) < target.Distance(subPos2)) { castPos = subPos1; } if ((!subPos1.IsWall() && !subPos2.IsWall()) || (subPos1.IsWall() && subPos2.IsWall())) { castPos = target.Distance(subPos1) < target.Distance(subPos2) ? subPos1 : subPos2; } if (!castPos.IsValid()) { castPos = subPos1; } break; case 3: castPos = Game.CursorPos; break; } } else { castPos = W.IsInRange(target) ? Player.ServerPosition.Extend(posPred, E.Range) : target.ServerPosition; } if (!castPos.IsValid()) { return; } W.Cast(castPos); W.LastCastAttemptT = Variables.TickCount; }
private static bool CastQ3(Obj_AI_Hero target = null) { var spellQ = new Spell(SpellSlot.Q, Q2.Range); spellQ.SetSkillshot(Q2.Delay, Q2.Width, Q2.Speed, true, Q2.Type); if (target != null) { var pred = spellQ.VPrediction(target, true, new[] { CollisionableObjects.YasuoWall }); if (pred.Hitchance >= Q2.MinHitChance && Q.Cast(pred.CastPosition)) { return true; } } else { int[] hit = { -1 }; var predPos = Vector3.Zero; foreach (var pred in GameObjects.EnemyHeroes.Where(i => i.IsValidTarget(Q2.Range)) .Select(i => spellQ.VPrediction(i, true, new[] { CollisionableObjects.YasuoWall })) .Where(i => i.Hitchance >= Q2.MinHitChance && i.AoeTargetsHitCount > hit[0])) { hit[0] = pred.AoeTargetsHitCount; predPos = pred.CastPosition; } if (predPos.IsValid() && Q.Cast(predPos)) { return true; } } return false; }