Exemple #1
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                Item iPearl = targeted as Item;

                if ( iPearl is BaseJewel )
                {
                    BaseJewel xPearl = (BaseJewel)iPearl;

                    if ( !iPearl.IsChildOf( from.Backpack ) )
                    {
                        from.SendMessage( "You can only use this pearl on items in your pack." );
                    }
                    else if
                    (
                        iPearl is BaseNecklace ||
                        iPearl is BaseEarrings ||
                        iPearl is BaseBracelet ||
                        iPearl is MagicJewelryCirclet ||
                        ( iPearl is BaseRing && Server.Misc.MaterialInfo.IsJewelryRing( iPearl ) )
                    )
                    {
                        string pName = "Mystical Pearl Ring";
                        if ( iPearl is BaseNecklace ){ pName = "Mystical Pearl Necklace"; }
                        else if ( iPearl is BaseEarrings ){ pName = "Mystical Pearl Earrings"; }
                        else if ( iPearl is MagicJewelryCirclet ){ pName = "Mystical Pearl Circlet"; }
                        else if ( iPearl is BaseBracelet ){ pName = "Mystical Pearl Bracelet"; }
                        MorphingItem.MorphMyItem( iPearl, "IGNORED", "IGNORED", pName, MorphingTemplates.TemplatePearlJewelry("misc") );
                        from.RevealingAction();
                        from.PlaySound( 0x242 );
                        m_Pearl.Consume();
                    }
                    else
                    {
                        from.SendMessage( "You cannot use this pearl on that." );
                    }
                }
                else
                {
                    from.SendMessage( "You cannot use this pearl on that." );
                }
            }