Copy() public static méthode

public static Copy ( BaseBook bookSrc, BaseBook bookDst ) : void
bookSrc Server.Items.BaseBook
bookDst Server.Items.BaseBook
Résultat void
Exemple #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_BookSrc.Deleted)
                {
                    return;
                }

                EventSink.InvokeSkillUsed(new SkillUsedEventArgs(from, from.Skills[SkillName.Inscribe]));

                BaseBook bookDst = targeted as BaseBook;

                if (bookDst == null)
                {
                    from.SendLocalizedMessage(1046296); // That is not a book
                }
                else if (Inscribe.IsEmpty(m_BookSrc))
                {
                    from.SendLocalizedMessage(501611); // Can't copy an empty book.
                }
                else if (bookDst == m_BookSrc)
                {
                    from.SendLocalizedMessage(501616); // Cannot copy a book onto itself.
                }
                else if (!bookDst.Writable)
                {
                    from.SendLocalizedMessage(501614); // Cannot write into that book.
                }
                else if (Inscribe.GetUser(bookDst) != null)
                {
                    from.SendLocalizedMessage(501621); // Someone else is inscribing that item.
                }
                else
                {
                    if (from.CheckTargetSkill(SkillName.Inscribe, bookDst, 0, 50))
                    {
                        Inscribe.Copy(m_BookSrc, bookDst);

                        from.SendLocalizedMessage(501618); // You make a copy of the book.
                        from.PlaySound(0x249);
                    }
                    else
                    {
                        from.SendLocalizedMessage(501617); // You fail to make a copy of the book.
                    }
                }
            }
Exemple #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_BookSrc.Deleted)
                {
                    return;
                }

                BaseBook bookDst = targeted as BaseBook;

                if (bookDst == null)
                {
                    from.SendAsciiMessage("That is not a book."); // That is not a book
                }
                else if (Inscribe.IsEmpty(m_BookSrc))
                {
                    from.SendAsciiMessage("Can't copy an empty book."); // Can't copy an empty book.
                }
                else if (bookDst == m_BookSrc)
                {
                    from.SendAsciiMessage("Cannot copy a book onto itself."); // Cannot copy a book onto itself.
                }
                else if (!bookDst.Writable)
                {
                    from.SendAsciiMessage("Cannot write into that book."); // Cannot write into that book.
                }
                else if (Inscribe.GetUser(bookDst) != null)
                {
                    from.SendAsciiMessage("Someone else is inscribing that item."); // Someone else is inscribing that item.
                }
                else
                {
                    if (from.CheckTargetSkill(SkillName.Inscribe, bookDst, 0, 50))
                    {
                        Inscribe.Copy(m_BookSrc, bookDst);

                        from.SendAsciiMessage("You make a copy of the book."); // You make a copy of the book.
                        from.PlaySound(0x249);
                    }
                    else
                    {
                        from.SendAsciiMessage("You fail to make a copy of the book."); // You fail to make a copy of the book.
                    }
                }
            }