public static Spellbook FindSpellbookInList( List<Spellbook> list, Mobile from, int spellID, SpellbookType type )
{
Container pack = from.Backpack;
for ( int i = list.Count - 1; i >= 0; --i )
{
if ( i >= list.Count )
continue;
Spellbook book = list[i];
if ( !book.Deleted && (book.Parent == from || (pack != null && book.Parent == pack)) && ValidateSpellbook( book, spellID, type ) )
return book;
list.RemoveAt( i );
}
return null;
}