private static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { var caster = sender as Obj_AI_Hero; if (caster == null || !caster.IsValid || caster.Team == Player.Team) { return; } var spellDatas = Spells.Where( i => caster.ChampionName.ToLowerInvariant() == i.ChampionName.ToLowerInvariant() && Menu.SubMenu("EvadeOthers").SubMenu(i.ChampionName.ToLowerInvariant()) .Item(i.ChampionName + i.Slot).GetValue <bool>()); if (!spellDatas.Any()) { return; } foreach (var spellData in spellDatas) { // auto attack if (args.SData.IsAutoAttack() && args.Target != null && args.Target.IsMe) { if (spellData.ChampionName == "Jax" && spellData.Slot == SpellSlot.W && caster.HasBuff("JaxEmpowerTwo")) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Yorick" && spellData.Slot == SpellSlot.Q && caster.HasBuff("YorickSpectral")) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Poppy" && spellData.Slot == SpellSlot.Q && caster.HasBuff("PoppyDevastatingBlow")) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Rengar" && spellData.Slot == SpellSlot.Q && (caster.HasBuff("rengarqbase") || caster.HasBuff("rengarqemp"))) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Nautilus" && spellData.Slot == SpellSlot.Unknown && (!Player.HasBuff("nautiluspassivecheck"))) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Udyr" && spellData.Slot == SpellSlot.E && caster.HasBuff("UdyrBearStance") && (Player.HasBuff("udyrbearstuncheck"))) { SolveInstantBlock(); return; } return; } // aoe if (spellData.ChampionName == "Riven" && spellData.Slot == SpellSlot.W && args.Slot == SpellSlot.W)// chua test { if (Player.Position.To2D().Distance(caster.Position.To2D()) <= Player.BoundingRadius + caster.BoundingRadius + caster.AttackRange) { SolveInstantBlock(); } return; } if (spellData.ChampionName == "Diana" && spellData.Slot == SpellSlot.E && args.Slot == SpellSlot.E)// chua test { if (Player.Position.To2D().Distance(caster.Position.To2D()) <= Player.BoundingRadius + 450) { SolveInstantBlock(); } return; } if (spellData.ChampionName == "Maokai" && spellData.Slot == SpellSlot.R && args.SData.Name == "maokaidrain3toggle") { if (Player.Position.To2D().Distance(caster.Position.To2D()) <= Player.BoundingRadius + 575) { SolveInstantBlock(); } return; } if (spellData.ChampionName == "Kalista" && spellData.Slot == SpellSlot.E && args.Slot == SpellSlot.E) { if (Player.Position.To2D().Distance(caster.Position.To2D()) <= 950 && Player.HasBuff("kalistaexpungemarker")) { SolveInstantBlock(); } return; } if (spellData.ChampionName == "Kennen" && spellData.Slot == SpellSlot.W && args.Slot == SpellSlot.W)// chua test { if (Player.Position.To2D().Distance(caster.Position.To2D()) <= 800 && Player.HasBuff("kennenmarkofstorm") && Player.GetBuffCount("kennenmarkofstorm") == 2) { SolveInstantBlock(); } return; } if (spellData.ChampionName == "Azir" && spellData.Slot == SpellSlot.R && args.Slot == SpellSlot.R)// chua test { Vector2 start = caster.Position.To2D().Extend(args.End.To2D(), -300); Vector2 end = start.Extend(caster.Position.To2D(), 750); Render.Circle.DrawCircle(start.To3D(), 50, Color.Red); Render.Circle.DrawCircle(end.To3D(), 50, Color.Red); float width = caster.Level >= 16 ? 125 * 6 / 2 : caster.Level >= 11 ? 125 * 5 / 2 : 125 * 4 / 2; FioraProject.Evade.Geometry.Rectangle Rect = new FioraProject.Evade.Geometry.Rectangle(start, end, width); var Poly = Rect.ToPolygon(); if (!Poly.IsOutside(Player.Position.To2D())) { SolveInstantBlock(); } return; } } }
private static void AIHeroClient_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { var caster = sender as AIHeroClient; if (caster == null || !caster.IsValid || caster.Team == Player.Team) { return; } var spellDatas = Spells.Where( i => caster.ChampionName.ToLowerInvariant() == i.ChampionName.ToLowerInvariant() && evadeMenu[i.ChampionName + i.Slot] != null ? getCheckBoxItem(evadeMenu, i.ChampionName + i.Slot) : false); if (!spellDatas.Any()) { return; } foreach (var spellData in spellDatas) { // auto attack if (args.SData.IsAutoAttack() && args.Target != null && args.Target.IsMe) { if (spellData.ChampionName == "Jax" && spellData.Slot == SpellSlot.W && caster.HasBuff("JaxEmpowerTwo")) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Yorick" && spellData.Slot == SpellSlot.Q && caster.HasBuff("YorickSpectral")) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Poppy" && spellData.Slot == SpellSlot.Q && caster.HasBuff("PoppyDevastatingBlow")) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Rengar" && spellData.Slot == SpellSlot.Q && (caster.HasBuff("rengarqbase") || caster.HasBuff("rengarqemp"))) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Nautilus" && spellData.Slot == SpellSlot.Unknown && (!Player.HasBuff("nautiluspassivecheck"))) { SolveInstantBlock(); return; } if (spellData.ChampionName == "Udyr" && spellData.Slot == SpellSlot.E && caster.HasBuff("UdyrBearStance") && (Player.HasBuff("udyrbearstuncheck"))) { SolveInstantBlock(); return; } return; } // aoe if (spellData.ChampionName == "Riven" && spellData.Slot == SpellSlot.W && args.Slot == SpellSlot.W)// chua test { if (Player.Position.LSTo2D().LSDistance(caster.Position.LSTo2D()) <= Player.BoundingRadius + caster.BoundingRadius + caster.AttackRange) SolveInstantBlock(); return; } if (spellData.ChampionName == "Diana" && spellData.Slot == SpellSlot.E && args.Slot == SpellSlot.E)// chua test { if (Player.Position.LSTo2D().LSDistance(caster.Position.LSTo2D()) <= Player.BoundingRadius + 450) SolveInstantBlock(); return; } if (spellData.ChampionName == "Maokai" && spellData.Slot == SpellSlot.R && args.SData.Name == "maokaidrain3toggle") { if (Player.Position.LSTo2D().LSDistance(caster.Position.LSTo2D()) <= Player.BoundingRadius + 575) SolveInstantBlock(); return; } if (spellData.ChampionName == "Kalista" && spellData.Slot == SpellSlot.E && args.Slot == SpellSlot.E) { if (Player.Position.LSTo2D().LSDistance(caster.Position.LSTo2D()) <= 950 && Player.HasBuff("kalistaexpungemarker")) SolveInstantBlock(); return; } if (spellData.ChampionName == "Kennen" && spellData.Slot == SpellSlot.W && args.Slot == SpellSlot.W)// chua test { if (Player.Position.LSTo2D().LSDistance(caster.Position.LSTo2D()) <= 800 && Player.HasBuff("kennenmarkofstorm") && Player.GetBuffCount("kennenmarkofstorm") == 2) SolveInstantBlock(); return; } if (spellData.ChampionName == "Azir" && spellData.Slot == SpellSlot.R && args.Slot == SpellSlot.R)// chua test { Vector2 start = caster.Position.LSTo2D().LSExtend(args.End.LSTo2D(), -300); Vector2 end = start.LSExtend(caster.Position.LSTo2D(), 750); Render.Circle.DrawCircle(start.To3D(), 50, Color.Red); Render.Circle.DrawCircle(end.To3D(), 50, Color.Red); float width = caster.Level >= 16 ? 125 * 6 / 2 : caster.Level >= 11 ? 125 * 5 / 2 : 125 * 4 / 2; FioraProject.Evade.Geometry.Rectangle Rect = new FioraProject.Evade.Geometry.Rectangle(start, end, width); var Poly = Rect.ToPolygon(); if (!Poly.IsOutside(Player.Position.LSTo2D())) { SolveInstantBlock(); } return; } } }