public static void OnAfterAttack(AttackableUnit target, EventArgs args) { if (target != null && (!target.IsValid || target.IsDead)) { return; } var orbwalkermode = Orbwalker.ActiveModesFlags; if (orbwalkermode == Orbwalker.ActiveModes.Combo) { if (Misc.isChecked(ComboMenu, "comboQ") && Q.IsReady() && !Misc.isChecked(ComboMenu, "qsQUsage") && _Player.Distance(_target.Position) < (_Player.GetAutoAttackRange() + Q.Range)) { if (Misc.isChecked(ComboMenu, "qsQDirection")) { if (target != null) { Q.Cast(target.Position); } } else { Player.CastSpell(SpellSlot.Q, Game.CursorPos); } } } }
public static bool TryToCast(this Spell.Ranged spell, Obj_AI_Base target, Menu m) { if (target == null) { return(false); } return(target.CanCast(spell, m) && spell.Cast(target)); }
/// <summary> /// It will only cast the spell if it can /// </summary> /// <param name="spell">Active Spell</param> /// <param name="target">Target to cast the spell</param> public static bool TryCast(this Spell.Ranged spell, Obj_AI_Base target) { if (spell != null) { if (target.CanCast(spell)) { return(spell.Cast(target)); } } return(false); }
public static bool TryToCast(this Spell.Ranged spell, Obj_AI_Base target, Menu m) { if (target == null) { return(false); } return(target.CanCastSpell(spell) && m.GetCheckBoxValue(spell.Slot.ToString().ToLower()) && spell.Cast(target)); }