Beispiel #1
0
        private void UseMasterScroll(Mobile from)
        {
            BlankScroll bScroll = from.Backpack.FindItemByType(typeof(BlankScroll)) as BlankScroll;

            if (bScroll != null)
            {
                if (m_SpellID > Loot.RegularScrollTypes.Length || m_SpellID < 0)
                {
                    return;
                }

                bScroll.Consume();
                m_MasterStatus = 2;
                from.SendMessage("You have made the initial copy of the Master Scroll!");
                from.PlaySound(0x249);
                Item item = Activator.CreateInstance(Loot.RegularScrollTypes[m_SpellID]) as Item;
                from.AddToBackpack(item);
            }
            else
            {
                from.SendMessage("You must have a blank scroll in your possession to use this.");
            }
        }
         protected override void OnTarget( Mobile from, object targeted ) 
         { 
            if ( m_LeatherShaper.Deleted ) 
               return; 
             
            if ( targeted is Item ) 
            { 
               Item m = targeted as Item; 
               if ( !m.IsChildOf (from.Backpack)) 
               { 
                  from.SendMessage( "The leather mus be in your pack!" ); 
               } 
               else if ( m is BaseHides || m is BaseLeather  ) 
               { 
                  double inscription = from.Skills[SkillName.Inscribe].Value;
                  double chance = ((inscription) / 100.0);
                  double reussite = Utility.RandomDouble();
                  
                  if ( chance >= reussite ) 
                  { 
                     BlankScroll cblankscroll = new BlankScroll(); 
                     cblankscroll.Amount = m.Amount;
		     cblankscroll.Hue = 738;
                     from.AddToBackpack( cblankscroll ); 
                     m.Delete(); 
                     from.PlaySound( 583 );
                      
                     --m_LeatherShaper.UsesRemaining; 
                     if ( m_LeatherShaper.UsesRemaining <= 0 ) 
                     { 
                        from.SendMessage( "Your pumise break in two parts." ); 
                        m_LeatherShaper.Delete(); 
                     } 
                  } 
                  else 
                  { 
                        if ( m.Amount >= 3 )
                             m.Amount = m.Amount - 2 ; 
                        else
                             m.Consume();
                                      
                        from.SendMessage( "You fail to create scroll and you loose some hide." ); 
                        --m_LeatherShaper.UsesRemaining; 
                        
                        if ( m_LeatherShaper.UsesRemaining <= 0 ) 
                        { 
                           from.SendMessage( "Your pumise break in two parts." ); 
                           m_LeatherShaper.Delete(); 
                        }

                     } 
               } 
               else 
               { 
                  from.SendMessage( "You cannot create scroll from that." ); 
               } 
            } 
         }