private static SetUser ( |
||
book | ||
mob | Server.Mobile | |
리턴 | void |
protected override void OnTarget(Mobile from, object targeted) { BaseBook book = targeted as BaseBook; if (book == null) { from.SendLocalizedMessage(1046296); // That is not a book } else if (Inscribe.IsEmpty(book)) { from.SendLocalizedMessage(501611); // Can't copy an empty book. } else if (Inscribe.GetUser(book) != null) { from.SendLocalizedMessage(501621); // Someone else is inscribing that item. } else { Target target = new InternalTargetDst(book); from.Target = target; from.SendLocalizedMessage(501612); // Select a book to copy this to. target.BeginTimeout(from, TimeSpan.FromMinutes(1.0)); Inscribe.SetUser(book, from); } }
protected override void OnTarget(Mobile from, object targeted) { IEntity entity = targeted as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.Inscribe, from.Skills[SkillName.Inscribe].Value)) { return; } BaseBook book = targeted as BaseBook; if (book == null) { from.SendLocalizedMessage(1046296); // That is not a book } else if (Inscribe.IsEmpty(book)) { from.SendLocalizedMessage(501611); // Can't copy an empty book. } else if (Inscribe.GetUser(book) != null) { from.SendLocalizedMessage(501621); // Someone else is inscribing that item. } else { Target target = new InternalTargetDst(book); from.Target = target; from.SendLocalizedMessage(501612); // Select a book to copy this to. target.BeginTimeout(from, TimeSpan.FromMinutes(1.0)); Inscribe.SetUser(book, from); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BlankScroll) { new Engines.Craft.InscribeSystem((BlankScroll)targeted).Begin(from, null); return; } BaseBook book = targeted as BaseBook; if (book == null) { from.SendLocalizedMessage(1046296); // That is not a book } else if (Inscribe.IsEmpty(book)) { from.SendLocalizedMessage(501611); // Can't copy an empty book. } else if (Inscribe.GetUser(book) != null) { from.SendLocalizedMessage(501621); // Someone else is inscribing that item. } else { from.Target = new InternalTargetDst(book); from.SendLocalizedMessage(501612); // Select a book to copy this to. Inscribe.SetUser(book, from); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is RecallRune) { RecallRune rune = (RecallRune)targeted; if (!rune.Marked) { from.SendMessage("You cannot copy an unmarked recall rune."); } else if (Inscribe.GetUser(rune) != null) { from.SendLocalizedMessage(501621); // Someone else is inscribing that item. } else { Target target = new InternalTargetDst(rune); from.Target = target; from.SendMessage("Select a moonstone to copy that to."); // reword target.BeginTimeout(from, TimeSpan.FromMinutes(1.0)); Inscribe.SetUser(rune, from); } } else if (targeted is BaseBook) { BaseBook book = (BaseBook)targeted; if (Inscribe.IsEmpty(book)) { from.SendLocalizedMessage(501611); // Can't copy an empty book. } else if (Inscribe.GetUser(book) != null) { from.SendLocalizedMessage(501621); // Someone else is inscribing that item. } else if (!book.Copyable) { from.SendAsciiMessage("That book is not copyable."); } else { Target target = new InternalTargetDst(book); from.Target = target; from.SendLocalizedMessage(501612); // Select a book to copy this to. target.BeginTimeout(from, TimeSpan.FromMinutes(1.0)); Inscribe.SetUser(book, from); } } else { from.SendMessage("You cannot copy that."); } }
protected override void OnTarget(Mobile from, object targeted) { BaseBook book = targeted as BaseBook; Container pack = from.Backpack; if (targeted is BlankScroll) { Item item = (Item)targeted; if (item.RootParent != from) { from.SendAsciiMessage("That must be in your pack for you to use it."); } else { if (pack != null) { if (pack.FindItemByType(typeof(Spellbook)) == null) { from.SendAsciiMessage("You don't have a spellbook."); } else if (((Spellbook)pack.FindItemByType(typeof(Spellbook))).SpellCount == 0) { from.SendAsciiMessage("You can't inscribe any spells."); } else { BaseTool m_Pen = new ScribesPen(); from.SendMenu(new InscriptionMenu(from, InscriptionMenu.Main(from), "Main", m_Pen)); if (m_Pen != null) { m_Pen.Delete(); } } } } } else { if (book == null) { from.SendAsciiMessage("Can't inscribe that item."); } else if (Inscribe.IsEmpty(book)) { from.SendAsciiMessage("Can't copy an empty book."); // Can't copy an empty book. } else if (Inscribe.GetUser(book) != null) { from.SendAsciiMessage("Someone else is inscribing that item."); // Someone else is inscribing that item. } else { Target target = new InternalTargetDst(book); from.Target = target; from.SendAsciiMessage("Select a book to copy this to."); // Select a book to copy this to. target.BeginTimeout(from, TimeSpan.FromMinutes(1.0)); Inscribe.SetUser(book, from); } } }