public static bool CanCastSpell(this Obj_AI_Base target, Spell.Skillshot spell, int hitchancePercent = 75) { var asBase = spell as Spell.SpellBase; var pred = spell.GetPrediction(target); return(target.CanCastSpell(asBase) && pred.HitChancePercent >= 75); }
public static bool TryToCast(this Spell.Skillshot spell, Obj_AI_Base target, Menu m, int percent = 75) { if (target == null) { return(false); } return(target.CanCastSpell(spell) && m.GetCheckBoxValue(spell.Slot.ToString().ToLower()) && spell.Cast(target)); }
public static bool TryToCast(this Spell.Active spell, Obj_AI_Base target, Menu m) { if (target == null) { return(false); } return(target.CanCastSpell(spell) && m.GetCheckBoxValue(spell.Slot.ToString().ToLower()) && spell.Cast()); }
public static bool CanCastSpell(this Obj_AI_Base target, Spell.Targeted spell) { var asBase = spell as Spell.SpellBase; return(target.CanCastSpell(asBase)); }
public static bool CanCastSpell(this Obj_AI_Base entity, Spell spell, HitChance hitchance) => entity != null && spell != null && entity.CanCastSpell(spell) && spell.GetPrediction(entity).Hitchance >= hitchance;
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() + "Use") && spell.Cast(target); }