private static void AllCrafts_OnTarget(Mobile from, object target) { if (target is BookOfSpellCrafts) { BookOfSpellCrafts book = target as BookOfSpellCrafts; book.Content = ulong.MaxValue; book.InvalidateProperties(); from.SendMessage("Book filled."); } else { from.SendMessage("That is not a Book of Spellcrafts."); } }
private static void AddCraft_OnTarget(Mobile from, object target, object state) { int num = (int)state; if (target is BookOfSpellCrafts) { BookOfSpellCrafts book = target as BookOfSpellCrafts; if (book.HasCraft(num)) { from.SendMessage("The book already has this craft."); } else { book.Content |= (ulong)1 << num; book.InvalidateProperties(); from.SendMessage("The spellcraft has been added to the book."); } } else { from.SendMessage("That is not a Book of Spellcrafts."); } }