Thread: Thieves Cloak
View Single Post
Old 06-02-2004, 07:42 AM   #9 (permalink)
Zigler
Guest
 
Posts: n/a
Default

you dont set the fame to 0.. what you can do those is script it to take away say -100000 fame.. and add it back when you put the hood down.. thus it wont have to save the info.. shouldnt be hard for you to do.. if you have problems... ill do it for you.

***********************

Dled the script to look and see what i could do with it.. and heres a fix
anyone with over 10000 fame will be set to -100000 when they put the hood up..
anyone with -100000 fame will be set to 12000 when they put the hood down.. now I know this isnt exact and but it will work and give them a little buffer to die and keep there title.. anyone that doesnt have 10000+ karma or -100000 karma does not get altered.. heres the modified script...

Code:
using System; 
using Server.Items; 

namespace Server.Items 
{ 
   public class ThievesCloak : BaseArmor 
   {

		public override int InitMinHits{ get{ return 255; } }
		public override int InitMaxHits{ get{ return 255; } } 

      public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } 

                public override int ArtifactRarity{ get{ return 99; } } 

      [Constructable] 
      public ThievesCloak() : base( 0x2683 )
      {
         Weight = 5.0;
         Name = "Shroud";
      }

      public override void OnDoubleClick( Mobile m )
      {
         if( Parent != m )
         {
            m.SendMessage( "You must be wearing the robe to use it!" );
         }
         else
         {
            if ( ItemID == 0x2683 || ItemID == 0x2684 )
            {
               m.SendMessage( "You lower the hood." );
               m.PlaySound( 0x57 );
               ItemID = 0x1F03;
               m.NameMod = null;
               m.RemoveItem(this);
               m.EquipItem(this);
               if( m.Kills >= 5)
               {
               m.Criminal = true;
                }
                if( m.GuildTitle != null)
               {
                  m.DisplayGuildTitle = true;
                }
            }
            else if ( ItemID == 0x1F03 || ItemID == 0x1F04 )
            {
               m.SendMessage( "You pull the hood over your head." );
               m.PlaySound( 0x57 );
               ItemID = 0x2683;
               m.NameMod = "a shrouded figure";
               m.DisplayGuildTitle = false;
               m.Criminal = false;
               m.RemoveItem(this);
               m.EquipItem(this);
	    SkillBonuses.SetValues( 0, SkillName.Stealing, 20.0 );

	    if ( m.Fame >= 10000 )
         	     m.Fame = -50000;

            }
         }
      }

       public override bool OnEquip( Mobile from )
      {
         if ( ItemID == 0x2683 )
         {
         from.NameMod = "a shrouded figure";
         from.DisplayGuildTitle = false;
         from.Criminal = false;
         }
         return base.OnEquip(from);
      }

      public override void OnRemoved( Object o )
      {
      if( o is Mobile )
      {
          ((Mobile)o).NameMod = null;
      }
      if( o is Mobile && ((Mobile)o).Fame <= -20000 )
	    {
          ((Mobile)o).Fame = 12000;
               }
      if( o is Mobile && ((Mobile)o).Kills >= 5)
               {
               ((Mobile)o).Criminal = true;
                }
      if( o is Mobile && ((Mobile)o).GuildTitle != null )
               {
          ((Mobile)o).DisplayGuildTitle = true;
                }
      base.OnRemoved( o );
      }

      public ThievesCloak( Serial serial ) : base( serial )
      {

      }

      public override void Serialize( GenericWriter writer )
      {
         base.Serialize( writer );
         writer.Write( (int) 0 ); // version
      }

      public override void Deserialize( GenericReader reader )
      {
         base.Deserialize( reader );
         int version = reader.ReadInt();
      }

   }
}

hope that helps
  Reply With Quote