those checks should be enough i think. Just modified my own one.
/// <summary>
/// Determine if the spell can be cast
/// </summary>
/// <param name="target">The target we want to cast at</param>
/// <returns>Returns true if we can cast the spell, otherwise false</returns>
public bool IsValid(WoWUnit target, WoWSpell spell)
{
// Target available?
if (target == null)
{
// Skip
return false;
}
// Validate own conditions
if (ObjectManager.Me.Silenced || ObjectManager.Me.IsStunned)
{
// Skip
return false;
}
// Valid?
if (target.IsDead || !spell.IsKnown || !spell.IsSpellUsable || !spell.IsDistanceGood || TraceLine.TraceLineGo(target.Position))
{
// Skip
return false;
}
// Return
return true;
}