public void Cast_BasicSkillshot_AOE_Farm(Spell spell, int extrawidth = 0) { if(!spell.IsReady() ) return; var minions = MinionManager.GetMinions(ObjectManager.Player.Position, spell.Type == SkillshotType.SkillshotLine ? spell.Range : spell.Range + ((spell.Width + extrawidth) / 2),MinionTypes.All , MinionTeam.NotAlly); if(minions.Count == 0) return; var castPostion = new MinionManager.FarmLocation(); if(spell.Type == SkillshotType.SkillshotCircle) castPostion = MinionManager.GetBestCircularFarmLocation(minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width + extrawidth, spell.Range); if(spell.Type == SkillshotType.SkillshotLine) castPostion = MinionManager.GetBestLineFarmLocation(minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width, spell.Range); spell.Cast(castPostion.Position, UsePackets()); }
/// <summary> /// Lane clear behavior for the specified ChampionSpell /// </summary> public void LaneClear() { if (this.Clear != null) { this.Clear(); return; } var minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, this.Range); var position = new MinionManager.FarmLocation(); switch (this.CastingType) { case CastType.Linear: case CastType.Cone: position = this.Instance.GetLineFarmLocation(minions); break; case CastType.Circle: position = this.Instance.GetCircularFarmLocation(minions); break; default: var minion = minions.Where(unit => unit.IsValidTarget(this.Range)); if (minion.Any()) { position.Position = CastingType == CastType.Self ? ObjectManager.Player.ServerPosition.To2D() : MEC.GetMec(minion.Select(s => s.ServerPosition.To2D()).ToList()).Center; position.MinionsHit = minion.Count(); } break; } if (position.Position != null && position.MinionsHit > 1) { this.Instance.Cast(position.Position); } }