Beispiel #1
0
 protected override void OnTarget(Mobile from, object targeted)
 {
     if (targeted is BaseBook book)
     {
         if (IsEmpty(book))
         {
             from.SendLocalizedMessage(501611); // Can't copy an empty book.
         }
         else if (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));
             SetUser(book, from);
         }
     }
     else if (targeted is Engines.Khaldun.MysteriousBook)
     {
         ((Engines.Khaldun.MysteriousBook)targeted).OnInscribeTarget(from);
     }
     else
     {
         from.SendLocalizedMessage(1046296); // That is not a book
     }
 }
            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);
                }
            }
Beispiel #3
0
            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);
                }
            }
Beispiel #4
0
            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.");
                }
            }
Beispiel #5
0
			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 );
				}
			}
Beispiel #6
0
			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.");
			}
Beispiel #7
0
            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);
                    }
                }
            }
Beispiel #8
0
			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 );
				}
			}
Beispiel #9
0
 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 if( book is HTMLBook && ((HTMLBook)book).SealedBy == null )
         from.SendMessage( "You cannot copy a book that has not been sealed." );
     else if( book is HTMLBook && ((HTMLBook)book).SealedBy != from && from.AccessLevel < AccessLevel.GameMaster )
         from.SendMessage( "You cannot copy a book that has been sealed by someone else." );
     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 );
     }
 }
Beispiel #10
0
            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);
                    }
                }
            }