private static void onDoCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { if (!sender.IsMe) { return; } if (Lucian.gotPassiveRdy()) { if (!args.SData.IsAutoAttack()) { Console.WriteLine("Basaadaa"); } } }
public static Obj_AI_Base GetPossibleTarget() { if (ForcedTarget != null) { if (InAutoAttackRange(ForcedTarget)) { return(ForcedTarget); } ForcedTarget = null; } Obj_AI_Base tempTarget = null; if (Menu.Item("lxOrbwalker_Misc_Priority_Unit").GetValue <StringList>().SelectedIndex == 1 && (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear)) { tempTarget = GetBestHeroTarget(); if (tempTarget != null) { return(tempTarget); } } if (CurrentMode == Mode.Harass || CurrentMode == Mode.Lasthit || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze) { foreach ( var minion in from minion in MinionManager.GetMinions(MyHero.Position, 1000, MinionTypes.All, MinionTeam.NotAlly).Where(minion => minion.IsValidTarget() && InAutoAttackRange(minion)) let t = (int)(MyHero.AttackCastDelay * 1000) - 100 + Game.Ping / 2 + 1000 * (int)MyHero.Distance(minion) / (int)MyProjectileSpeed() let predHealth = DamagePrediction.getPred(minion, DamagePrediction.PredType.PRED_LAST_HIT) where minion.Team != GameObjectTeam.Neutral && predHealth > -10 && predHealth <= ((Lucian.gotPassiveRdy()) ? MyHero.GetAutoAttackDamage(minion) * 1.6f : MyHero.GetAutoAttackDamage(minion)) select minion) { return(minion); } } //for tower under shooting if (CurrentMode == Mode.Harass || CurrentMode == Mode.Lasthit || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze) { var tTarget = MinionClearer.getTowerTarget(); if (tTarget != null) { Console.WriteLine("Target under tower!!"); return(tTarget); } } if (MinionClearer.getMinUnderTower() != null) { return(null); } if (CurrentMode == Mode.Harass || CurrentMode == Mode.LaneClear || CurrentMode == Mode.LaneFreeze) { foreach ( var turret in ObjectManager.Get <Obj_AI_Turret>().Where(turret => turret.IsValidTarget(GetAutoAttackRange(MyHero, turret)))) { return(turret); } } if (CurrentMode != Mode.Lasthit) { tempTarget = GetBestHeroTarget(); if (tempTarget != null) { return(tempTarget); } } float[] maxhealth; if (CurrentMode == Mode.LaneClear || CurrentMode == Mode.Harass || CurrentMode == Mode.LaneFreeze) { maxhealth = new float[] { 0 }; var maxhealth1 = maxhealth; foreach (var minion in MinionManager.GetMinions(MyHero.Position, 1000, MinionTypes.All, MinionTeam.NotAlly).Where(minion => minion.IsValidTarget(GetAutoAttackRange(MyHero, minion)) && minion.Team == GameObjectTeam.Neutral).Where(minion => minion.MaxHealth >= maxhealth1[0] || Math.Abs(maxhealth1[0] - float.MaxValue) < float.Epsilon)) { tempTarget = minion; maxhealth[0] = minion.MaxHealth; } if (tempTarget != null) { return(tempTarget); } } if (CurrentMode != Mode.LaneClear || ShouldWait()) { return(null); } maxhealth = new float[] { 0 }; foreach (var minion in from minion in MinionManager.GetMinions(MyHero.Position, 1000, MinionTypes.All, MinionTeam.NotAlly) .Where(minion => minion.IsValidTarget(GetAutoAttackRange(MyHero, minion))) let predHealth = DtsHealthPrediction.LaneClearHealthPrediction(minion, (int)((MyHero.AttackDelay * 1000) * LaneClearWaitTimeMod), FarmDelay()) where predHealth >= (((Lucian.gotPassiveRdy()) ? MyHero.GetAutoAttackDamage(minion) * 2.6f : MyHero.GetAutoAttackDamage(minion) * 1.6f)) || Math.Abs(predHealth - minion.Health) < float.Epsilon where minion.Health >= maxhealth[0] || Math.Abs(maxhealth[0] - float.MaxValue) < float.Epsilon select minion) { tempTarget = minion; maxhealth[0] = minion.MaxHealth; } return(tempTarget); }