public BaseClothing( int itemID, Layer layer, int hue )
     : base(itemID)
 {
     Layer = layer;
     Hue = hue;
     m_Quality = ClothingQuality.Regular;
 }
Exemple #2
0
        public BaseClothing(int itemID, Layer layer, int hue) : base(itemID)
        {
            Layer = layer;
            Hue   = hue;

            m_Resource = DefaultResource;
            m_Quality  = ClothingQuality.Regular;

            m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
        }
Exemple #3
0
        public BaseClothing(int itemID, Layer layer, int hue)
            : base(itemID)
        {
            this.Layer = layer;
            this.Hue   = hue;

            this.m_Resource = this.DefaultResource;
            this.m_Quality  = ClothingQuality.Regular;

            this.m_HitPoints = this.m_MaxHitPoints = Utility.RandomMinMax(this.InitMinHits, this.InitMaxHits);
        }
Exemple #4
0
        public BaseClothing(int itemID, Layer layer, int hue) : base(itemID)
        {
            Layer     = layer;
            Hue       = hue;
            m_Quality = ClothingQuality.Regular;

            m_AosAttributes         = new AosAttributes(this);
            m_AosClothingAttributes = new AosArmorAttributes(this);
            m_AosSkillBonuses       = new AosSkillBonuses(this);
            m_AosResistances        = new AosElementAttributes(this);
        }
Exemple #5
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_Attributes = new AosAttributes(this, reader);
            }
            else
            {
                m_Attributes = new AosAttributes(this);
            }

            if (GetSaveFlag(flags, SaveFlag.LowerAmmoCost))
            {
                m_LowerAmmoCost = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.WeightReduction))
            {
                m_WeightReduction = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.DamageIncrease))
            {
                m_DamageIncrease = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                m_Crafter = reader.ReadMobile();
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                m_Quality = (ClothingQuality)reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.Capacity))
            {
                m_Capacity = reader.ReadInt();
            }

            if (ItemID != 0x2B02 && ItemID != 0x2B03)
            {
                ItemID = 0x2B02;
            }
            Layer  = Layer.Cloak;
            GumpID = 0x2648;
        }
        public BaseClothing( int itemID, Layer layer, int hue )
            : base(itemID)
        {
            Layer = layer;
            Hue = hue;
            m_Quality = ClothingQuality.Regular;

            m_AosAttributes = new AosAttributes( this );
            m_AosClothingAttributes = new AosArmorAttributes( this );
            m_AosSkillBonuses = new AosSkillBonuses( this );
            m_AosResistances = new AosElementAttributes( this );
        }
Exemple #7
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            #region Mondain's Legacy
            int version = reader.ReadInt();

            m_EngravedText = reader.ReadString();
            m_Quality      = (ClothingQuality)reader.ReadInt();
            m_Resource     = (CraftResource)reader.ReadInt();
            m_Crafter      = reader.ReadMobile();
            #endregion
        }
        public BaseClothing(int itemID, Layer layer, int hue) : base(itemID)
        {
            Layer = layer;
            Hue   = hue;

            m_Resource = DefaultResource;
            m_Quality  = ClothingQuality.Regular;

            m_AosAttributes         = new AosAttributes(this);
            m_AosClothingAttributes = new AosArmorAttributes(this);
            m_AosSkillBonuses       = new AosSkillBonuses(this);
            m_AosResistances        = new AosElementAttributes(this);

            m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
        }
Exemple #9
0
        public BaseClothing( int itemID, Layer layer, int hue )
            : base(itemID)
        {
            Layer = layer;
            Hue = hue;

            m_Resource = DefaultResource;
            m_Quality = ClothingQuality.Regular;

            m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

            m_AosAttributes = new AosAttributes( this );
            m_AosClothingAttributes = new AosArmorAttributes( this );
            m_AosSkillBonuses = new AosSkillBonuses( this );
            m_AosResistances = new AosElementAttributes( this );
        }
Exemple #10
0
        public BaseClothing(int itemID, Layer layer, int hue) : base(itemID)
        {
            Layer             = layer;
            Hue               = hue;
            m_Quality         = ClothingQuality.Regular;
            m_MagicType       = MagicEffect.None;
            m_MagicCharges    = 0;
            m_Identified      = true;
            m_IOBAlignment    = IOBAlignment.None;                      //Pigpen - Addition for IOB System
            m_InvisTimer      = null;
            m_StatEffectTimer = null;
            m_Dyable          = true;                                                   //Froste - Addition for dye control
            m_Scissorable     = true;                                                   // Adam - Addition for better Scissor control

            // erl: added for clothing wear
            m_HitPoints = m_MaxHitPoints = (short)Utility.RandomMinMax(InitMinHits, InitMaxHits);
        }
Exemple #11
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

            if (GetSaveFlag(flags, SaveFlag.LowerAmmoCost))
            {
                m_LowerAmmoCost = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.WeightReduction))
            {
                m_WeightReduction = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.DamageIncrease))
            {
                m_DamageIncrease = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                m_Crafter = reader.ReadMobile();
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                m_Quality = (ClothingQuality)reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.Capacity))
            {
                m_Capacity = reader.ReadInt();
            }
        }
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{                
                case 5:
				{
					SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                    if (GetSaveFlag(flags, SaveFlag.NotScissorable)) // Alan Mod
                        m_NotScissorable = true;

					if ( GetSaveFlag( flags, SaveFlag.Resource ) )
						m_Resource = (CraftResource)reader.ReadEncodedInt();
					else
						m_Resource = DefaultResource;

					if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
					    new AosAttributes( this, reader );
					//else
					//	m_AosAttributes = new AosAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.ClothingAttributes ) )
						new AosArmorAttributes( this, reader );
					//else
					//	m_AosClothingAttributes = new AosArmorAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
						new AosSkillBonuses( this, reader );
					//else
					//	m_AosSkillBonuses = new AosSkillBonuses( this );

					if ( GetSaveFlag( flags, SaveFlag.Resistances ) )
						new AosElementAttributes( this, reader );
					//else
						//m_AosResistances = new AosElementAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.MaxHitPoints ) )
						m_MaxHitPoints = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.HitPoints ) )
						m_HitPoints = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
						m_Crafter = reader.ReadMobile();

					if ( GetSaveFlag( flags, SaveFlag.Quality ) )
						m_Quality = (ClothingQuality)reader.ReadEncodedInt();
					else
						m_Quality = ClothingQuality.Regular;

					if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
						m_StrReq = reader.ReadEncodedInt();
					else
						m_StrReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
						m_PlayerConstructed = true;

					if ( GetSaveFlag( flags, SaveFlag.Identified ) )
						m_Identified = true;

					break;
				}
				case 4:
				{
					m_Resource = (CraftResource)reader.ReadInt();

					goto case 3;
				}
				case 3:
				{
					//m_AosAttributes = new AosAttributes( this, reader );
					//m_AosClothingAttributes = new AosArmorAttributes( this, reader );
					//m_AosSkillBonuses = new AosSkillBonuses( this, reader );
					//m_AosResistances = new AosElementAttributes( this, reader );

					goto case 2;
				}
				case 2:
				{
					m_PlayerConstructed = reader.ReadBool();
					goto case 1;
				}
				case 1:
				{
					m_Crafter = reader.ReadMobile();
					m_Quality = (ClothingQuality)reader.ReadInt();
					break;
				}
				case 0:
				{
					m_Crafter = null;
					m_Quality = ClothingQuality.Regular;
					break;
				}
			}

			if ( version < 2 )
				m_PlayerConstructed = true; // we don't know, so, assume it's crafted

			if ( version < 3 )
			{
				//m_AosAttributes = new AosAttributes( this );
				//m_AosClothingAttributes = new AosArmorAttributes( this );
				//m_AosSkillBonuses = new AosSkillBonuses( this );
				//m_AosResistances = new AosElementAttributes( this );
			}

			if ( version < 4 )
				m_Resource = DefaultResource;

			if ( m_MaxHitPoints == 0 && m_HitPoints == 0 )
				m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

			Mobile parent = Parent as Mobile;

			if ( parent != null )
			{
				AddStatBonuses( parent );
				parent.CheckStatTimers();
			}
		}
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

            if (GetSaveFlag(flags, SaveFlag.Attributes))
            {
                m_Attributes = new AosAttributes(this, reader);
            }
            else
            {
                m_Attributes = new AosAttributes(this);
            }

            if (GetSaveFlag(flags, SaveFlag.DamageModifier))
            {
                m_DamageModifier = new AosElementAttributes(this, reader);
            }
            else
            {
                m_DamageModifier = new AosElementAttributes(this);
            }

            if (GetSaveFlag(flags, SaveFlag.LowerAmmoCost))
            {
                m_LowerAmmoCost = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.WeightReduction))
            {
                m_WeightReduction = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.DamageIncrease))
            {
                m_DamageIncrease = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                m_Crafter = reader.ReadMobile();
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                m_Quality = (ClothingQuality)reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
            {
                m_PlayerConstructed = reader.ReadBool();
            }

            if (GetSaveFlag(flags, SaveFlag.Capacity))
            {
                m_Capacity = reader.ReadInt();
            }

            #region Mondain's Legacy Sets
            if (GetSaveFlag(flags, SaveFlag.SetAttributes))
            {
                m_SetAttributes = new AosAttributes(this, reader);
            }
            else
            {
                m_SetAttributes = new AosAttributes(this);
            }

            if (GetSaveFlag(flags, SaveFlag.SetSkillAttributes))
            {
                m_SetSkillBonuses = new AosSkillBonuses(this, reader);
            }
            else
            {
                m_SetSkillBonuses = new AosSkillBonuses(this);
            }

            if (GetSaveFlag(flags, SaveFlag.SetHue))
            {
                m_SetHue = reader.ReadInt();
            }

            if (GetSaveFlag(flags, SaveFlag.LastEquipped))
            {
                m_LastEquipped = reader.ReadBool();
            }

            if (GetSaveFlag(flags, SaveFlag.SetEquipped))
            {
                m_SetEquipped = reader.ReadBool();
            }
            #endregion

            if (version == 1)
            {
                Layer = Layer.Cloak;
            }
        }
Exemple #14
0
        public BaseClothing(int itemID, Layer layer, int hue)
            : base(itemID)
        {
            this.Layer = layer;
            this.Hue = hue;

            this.m_Resource = this.DefaultResource;
            this.m_Quality = ClothingQuality.Regular;

            this.m_HitPoints = this.m_MaxHitPoints = Utility.RandomMinMax(this.InitMinHits, this.InitMaxHits);

            this.m_AosAttributes = new AosAttributes(this);
            this.m_AosClothingAttributes = new AosArmorAttributes(this);
            this.m_AosSkillBonuses = new AosSkillBonuses(this);
            this.m_AosResistances = new AosElementAttributes(this);
            this.m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this);
            m_NegativeAttributes = new NegativeAttributes(this);

            #region Mondain's Legacy Sets
            this.m_SetAttributes = new AosAttributes(this);
            this.m_SetSkillBonuses = new AosSkillBonuses(this);
            #endregion
        }
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch (version)
			{
				case 8: //erl - added to handle packing out of PlayerConstructed property
				{
                	goto case 7;
				}
				case 7: //erl - added for clothing wear
				{
					m_HitPoints = reader.ReadShort();
					m_MaxHitPoints = reader.ReadShort();
					goto case 6;
				}
				case 6: //Adam - Addition for Scissorable attribute
				{
					m_Scissorable = reader.ReadBool();
					goto case 5;
				}
				case 5: //Adam - Addition for Dyable attribute
				{
					m_Dyable = reader.ReadBool();
					goto case 4;
				}
				case 4: //Pigpen - Addition for IOB System
				{
					m_IOBAlignment = (IOBAlignment)reader.ReadInt();
					goto case 3;
				}
				case 3:
				{
					m_MagicType = (MagicEffect)reader.ReadInt();
					m_MagicCharges = reader.ReadInt();
					m_Identified = reader.ReadBool();
                    goto case 2;
				}
				case 2:
				{
					// erl: this is the old PlayerConstructed flag, which will no longer
					// exist for anything over version 7... made obsolete by PlayerCrafted

					if( version < 8 )
						PlayerCrafted = reader.ReadBool();

					goto case 1;
				}
				case 1:
				{
					m_Crafter = reader.ReadMobile();
					m_Quality = (ClothingQuality)reader.ReadInt();
					break;
				}
				case 0:
				{
					m_Crafter = null;
					m_Quality = ClothingQuality.Regular;
					break;
				}
			}

			if (version < 5)				// Adam - addition for dye control
			{								// Allow for other non-dyable clothes outside the IOB system
				if (m_IOBAlignment != IOBAlignment.None)
					m_Dyable = false;
			}

			if (version < 7)
			{
			   // erl: this pre-dates hit point additions, so calculate values
			   // ..

			   // Check the quality of the piece. If it's exceptional or low, we want
			   // the piece's hitpoint to reflect this

				int iMax = InitMaxHits;
				int iMin = InitMinHits;

  			   if( Quality == ClothingQuality.Exceptional )
				{
				   // Add 50% to both

				   iMax = ( iMax * 3 ) / 2; // Fixed order of precedence bug
				   iMin = ( iMin * 3 ) / 2;
			    }
				else if(Quality == ClothingQuality.Low )
				{
				   // Lose 20% to both

				   iMax = ( iMax * 4) / 5; // Fixed order of precedence bug
				   iMin = ( iMin * 4) / 5;
			   }

        		m_HitPoints = m_MaxHitPoints = (short) Utility.RandomMinMax( iMin, iMax );

  			}

			// adam: To keep players from farming new characters for newbie clothes
			//	we are moving this valuable resource into the hands of crafters.
			if (version <= 7)
			{
				if( Quality == ClothingQuality.Exceptional && MagicCharges == 0 )
				{
					// make exceptional clothes newbied
					LootType = LootType.Newbied;
				}
				else if( MagicCharges > 0 )
				{
					// erl: explicitly change these pieces so they aren't newbied
					LootType = LootType.Regular;
				}
			}

		}
		public BaseClothing( int itemID, Layer layer, int hue ) : base( itemID )
		{
			Layer = layer;
			Hue = hue;

			m_Resource = DefaultResource;
			m_Quality = ClothingQuality.Regular;

			m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

			m_AosAttributes = new AosAttributes( this );
			m_AosClothingAttributes = new AosArmorAttributes( this );
			m_AosSkillBonuses = new AosSkillBonuses( this );
			m_AosResistances = new AosElementAttributes( this );
			
			// Genova: suporte ao UO:ML.
			#region Mondain's Legacy
			m_SetAttributes = new AosAttributes( this );
			m_SetClothingAttributes = new AosArmorAttributes( this );
			m_SetSkillBonuses = new AosSkillBonuses( this );
			
			m_LastEquipped = false;
			#endregion
		}
Exemple #17
0
		public BaseClothing( int itemID, Layer layer, int hue ) : base( itemID )
		{
			Layer = layer;
			Hue = hue;

			m_Resource = DefaultResource;
			m_Quality = ClothingQuality.Regular;

			m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

			m_AosAttributes = new AosAttributes( this );
			m_AosClothingAttributes = new AosArmorAttributes( this );
			m_AosSkillBonuses = new AosSkillBonuses( this );
			m_AosResistances = new AosElementAttributes( this );

			#region Mondain's Legacy Sets
			m_SetAttributes = new AosAttributes( this );
			m_SetSkillBonuses = new AosSkillBonuses( this );
			#endregion

			ItemValue = GearScore.GetItemValue( this );
		}
Exemple #18
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 5:
            {
                SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                if (GetSaveFlag(flags, SaveFlag.SpellEffect))
                {
                    m_Identified    = reader.ReadBool();
                    m_Effect        = (SpellEffect)reader.ReadEncodedInt();
                    m_EffectCharges = reader.ReadEncodedInt();
                }
                else
                {
                    m_Identified    = false;
                    m_Effect        = SpellEffect.None;
                    m_EffectCharges = 0;
                }

                if (GetSaveFlag(flags, SaveFlag.Resource))
                {
                    m_Resource = (CraftResource)reader.ReadEncodedInt();
                }
                else
                {
                    m_Resource = DefaultResource;
                }

                if (GetSaveFlag(flags, SaveFlag.Attributes))
                {
                    m_AosAttributes = new AosAttributes(this, reader);
                }
                else
                {
                    m_AosAttributes = new AosAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
                {
                    m_AosClothingAttributes = new AosArmorAttributes(this, reader);
                }
                else
                {
                    m_AosClothingAttributes = new AosArmorAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
                {
                    m_AosSkillBonuses = new AosSkillBonuses(this, reader);
                }
                else
                {
                    m_AosSkillBonuses = new AosSkillBonuses(this);
                }

                if (GetSaveFlag(flags, SaveFlag.Resistances))
                {
                    m_AosResistances = new AosElementAttributes(this, reader);
                }
                else
                {
                    m_AosResistances = new AosElementAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
                {
                    m_MaxHitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.HitPoints))
                {
                    m_HitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.Crafter))
                {
                    m_Crafter = reader.ReadMobile();
                }

                if (GetSaveFlag(flags, SaveFlag.Quality))
                {
                    m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                }
                else
                {
                    m_Quality = ClothingQuality.Regular;
                }

                if (GetSaveFlag(flags, SaveFlag.StrReq))
                {
                    m_StrReq = reader.ReadEncodedInt();
                }
                else
                {
                    m_StrReq = -1;
                }

                if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
                {
                    m_PlayerConstructed = true;
                }

                break;
            }

            case 4:
            {
                m_Resource = (CraftResource)reader.ReadInt();

                goto case 3;
            }

            case 3:
            {
                m_AosAttributes         = new AosAttributes(this, reader);
                m_AosClothingAttributes = new AosArmorAttributes(this, reader);
                m_AosSkillBonuses       = new AosSkillBonuses(this, reader);
                m_AosResistances        = new AosElementAttributes(this, reader);

                goto case 2;
            }

            case 2:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                m_Crafter = reader.ReadMobile();
                m_Quality = (ClothingQuality)reader.ReadInt();
                break;
            }

            case 0:
            {
                m_Crafter = null;
                m_Quality = ClothingQuality.Regular;
                break;
            }
            }

            if (version < 2)
            {
                m_PlayerConstructed = true;                 // we don't know, so, assume it's crafted
            }
            if (version < 3)
            {
                m_AosAttributes         = new AosAttributes(this);
                m_AosClothingAttributes = new AosArmorAttributes(this);
                m_AosSkillBonuses       = new AosSkillBonuses(this);
                m_AosResistances        = new AosElementAttributes(this);
            }

            if (version < 4)
            {
                m_Resource = DefaultResource;
            }

            if (m_MaxHitPoints == 0 && m_HitPoints == 0)
            {
                m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
            }

            Mobile parent = Parent as Mobile;

            if (parent != null)
            {
                if (Core.AOS)
                {
                    m_AosSkillBonuses.AddTo(parent);
                }

                AddStatBonuses(parent);
                parent.CheckStatTimers();

                if (m_Effect != SpellEffect.None && m_EffectCharges > 0 && SpellCastEffect.IsRepeatingEffect(m_Effect))
                {
                    m_Timer = new CheckTimer(this);
                    m_Timer.Start();
                }
            }
        }
Exemple #19
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 5:
				{
					SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.Resource ) )
						m_Resource = (CraftResource)reader.ReadEncodedInt();
					else
						m_Resource = DefaultResource;

					if ( GetSaveFlag( flags, SaveFlag.MaxHitPoints ) )
						m_MaxHitPoints = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.HitPoints ) )
						m_HitPoints = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.BaseArmor ) )
						m_ArmorBase = reader.ReadEncodedInt();
			
					if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
						m_Crafter = reader.ReadMobile();

					if ( GetSaveFlag( flags, SaveFlag.Quality ) )
						m_Quality = (ClothingQuality)reader.ReadEncodedInt();
					else
						m_Quality = ClothingQuality.Regular;

					if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
						m_StrReq = reader.ReadEncodedInt();
					else
						m_StrReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
						m_PlayerConstructed = true;

					break;
				}
				case 4:
				{
					m_Resource = (CraftResource)reader.ReadInt();

					goto case 3;
				}
				case 3:
				case 2:
				{
					m_PlayerConstructed = reader.ReadBool();
					goto case 1;
				}
				case 1:
				{
					m_Crafter = reader.ReadMobile();
					m_Quality = (ClothingQuality)reader.ReadInt();
					break;
				}
				case 0:
				{
					m_Crafter = null;
					m_Quality = ClothingQuality.Regular;
					break;
				}
			}

			if ( version < 2 )
				m_PlayerConstructed = true; // we don't know, so, assume it's crafted

			if ( version < 4 )
				m_Resource = DefaultResource;

			if ( m_MaxHitPoints == 0 && m_HitPoints == 0 )
				m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

			Mobile parent = Parent as Mobile;

			if ( parent != null )
			{
				AddStatBonuses( parent );
				parent.CheckStatTimers();
			}
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			
			#region Mondain's Legacy
			int version = reader.ReadInt();

			m_EngravedText = reader.ReadString();
			m_Quality = (ClothingQuality) reader.ReadInt();
			m_Resource = (CraftResource) reader.ReadInt();
			m_Crafter = reader.ReadMobile();			
			#endregion
		}
Exemple #21
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 3:
            {
                m_AosAttributes = new AosAttributes(this, reader);
                if (m_AosAttributes.IsEmpty)
                {
                    m_AosAttributes = null;
                }

                m_AosClothingAttributes = new AosArmorAttributes(this, reader);
                if (m_AosClothingAttributes.IsEmpty)
                {
                    m_AosClothingAttributes = null;
                }

                m_AosSkillBonuses = new AosSkillBonuses(this, reader);
                if (m_AosSkillBonuses.IsEmpty)
                {
                    m_AosSkillBonuses = null;
                }

                m_AosResistances = new AosElementAttributes(this, reader);
                if (m_AosResistances.IsEmpty)
                {
                    m_AosResistances = null;
                }

                goto case 2;
            }

            case 2:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                m_Crafter = reader.ReadMobile();
                m_Quality = (ClothingQuality)reader.ReadInt();
                break;
            }

            case 0:
            {
                m_Crafter = null;
                m_Quality = ClothingQuality.Regular;
                break;
            }
            }

            if (version < 2)
            {
                m_PlayerConstructed = true;                 // we don't know, so, assume it's crafted
            }
            Mobile parent = Parent as Mobile;

            if (parent != null)
            {
                if (Core.AOS && m_AosSkillBonuses != null)
                {
                    m_AosSkillBonuses.AddTo(parent);
                }

                AddStatBonuses(parent);
                parent.CheckStatTimers();
            }
        }
Exemple #22
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 5:
                {
                    SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                    if (GetSaveFlag(flags, SaveFlag.SpellEffect))
                    {
                        m_Identified = reader.ReadBool();
                        m_Effect = (SpellEffect)reader.ReadEncodedInt();
                        m_EffectCharges = reader.ReadEncodedInt();
                    }
                    else
                    {
                        m_Identified = false;
                        m_Effect = SpellEffect.None;
                        m_EffectCharges = 0;
                    }

                    if ( GetSaveFlag( flags, SaveFlag.Resource ) )
                        m_Resource = (CraftResource)reader.ReadEncodedInt();
                    else
                        m_Resource = DefaultResource;

                    if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
                        m_AosAttributes = new AosAttributes( this, reader );
                    else
                        m_AosAttributes = new AosAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.ClothingAttributes ) )
                        m_AosClothingAttributes = new AosArmorAttributes( this, reader );
                    else
                        m_AosClothingAttributes = new AosArmorAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
                        m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                    else
                        m_AosSkillBonuses = new AosSkillBonuses( this );

                    if ( GetSaveFlag( flags, SaveFlag.Resistances ) )
                        m_AosResistances = new AosElementAttributes( this, reader );
                    else
                        m_AosResistances = new AosElementAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.MaxHitPoints ) )
                        m_MaxHitPoints = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.HitPoints ) )
                        m_HitPoints = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
                        m_Crafter = reader.ReadMobile();

                    if ( GetSaveFlag( flags, SaveFlag.Quality ) )
                        m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                    else
                        m_Quality = ClothingQuality.Regular;

                    if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
                        m_StrReq = reader.ReadEncodedInt();
                    else
                        m_StrReq = -1;

                    if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
                        m_PlayerConstructed = true;

                    break;
                }
                case 4:
                {
                    m_Resource = (CraftResource)reader.ReadInt();

                    goto case 3;
                }
                case 3:
                {
                    m_AosAttributes = new AosAttributes( this, reader );
                    m_AosClothingAttributes = new AosArmorAttributes( this, reader );
                    m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                    m_AosResistances = new AosElementAttributes( this, reader );

                    goto case 2;
                }
                case 2:
                {
                    m_PlayerConstructed = reader.ReadBool();
                    goto case 1;
                }
                case 1:
                {
                    m_Crafter = reader.ReadMobile();
                    m_Quality = (ClothingQuality)reader.ReadInt();
                    break;
                }
                case 0:
                {
                    m_Crafter = null;
                    m_Quality = ClothingQuality.Regular;
                    break;
                }
            }

            if ( version < 2 )
                m_PlayerConstructed = true; // we don't know, so, assume it's crafted

            if ( version < 3 )
            {
                m_AosAttributes = new AosAttributes( this );
                m_AosClothingAttributes = new AosArmorAttributes( this );
                m_AosSkillBonuses = new AosSkillBonuses( this );
                m_AosResistances = new AosElementAttributes( this );
            }

            if ( version < 4 )
                m_Resource = DefaultResource;

            if ( m_MaxHitPoints == 0 && m_HitPoints == 0 )
                m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

            Mobile parent = Parent as Mobile;

            if ( parent != null )
            {
                if ( Core.AOS )
                    m_AosSkillBonuses.AddTo( parent );

                AddStatBonuses( parent );
                parent.CheckStatTimers();

                if (m_Effect != SpellEffect.None && m_EffectCharges > 0 && SpellCastEffect.IsRepeatingEffect(m_Effect))
                {
                    m_Timer = new CheckTimer(this);
                    m_Timer.Start();
                }
            }
        }
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            int m_PhysicalBonus = 0;
            int m_FireBonus = 0;
            int m_ColdBonus = 0;
            int m_PoisonBonus = 0;
            int m_EnergyBonus = 0;

            switch ( version )
            {
                case 14:
                case 13:
                {
                    m_CustomPropName = reader.ReadString();
                     goto case 12;
                }
                case 12:
                {
                    SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Resource ) )
                        m_Resource = (CraftResource)reader.ReadEncodedInt();
                    else
                        m_Resource = DefaultResource;

                    if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
                        m_AosAttributes = new AosAttributes( this, reader );
                    else
                        m_AosAttributes = new AosAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.ClothingAttributes ) )
                        m_AosClothingAttributes = new AosArmorAttributes( this, reader );
                    else
                        m_AosClothingAttributes = new AosArmorAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
                        m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                    else
                        m_AosSkillBonuses = new AosSkillBonuses( this );

                    if ( GetSaveFlag( flags, SaveFlag.Resistances ) )
                        m_AosResistances = new AosElementAttributes( this, reader );
                    else
                        m_AosResistances = new AosElementAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.MaxHitPoints ) )
                        m_MaxHitPoints = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.HitPoints ) )
                        m_HitPoints = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
                        m_Crafter = reader.ReadMobile();

                    if ( GetSaveFlag( flags, SaveFlag.Quality ) )
                        m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                    else
                        m_Quality = ClothingQuality.Regular;

                    if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
                        m_StrReq = reader.ReadEncodedInt();
                    else
                        m_StrReq = -1;

                    if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
                        m_PlayerConstructed = true;

                    if ( GetSaveFlag( flags, SaveFlag.Identified ) )
                        m_Identified = true;

                    break;
                }
                case 11:
                {
                    m_Resource = (CraftResource)reader.ReadInt();

                    goto case 10;
                }
                case 10:
                case 9:
                    m_CustomPropName = reader.ReadString();
                    goto case 8;
                case 8: // Fixed durability
                case 7:
                case 6:
                {
                    int m_ArmorBase = reader.ReadInt();
                    goto case 5;
                }
                case 5:
                {
                    int m_OldMaxHitPoints = reader.ReadInt();
                    int m_OldHitPoints = reader.ReadInt();
                    goto case 4;
                }
                case 4:
                {
                    m_PhysicalBonus = reader.ReadInt();
                    m_FireBonus = reader.ReadInt();
                    m_ColdBonus = reader.ReadInt();
                    m_PoisonBonus = reader.ReadInt();
                    m_EnergyBonus = reader.ReadInt();
                    goto case 3;
                }
                case 3:
                {
                    m_AosAttributes = new AosAttributes( this, reader );
                    m_AosClothingAttributes = new AosArmorAttributes( this, reader );
                    m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                    m_AosResistances = new AosElementAttributes( this, reader );

                    goto case 2;
                }
                case 2:
                {
                    m_PlayerConstructed = reader.ReadBool();
                    goto case 1;
                }
                case 1:
                {
                    m_Crafter = reader.ReadMobile();
                    m_Quality = (ClothingQuality)reader.ReadInt();
                    break;
                }
                case 0:
                {
                    m_Crafter = null;
                    m_Quality = ClothingQuality.Regular;
                    break;
                }
            }

            if ( version < 2 )
                m_PlayerConstructed = true; // we don't know, so, assume it's crafted

            if ( version < 3 )
            {
                m_AosAttributes = new AosAttributes( this );
                m_AosClothingAttributes = new AosArmorAttributes( this );
                m_AosSkillBonuses = new AosSkillBonuses( this );
                m_AosResistances = new AosElementAttributes( this );
            }

            if ( version < 4 )
                m_Resource = DefaultResource;

            if ( m_MaxHitPoints == 0 && m_HitPoints == 0 )
                m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

            Mobile parent = Parent as Mobile;

            if ( parent != null )
            {
                if ( Core.AOS )
                    m_AosSkillBonuses.AddTo( parent );

                AddStatBonuses( parent );
                parent.CheckStatTimers();
            }

            // ***
            if (version < 12)
            {
                 m_AosResistances.Physical = m_PhysicalBonus;
                 m_AosResistances.Fire = m_FireBonus;
                 m_AosResistances.Cold = m_ColdBonus;
                 m_AosResistances.Poison = m_PoisonBonus;
                 m_AosResistances.Energy = m_EnergyBonus;
            }
            // ***

            if ( version < 14 )
                Dyable = true;
        }
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 3:
                {
                    m_AosAttributes = new AosAttributes( this, reader );
                    if (m_AosAttributes.IsEmpty)
                        m_AosAttributes = null;

                    m_AosClothingAttributes = new AosArmorAttributes( this, reader );
                    if (m_AosClothingAttributes.IsEmpty)
                        m_AosClothingAttributes = null;

                    m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                    if (m_AosSkillBonuses.IsEmpty)
                        m_AosSkillBonuses = null;

                    m_AosResistances = new AosElementAttributes( this, reader );
                    if (m_AosResistances.IsEmpty)
                        m_AosResistances = null;

                    goto case 2;
                }
                case 2:
                {
                    m_PlayerConstructed = reader.ReadBool();
                    goto case 1;
                }
                case 1:
                {
                    m_Crafter = reader.ReadMobile();
                    m_Quality = (ClothingQuality)reader.ReadInt();
                    break;
                }
                case 0:
                {
                    m_Crafter = null;
                    m_Quality = ClothingQuality.Regular;
                    break;
                }
            }

            if ( version < 2 )
                m_PlayerConstructed = true; // we don't know, so, assume it's crafted

            Mobile parent = Parent as Mobile;

            if ( parent != null )
            {
                if (Core.AOS && m_AosSkillBonuses != null)
                    m_AosSkillBonuses.AddTo( parent );

                AddStatBonuses( parent );
                parent.CheckStatTimers();
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

            if (GetSaveFlag(flags, SaveFlag.Attributes))
                this.m_Attributes = new AosAttributes(this, reader);
            else
                this.m_Attributes = new AosAttributes(this);

            if (GetSaveFlag(flags, SaveFlag.LowerAmmoCost))
                this.m_LowerAmmoCost = reader.ReadInt();

            if (GetSaveFlag(flags, SaveFlag.WeightReduction))
                this.m_WeightReduction = reader.ReadInt();

            if (GetSaveFlag(flags, SaveFlag.DamageIncrease))
                this.m_DamageIncrease = reader.ReadInt();

            if (GetSaveFlag(flags, SaveFlag.Crafter))
                this.m_Crafter = reader.ReadMobile();

            if (GetSaveFlag(flags, SaveFlag.Quality))
                this.m_Quality = (ClothingQuality)reader.ReadInt();

            if (GetSaveFlag(flags, SaveFlag.Capacity))
                this.m_Capacity = reader.ReadInt();

            #region Mondain's Legacy Sets
            if (GetSaveFlag(flags, SaveFlag.SetAttributes))
                this.m_SetAttributes = new AosAttributes(this, reader);
            else
                this.m_SetAttributes = new AosAttributes(this);

            if (GetSaveFlag(flags, SaveFlag.SetSkillAttributes))
                this.m_SetSkillBonuses = new AosSkillBonuses(this, reader);
            else
                this.m_SetSkillBonuses = new AosSkillBonuses(this);

            if (GetSaveFlag(flags, SaveFlag.SetHue))
                this.m_SetHue = reader.ReadInt();

            if (GetSaveFlag(flags, SaveFlag.LastEquipped))
                this.m_LastEquipped = reader.ReadBool();

            if (GetSaveFlag(flags, SaveFlag.SetEquipped))
                this.m_SetEquipped = reader.ReadBool();
            #endregion
        }
Exemple #26
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			SaveFlag flags = (SaveFlag) reader.ReadEncodedInt();

			if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
				m_Attributes = new AosAttributes( this, reader );
			else
				m_Attributes = new AosAttributes( this );

			if ( GetSaveFlag( flags, SaveFlag.LowerAmmoCost ) )
				m_LowerAmmoCost = reader.ReadInt();

			if ( GetSaveFlag( flags, SaveFlag.WeightReduction ) )
				m_WeightReduction = reader.ReadInt();

			if ( GetSaveFlag( flags, SaveFlag.DamageIncrease ) )
				m_DamageIncrease = reader.ReadInt();

			if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
				m_Crafter = reader.ReadMobile();

			if ( GetSaveFlag( flags, SaveFlag.Quality ) )
				m_Quality = (ClothingQuality) reader.ReadInt();

			if ( GetSaveFlag( flags, SaveFlag.Capacity ) )
				m_Capacity = reader.ReadInt();
		}
Exemple #27
0
 public BaseClothing(int itemID, Layer layer, int hue) : base(itemID)
 {
     Layer     = layer;
     Hue       = hue;
     m_Quality = ClothingQuality.Regular;
 }
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 3:
				{
					m_AosAttributes = new AosAttributes( this, reader );
					m_AosClothingAttributes = new AosArmorAttributes( this, reader );
					m_AosSkillBonuses = new AosSkillBonuses( this, reader );
					m_AosResistances = new AosElementAttributes( this, reader );

					goto case 2;
				}
				case 2:
				{
					m_PlayerConstructed = reader.ReadBool();
					goto case 1;
				}
				case 1:
				{
					m_Crafter = reader.ReadMobile();
					m_Quality = (ClothingQuality)reader.ReadInt();
					break;
				}
				case 0:
				{
					m_Crafter = null;
					m_Quality = ClothingQuality.Regular;
					break;
				}
			}

			if ( version < 2 )
				m_PlayerConstructed = true; // we don't know, so, assume it's crafted

			if ( version < 3 )
			{
				m_AosAttributes = new AosAttributes( this );
				m_AosClothingAttributes = new AosArmorAttributes( this );
				m_AosSkillBonuses = new AosSkillBonuses( this );
				m_AosResistances = new AosElementAttributes( this );
			}

			Mobile parent = Parent as Mobile;

			if ( parent != null )
			{
				if ( Core.AOS )
					m_AosSkillBonuses.AddTo( parent );

				AddStatBonuses( parent );
				parent.CheckStatTimers();
			}

			//Remove (layered) tags in name
			if ((Layer == Layer.Earrings || Layer == Layer.Neck) && Name != null && ms_RegexLayeredTag.IsMatch(Name))
			{
				Match m = ms_RegexLayeredTag.Match(Name);
				Name = m.Groups["taglessname"].Value.Trim();
			}

//			if ( IsBugged( this ) )
//				World.buggeditems.Add( this );
		}
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 12: m_OldCloth = reader.ReadBool(); goto case 11;
                case 11: m_Disease = (Disease)reader.ReadInt(); goto case 10;
                case 10: goto case 9;
                case 9:	goto case 8;
                case 8:	goto case 7;
                case 7:	goto case 6;
                case 6:
                {
                    m_CraftersOriginalName = reader.ReadString();
                    goto case 5;
                }
                case 5:
                {
                    SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Resource ) )
                        m_Resource = (CraftResource)reader.ReadEncodedInt();
                    else
                        m_Resource = DefaultResource;

                    if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
                        m_AosAttributes = new AosAttributes( this, reader );
                    else
                        m_AosAttributes = new AosAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.ClothingAttributes ) )
                        m_AosClothingAttributes = new AosArmorAttributes( this, reader );
                    else
                        m_AosClothingAttributes = new AosArmorAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
                        m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                    else
                        m_AosSkillBonuses = new AosSkillBonuses( this );

                    if ( GetSaveFlag( flags, SaveFlag.Resistances ) )
                        m_AosResistances = new AosElementAttributes( this, reader );
                    else
                        m_AosResistances = new AosElementAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.MaxHitPoints ) )
                        m_MaxHitPoints = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.HitPoints ) )
                        m_HitPoints = reader.ReadEncodedInt();

                    if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
                        m_Crafter = reader.ReadMobile();

                    if ( GetSaveFlag( flags, SaveFlag.Quality ) )
                        m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                    else
                        m_Quality = ClothingQuality.Regular;

                    if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
                        m_StrReq = reader.ReadEncodedInt();
                    else
                        m_StrReq = -1;

                    if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
                        m_PlayerConstructed = true;

                    break;
                }
                case 4:
                {
                    m_Resource = (CraftResource)reader.ReadInt();

                    goto case 3;
                }
                case 3:
                {
                    m_AosAttributes = new AosAttributes( this, reader );
                    m_AosClothingAttributes = new AosArmorAttributes( this, reader );
                    m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                    m_AosResistances = new AosElementAttributes( this, reader );

                    goto case 2;
                }
                case 2:
                {
                    m_PlayerConstructed = reader.ReadBool();
                    goto case 1;
                }
                case 1:
                {
                    m_Crafter = reader.ReadMobile();
                    m_Quality = (ClothingQuality)reader.ReadInt();
                    break;
                }
                case 0:
                {
                    m_Crafter = null;
                    m_Quality = ClothingQuality.Regular;
                    break;
                }
            }

            if ( version < 2 )
                m_PlayerConstructed = true; // we don't know, so, assume it's crafted

            if ( version < 3 )
            {
                m_AosAttributes = new AosAttributes( this );
                m_AosClothingAttributes = new AosArmorAttributes( this );
                m_AosSkillBonuses = new AosSkillBonuses( this );
                m_AosResistances = new AosElementAttributes( this );
            }

            if ( version < 4 )
                m_Resource = DefaultResource;

            if ( m_MaxHitPoints == 0 && m_HitPoints == 0 )
                m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

            Mobile parent = Parent as Mobile;

            if ( parent != null )
            {
                if ( Core.AOS )
                    m_AosSkillBonuses.AddTo( parent );

                AddStatBonuses( parent );
                parent.CheckStatTimers();
            }

            if( version < 7 && this.Hue == 2992 )
                this.Hue = 2990;

            if( version < 8 && Quality == ClothingQuality.Masterwork )
            {
                this.Resistances.Blunt += 1;
                this.Resistances.Slashing += 1;
                this.Resistances.Piercing += 1;
            }

            if( version < 9 && this.Crafter != null )
            {
                this.CraftersOriginalName = this.Crafter.Name;
            }

            if( version < 10 )
            {
                Resistances.Fire = 0;
                Resistances.Cold = 0;
            }
        }
Exemple #30
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 8:
            {
                goto case 7;
            }

            case 7:
            {
                this.m_BlessedBy = reader.ReadMobile();

                goto case 5;
            }

            case 5:
            {
                SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                if (GetSaveFlag(flags, SaveFlag.Resource))
                {
                    this.m_Resource = (CraftResource)reader.ReadEncodedInt();
                }
                else
                {
                    this.m_Resource = this.DefaultResource;
                }

                if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
                {
                    this.m_MaxHitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.HitPoints))
                {
                    this.m_HitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.Crafter))
                {
                    this.m_Crafter = reader.ReadMobile();
                }

                if (GetSaveFlag(flags, SaveFlag.Quality))
                {
                    this.m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                }
                else
                {
                    this.m_Quality = ClothingQuality.Regular;
                }

                if (GetSaveFlag(flags, SaveFlag.StrReq))
                {
                    this.m_StrReq = reader.ReadEncodedInt();
                }
                else
                {
                    this.m_StrReq = -1;
                }

                if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
                {
                    this.m_PlayerConstructed = true;
                }

                break;
            }

            case 4:
            {
                this.m_Resource = (CraftResource)reader.ReadInt();

                goto case 3;
            }

            case 3:
            {
                goto case 2;
            }

            case 2:
            {
                this.m_PlayerConstructed = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                this.m_Crafter = reader.ReadMobile();
                this.m_Quality = (ClothingQuality)reader.ReadInt();
                break;
            }

            case 0:
            {
                this.m_Crafter = null;
                this.m_Quality = ClothingQuality.Regular;
                break;
            }
            }

            if (version < 2)
            {
                this.m_PlayerConstructed = true; // we don't know, so, assume it's crafted
            }
            if (version < 4)
            {
                this.m_Resource = this.DefaultResource;
            }

            if (this.m_MaxHitPoints == 0 && this.m_HitPoints == 0)
            {
                this.m_HitPoints = this.m_MaxHitPoints = Utility.RandomMinMax(this.InitMinHits, this.InitMaxHits);
            }
        }
Exemple #31
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 8:                     //erl - added to handle packing out of PlayerConstructed property
            {
                goto case 7;
            }

            case 7:                     //erl - added for clothing wear
            {
                m_HitPoints    = reader.ReadShort();
                m_MaxHitPoints = reader.ReadShort();
                goto case 6;
            }

            case 6:                     //Adam - Addition for Scissorable attribute
            {
                m_Scissorable = reader.ReadBool();
                goto case 5;
            }

            case 5:                     //Adam - Addition for Dyable attribute
            {
                m_Dyable = reader.ReadBool();
                goto case 4;
            }

            case 4:                     //Pigpen - Addition for IOB System
            {
                m_IOBAlignment = (IOBAlignment)reader.ReadInt();
                goto case 3;
            }

            case 3:
            {
                m_MagicType    = (MagicEffect)reader.ReadInt();
                m_MagicCharges = reader.ReadInt();
                m_Identified   = reader.ReadBool();
                goto case 2;
            }

            case 2:
            {
                // erl: this is the old PlayerConstructed flag, which will no longer
                // exist for anything over version 7... made obsolete by PlayerCrafted

                if (version < 8)
                {
                    PlayerCrafted = reader.ReadBool();
                }

                goto case 1;
            }

            case 1:
            {
                m_Crafter = reader.ReadMobile();
                m_Quality = (ClothingQuality)reader.ReadInt();
                break;
            }

            case 0:
            {
                m_Crafter = null;
                m_Quality = ClothingQuality.Regular;
                break;
            }
            }

            if (version < 5)                                            // Adam - addition for dye control
            {                                                           // Allow for other non-dyable clothes outside the IOB system
                if (m_IOBAlignment != IOBAlignment.None)
                {
                    m_Dyable = false;
                }
            }

            if (version < 7)
            {
                // erl: this pre-dates hit point additions, so calculate values
                // ..

                // Check the quality of the piece. If it's exceptional or low, we want
                // the piece's hitpoint to reflect this

                int iMax = InitMaxHits;
                int iMin = InitMinHits;

                if (Quality == ClothingQuality.Exceptional)
                {
                    // Add 50% to both

                    iMax = (iMax * 3) / 2;                  // Fixed order of precedence bug
                    iMin = (iMin * 3) / 2;
                }
                else if (Quality == ClothingQuality.Low)
                {
                    // Lose 20% to both

                    iMax = (iMax * 4) / 5;                 // Fixed order of precedence bug
                    iMin = (iMin * 4) / 5;
                }

                m_HitPoints = m_MaxHitPoints = (short)Utility.RandomMinMax(iMin, iMax);
            }

            // adam: To keep players from farming new characters for newbie clothes
            //	we are moving this valuable resource into the hands of crafters.
            if (version <= 7)
            {
                if (Quality == ClothingQuality.Exceptional && MagicCharges == 0)
                {
                    // make exceptional clothes newbied
                    LootType = LootType.Newbied;
                }
                else if (MagicCharges > 0)
                {
                    // erl: explicitly change these pieces so they aren't newbied
                    LootType = LootType.Regular;
                }
            }
        }
Exemple #32
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			
			SaveFlag flags = (SaveFlag) reader.ReadEncodedInt();
			
			if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
				m_Attributes = new AosAttributes( this, reader );
			else
				m_Attributes = new AosAttributes( this );
				
			if ( GetSaveFlag( flags, SaveFlag.DamageModifier ) )
				m_DamageModifier = new AosElementAttributes( this, reader );
			else
				m_DamageModifier = new AosElementAttributes( this );
				
			if ( GetSaveFlag( flags, SaveFlag.LowerAmmoCost ) )
				m_LowerAmmoCost = reader.ReadInt();
				
			if ( GetSaveFlag( flags, SaveFlag.WeightReduction ) )
				m_WeightReduction = reader.ReadInt();
				
			if ( GetSaveFlag( flags, SaveFlag.DamageIncrease ) )
				m_DamageIncrease = reader.ReadInt();
				
			if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
				m_Crafter = reader.ReadMobile();
				
			if ( GetSaveFlag( flags, SaveFlag.Quality ) )
				m_Quality = (ClothingQuality) reader.ReadInt();
				
			if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
				m_PlayerConstructed = reader.ReadBool();
				
			if ( GetSaveFlag( flags, SaveFlag.Capacity ) )
				m_Capacity = reader.ReadInt();
							
			#region Set Armor		
			if ( m_SetSkillBonuses == null )
				m_SetSkillBonuses = new AosSkillBonuses( this );
				
			if ( GetSaveFlag( flags, SaveFlag.SetAttributes ) )
				m_SetAttributes = new AosAttributes( this, reader );
			else
				m_SetAttributes = new AosAttributes( this );
				
			if ( GetSaveFlag( flags, SaveFlag.SetHue ) )
				m_SetHue = reader.ReadInt();
				
			if ( GetSaveFlag( flags, SaveFlag.LastEquipped ) )
				m_LastEquipped = reader.ReadBool();
									
			if ( GetSaveFlag( flags, SaveFlag.SetEquipped ) )
				m_SetEquipped = reader.ReadBool();
			#endregion
			
			if ( version == 1 )
				Layer = Layer.Cloak;
		}
Exemple #33
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 5:
            {
                SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                if (GetSaveFlag(flags, SaveFlag.NotScissorable))     // Alan Mod
                {
                    m_NotScissorable = true;
                }

                if (GetSaveFlag(flags, SaveFlag.Resource))
                {
                    m_Resource = (CraftResource)reader.ReadEncodedInt();
                }
                else
                {
                    m_Resource = DefaultResource;
                }

                if (GetSaveFlag(flags, SaveFlag.Attributes))
                {
                    new AosAttributes(this, reader);
                }
                //else
                //	m_AosAttributes = new AosAttributes( this );

                if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
                {
                    new AosArmorAttributes(this, reader);
                }
                //else
                //	m_AosClothingAttributes = new AosArmorAttributes( this );

                if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
                {
                    new AosSkillBonuses(this, reader);
                }
                //else
                //	m_AosSkillBonuses = new AosSkillBonuses( this );

                if (GetSaveFlag(flags, SaveFlag.Resistances))
                {
                    new AosElementAttributes(this, reader);
                }
                //else
                //m_AosResistances = new AosElementAttributes( this );

                if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
                {
                    m_MaxHitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.HitPoints))
                {
                    m_HitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.Crafter))
                {
                    m_Crafter = reader.ReadMobile();
                }

                if (GetSaveFlag(flags, SaveFlag.Quality))
                {
                    m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                }
                else
                {
                    m_Quality = ClothingQuality.Regular;
                }

                if (GetSaveFlag(flags, SaveFlag.StrReq))
                {
                    m_StrReq = reader.ReadEncodedInt();
                }
                else
                {
                    m_StrReq = -1;
                }

                if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
                {
                    m_PlayerConstructed = true;
                }

                if (GetSaveFlag(flags, SaveFlag.Identified))
                {
                    m_Identified = true;
                }

                break;
            }

            case 4:
            {
                m_Resource = (CraftResource)reader.ReadInt();

                goto case 3;
            }

            case 3:
            {
                //m_AosAttributes = new AosAttributes( this, reader );
                //m_AosClothingAttributes = new AosArmorAttributes( this, reader );
                //m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                //m_AosResistances = new AosElementAttributes( this, reader );

                goto case 2;
            }

            case 2:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                m_Crafter = reader.ReadMobile();
                m_Quality = (ClothingQuality)reader.ReadInt();
                break;
            }

            case 0:
            {
                m_Crafter = null;
                m_Quality = ClothingQuality.Regular;
                break;
            }
            }

            if (version < 2)
            {
                m_PlayerConstructed = true;                 // we don't know, so, assume it's crafted
            }
            if (version < 3)
            {
                //m_AosAttributes = new AosAttributes( this );
                //m_AosClothingAttributes = new AosArmorAttributes( this );
                //m_AosSkillBonuses = new AosSkillBonuses( this );
                //m_AosResistances = new AosElementAttributes( this );
            }

            if (version < 4)
            {
                m_Resource = DefaultResource;
            }

            if (m_MaxHitPoints == 0 && m_HitPoints == 0)
            {
                m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
            }

            Mobile parent = Parent as Mobile;

            if (parent != null)
            {
                AddStatBonuses(parent);
                parent.CheckStatTimers();
            }
        }
Exemple #34
0
		public BaseClothing( int itemID, Layer layer, int hue ) : base( itemID )
		{
			Layer = layer;
			Hue = hue;

			m_Resource = DefaultResource;
			m_Quality = ClothingQuality.Regular;

			m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );
		}
Exemple #35
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_BaseLayer = (Layer)reader.ReadInt();

            SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

            if (GetSaveFlag(flags, SaveFlag.Resource))
            {
                m_Resource = (CraftResource)reader.ReadEncodedInt();
            }
            else
            {
                m_Resource = DefaultResource;
            }

            if (GetSaveFlag(flags, SaveFlag.MaxDurability))
            {
                m_MaxDurability = reader.ReadEncodedInt();
            }

            if (GetSaveFlag(flags, SaveFlag.Durability))
            {
                m_Durability = reader.ReadEncodedInt();
            }

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                m_Crafter = reader.ReadMobile();
            }

            if (GetSaveFlag(flags, SaveFlag.CrafterName))
            {
                m_CrafterName = reader.ReadString();
            }

            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                m_Quality = (ClothingQuality)reader.ReadEncodedInt();
            }
            else
            {
                m_Quality = ClothingQuality.Regular;
            }

            if (GetSaveFlag(flags, SaveFlag.StrReq))
            {
                m_StrReq = reader.ReadEncodedInt();
            }
            else
            {
                m_StrReq = -1;
            }

            if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
            {
                m_PlayerConstructed = true;
            }

            if (m_MaxDurability == 0 && m_Durability == 0)
            {
                m_Durability = m_MaxDurability = Utility.RandomMinMax(InitMinHits, InitMaxHits);
            }

            Mobile parent = Parent as Mobile;

            if (parent != null)
            {
                parent.CheckStatTimers();
            }
        }
Exemple #36
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_AosSkillBonuses = new AosSkillBonuses(this, reader);
                m_Resistances     = new AosElementAttributes(this, reader);
                goto case 0;
            }

            case 0:
            {
                if (version == 0)
                {
                    m_AosSkillBonuses = new AosSkillBonuses(this);
                    m_Resistances     = new AosElementAttributes(this);
                }

                SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                if (GetSaveFlag(flags, SaveFlag.Attributes))
                {
                    this.m_Attributes = new AosAttributes(this, reader);
                }
                else
                {
                    this.m_Attributes = new AosAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.LowerAmmoCost))
                {
                    this.m_LowerAmmoCost = reader.ReadInt();
                }

                if (GetSaveFlag(flags, SaveFlag.WeightReduction))
                {
                    this.m_WeightReduction = reader.ReadInt();
                }

                if (GetSaveFlag(flags, SaveFlag.DamageIncrease))
                {
                    this.m_DamageIncrease = reader.ReadInt();
                }

                if (GetSaveFlag(flags, SaveFlag.Crafter))
                {
                    this.m_Crafter = reader.ReadMobile();
                }

                if (GetSaveFlag(flags, SaveFlag.Quality))
                {
                    this.m_Quality = (ClothingQuality)reader.ReadInt();
                }

                if (GetSaveFlag(flags, SaveFlag.Capacity))
                {
                    this.m_Capacity = reader.ReadInt();
                }

                #region Mondain's Legacy Sets
                if (GetSaveFlag(flags, SaveFlag.SetAttributes))
                {
                    this.m_SetAttributes = new AosAttributes(this, reader);
                }
                else
                {
                    this.m_SetAttributes = new AosAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.SetSkillAttributes))
                {
                    this.m_SetSkillBonuses = new AosSkillBonuses(this, reader);
                }
                else
                {
                    this.m_SetSkillBonuses = new AosSkillBonuses(this);
                }

                if (GetSaveFlag(flags, SaveFlag.SetHue))
                {
                    this.m_SetHue = reader.ReadInt();
                }

                if (GetSaveFlag(flags, SaveFlag.LastEquipped))
                {
                    this.m_LastEquipped = reader.ReadBool();
                }

                if (GetSaveFlag(flags, SaveFlag.SetEquipped))
                {
                    this.m_SetEquipped = reader.ReadBool();
                }
                #endregion

                break;
            }
            }
        }
Exemple #37
0
        public BaseClothing( int itemID, Layer layer, int hue, ClothEffect effect, int charges )
            : base(itemID)
        {
            Layer = layer;
            Hue = hue;

            m_Resource = DefaultResource;
            m_Quality = ClothingQuality.Regular;
            m_ClothEffect = effect;
            m_Charges = charges;
            m_Identified = false;
            m_IDList = new List<Mobile>();

            m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

            m_AosAttributes = new AosAttributes( this );
            m_AosClothingAttributes = new AosArmorAttributes( this );
            m_AosSkillBonuses = new AosSkillBonuses( this );
            m_AosResistances = new AosElementAttributes( this );
        }
Exemple #38
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 5:
            {
                SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                if (GetSaveFlag(flags, SaveFlag.Resource))
                {
                    m_Resource = (CraftResource)reader.ReadEncodedInt();
                }
                else
                {
                    m_Resource = DefaultResource;
                }

                if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
                {
                    m_MaxHitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.HitPoints))
                {
                    m_HitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.Crafter))
                {
                    m_Crafter = reader.ReadMobile();
                }

                if (GetSaveFlag(flags, SaveFlag.Quality))
                {
                    m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                }
                else
                {
                    m_Quality = ClothingQuality.Regular;
                }

                if (GetSaveFlag(flags, SaveFlag.StrReq))
                {
                    m_StrReq = reader.ReadEncodedInt();
                }
                else
                {
                    m_StrReq = -1;
                }

                if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
                {
                    m_PlayerConstructed = true;
                }

                break;
            }

            case 4:
            {
                m_Resource = (CraftResource)reader.ReadInt();

                goto case 3;
            }

            case 3:
            case 2:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                m_Crafter = reader.ReadMobile();
                m_Quality = (ClothingQuality)reader.ReadInt();
                break;
            }

            case 0:
            {
                m_Crafter = null;
                m_Quality = ClothingQuality.Regular;
                break;
            }
            }

            if (version < 2)
            {
                m_PlayerConstructed = true;                 // we don't know, so, assume it's crafted
            }
            if (version < 4)
            {
                m_Resource = DefaultResource;
            }

            if (m_MaxHitPoints == 0 && m_HitPoints == 0)
            {
                m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
            }

            Mobile parent = Parent as Mobile;

            if (parent != null)
            {
                AddStatBonuses(parent);
                parent.CheckStatTimers();
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 6:
            {
                #region Set Items
                SetFlag sflags = (SetFlag)reader.ReadEncodedInt();

                if (GetSaveFlag(sflags, SetFlag.Attributes))
                {
                    m_SetAttributes = new AosAttributes(this, reader);
                }
                else
                {
                    m_SetAttributes = new AosAttributes(this);
                }

                if (GetSaveFlag(sflags, SetFlag.SkillBonuses))
                {
                    m_SetSkillBonuses = new AosSkillBonuses(this, reader);
                }
                else
                {
                    m_SetSkillBonuses = new AosSkillBonuses(this);
                }

                if (GetSaveFlag(sflags, SetFlag.SetHue))
                {
                    m_SetHue = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(sflags, SetFlag.LastEquipped))
                {
                    m_LastEquipped = reader.ReadBool();
                }

                if (GetSaveFlag(sflags, SetFlag.SetEquipped))
                {
                    m_SetEquipped = reader.ReadBool();
                }
                #endregion
                goto case 5;
            }

            case 5:
            {
                SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                if (GetSaveFlag(flags, SaveFlag.Resource))
                {
                    m_Resource = (CraftResource)reader.ReadEncodedInt();
                }
                else
                {
                    m_Resource = DefaultResource;
                }

                if (GetSaveFlag(flags, SaveFlag.Attributes))
                {
                    m_AosAttributes = new AosAttributes(this, reader);
                }
                else
                {
                    m_AosAttributes = new AosAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
                {
                    m_AosClothingAttributes = new AosArmorAttributes(this, reader);
                }
                else
                {
                    m_AosClothingAttributes = new AosArmorAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
                {
                    m_AosSkillBonuses = new AosSkillBonuses(this, reader);
                }
                else
                {
                    m_AosSkillBonuses = new AosSkillBonuses(this);
                }

                if (GetSaveFlag(flags, SaveFlag.Resistances))
                {
                    m_AosResistances = new AosElementAttributes(this, reader);
                }
                else
                {
                    m_AosResistances = new AosElementAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
                {
                    m_MaxHitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.HitPoints))
                {
                    m_HitPoints = reader.ReadEncodedInt();
                }

                if (GetSaveFlag(flags, SaveFlag.Crafter))
                {
                    m_Crafter = reader.ReadMobile();
                }

                if (GetSaveFlag(flags, SaveFlag.Quality))
                {
                    m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                }
                else
                {
                    m_Quality = ClothingQuality.Regular;
                }

                if (GetSaveFlag(flags, SaveFlag.StrReq))
                {
                    m_StrReq = reader.ReadEncodedInt();
                }
                else
                {
                    m_StrReq = -1;
                }

                if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
                {
                    m_PlayerConstructed = true;
                }

                break;
            }

            case 4:
            {
                m_Resource = (CraftResource)reader.ReadInt();

                goto case 3;
            }

            case 3:
            {
                m_AosAttributes         = new AosAttributes(this, reader);
                m_AosClothingAttributes = new AosArmorAttributes(this, reader);
                m_AosSkillBonuses       = new AosSkillBonuses(this, reader);
                m_AosResistances        = new AosElementAttributes(this, reader);

                goto case 2;
            }

            case 2:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                m_Crafter = reader.ReadMobile();
                m_Quality = (ClothingQuality)reader.ReadInt();
                break;
            }

            case 0:
            {
                m_Crafter = null;
                m_Quality = ClothingQuality.Regular;
                break;
            }
            }

            #region Sets Items
            if (m_SetAttributes == null)
            {
                m_SetAttributes = new AosAttributes(this);
            }

            if (m_SetSkillBonuses == null)
            {
                m_SetSkillBonuses = new AosSkillBonuses(this);
            }
            #endregion

            if (version < 2)
            {
                m_PlayerConstructed = true;                 // we don't know, so, assume it's crafted
            }
            if (version < 3)
            {
                m_AosAttributes         = new AosAttributes(this);
                m_AosClothingAttributes = new AosArmorAttributes(this);
                m_AosSkillBonuses       = new AosSkillBonuses(this);
                m_AosResistances        = new AosElementAttributes(this);
            }

            if (version < 4)
            {
                m_Resource = DefaultResource;
            }

            if (m_MaxHitPoints == 0 && m_HitPoints == 0)
            {
                m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
            }

            Mobile parent = Parent as Mobile;

            if (parent != null)
            {
                if (Core.AOS)
                {
                    m_AosSkillBonuses.AddTo(parent);
                }

                AddStatBonuses(parent);
                parent.CheckStatTimers();
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 6:
            {
                m_Crafter_Name = reader.ReadString();

                goto case 5;
            }

            case 5:
            {
                m_MaxHitPoints = reader.ReadInt();
                m_HitPoints    = reader.ReadInt();

                goto case 4;
            }

            case 4:
            {
                m_Resource = (CraftResource)reader.ReadInt();

                goto case 3;
            }

            case 3:
            {
                m_AosAttributes         = new AosAttributes(this, reader);
                m_AosClothingAttributes = new AosArmorAttributes(this, reader);
                m_AosSkillBonuses       = new AosSkillBonuses(this, reader);
                m_AosResistances        = new AosElementAttributes(this, reader);

                goto case 2;
            }

            case 2:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 1;
            }

            case 1:
            {
                m_Crafter = reader.ReadMobile();
                m_Quality = (ClothingQuality)reader.ReadInt();
                break;
            }

            case 0:
            {
                m_Crafter = null;
                m_Quality = ClothingQuality.Regular;
                break;
            }
            }

            if (version < 2)
            {
                m_PlayerConstructed = true;                 // we don't know, so, assume it's crafted
            }

            if (version < 3)
            {
                m_AosAttributes         = new AosAttributes(this);
                m_AosClothingAttributes = new AosArmorAttributes(this);
                m_AosSkillBonuses       = new AosSkillBonuses(this);
                m_AosResistances        = new AosElementAttributes(this);
            }

            if (version < 4)
            {
                m_Resource = DefaultResource;
            }

            Mobile parent = Parent as Mobile;

            if (parent != null)
            {
                if (Core.AOS)
                {
                    m_AosSkillBonuses.AddTo(parent);
                }

                AddStatBonuses(parent);
                parent.CheckStatTimers();
            }
        }
Exemple #41
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 8:
                        {
                            this.m_IsImbued = reader.ReadBool();
                            goto case 7;
                        }
                case 7:
                    {
                        m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this, reader);

                        #region Runic Reforging
                        m_ReforgedPrefix = (ReforgedPrefix)reader.ReadInt();
                        m_ReforgedSuffix = (ReforgedSuffix)reader.ReadInt();
                        m_ItemPower = (ItemPower)reader.ReadInt();
                        m_BlockRepair = reader.ReadBool();
                        #endregion

                        #region Stygian Abyss
                        m_GorgonLenseCharges = reader.ReadInt();
                        m_GorgonLenseType = (LenseType)reader.ReadInt();

                        m_PhysImbuing = reader.ReadInt();
                        m_FireImbuing = reader.ReadInt();
                        m_ColdImbuing = reader.ReadInt();
                        m_PoisonImbuing = reader.ReadInt();
                        m_EnergyImbuing = reader.ReadInt();
                        goto case 6;
                    }
                case 6:
                    {
                        if(version == 6)
                            m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this);

                        this.m_TimesImbued = reader.ReadInt();
                       
                        #endregion

                        this.m_BlessedBy = reader.ReadMobile();

                        #region Mondain's Legacy Sets
                        SetFlag sflags = (SetFlag)reader.ReadEncodedInt();

                        if (GetSaveFlag(sflags, SetFlag.Attributes))
                            this.m_SetAttributes = new AosAttributes(this, reader);
                        else
                            this.m_SetAttributes = new AosAttributes(this);

                        if (GetSaveFlag(sflags, SetFlag.ArmorAttributes))
                            this.m_SetSelfRepair = (new AosArmorAttributes(this, reader)).SelfRepair;

                        if (GetSaveFlag(sflags, SetFlag.SkillBonuses))
                            this.m_SetSkillBonuses = new AosSkillBonuses(this, reader);
                        else
                            this.m_SetSkillBonuses = new AosSkillBonuses(this);

                        if (GetSaveFlag(sflags, SetFlag.PhysicalBonus))
                            this.m_SetPhysicalBonus = reader.ReadEncodedInt();

                        if (GetSaveFlag(sflags, SetFlag.FireBonus))
                            this.m_SetFireBonus = reader.ReadEncodedInt();

                        if (GetSaveFlag(sflags, SetFlag.ColdBonus))
                            this.m_SetColdBonus = reader.ReadEncodedInt();

                        if (GetSaveFlag(sflags, SetFlag.PoisonBonus))
                            this.m_SetPoisonBonus = reader.ReadEncodedInt();

                        if (GetSaveFlag(sflags, SetFlag.EnergyBonus))
                            this.m_SetEnergyBonus = reader.ReadEncodedInt();

                        if (GetSaveFlag(sflags, SetFlag.SetHue))
                            this.m_SetHue = reader.ReadEncodedInt();

                        if (GetSaveFlag(sflags, SetFlag.LastEquipped))
                            this.m_LastEquipped = reader.ReadBool();

                        if (GetSaveFlag(sflags, SetFlag.SetEquipped))
                            this.m_SetEquipped = reader.ReadBool();

                        if (GetSaveFlag(sflags, SetFlag.SetSelfRepair))
                            this.m_SetSelfRepair = reader.ReadEncodedInt();
                        #endregion

                        goto case 5;
                    }
                case 5:
                    {
                        SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

                        if (GetSaveFlag(flags, SaveFlag.NegativeAttributes))
                            m_NegativeAttributes = new NegativeAttributes(this, reader);
                        else
                            m_NegativeAttributes = new NegativeAttributes(this);

                        if (GetSaveFlag(flags, SaveFlag.Resource))
                            this.m_Resource = (CraftResource)reader.ReadEncodedInt();
                        else
                            this.m_Resource = this.DefaultResource;

                        if (GetSaveFlag(flags, SaveFlag.Attributes))
                            this.m_AosAttributes = new AosAttributes(this, reader);
                        else
                            this.m_AosAttributes = new AosAttributes(this);

                        if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
                            this.m_AosClothingAttributes = new AosArmorAttributes(this, reader);
                        else
                            this.m_AosClothingAttributes = new AosArmorAttributes(this);

                        if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
                            this.m_AosSkillBonuses = new AosSkillBonuses(this, reader);
                        else
                            this.m_AosSkillBonuses = new AosSkillBonuses(this);

                        if (GetSaveFlag(flags, SaveFlag.Resistances))
                            this.m_AosResistances = new AosElementAttributes(this, reader);
                        else
                            this.m_AosResistances = new AosElementAttributes(this);

                        if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
                            this.m_MaxHitPoints = reader.ReadEncodedInt();

                        if (GetSaveFlag(flags, SaveFlag.HitPoints))
                            this.m_HitPoints = reader.ReadEncodedInt();

                        if (GetSaveFlag(flags, SaveFlag.Crafter))
                            this.m_Crafter = reader.ReadMobile();

                        if (GetSaveFlag(flags, SaveFlag.Quality))
                            this.m_Quality = (ClothingQuality)reader.ReadEncodedInt();
                        else
                            this.m_Quality = ClothingQuality.Regular;

                        if (GetSaveFlag(flags, SaveFlag.StrReq))
                            this.m_StrReq = reader.ReadEncodedInt();
                        else
                            this.m_StrReq = -1;

                        if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
                            this.m_PlayerConstructed = true;

                        break;
                    }
                case 4:
                    {
                        this.m_Resource = (CraftResource)reader.ReadInt();

                        goto case 3;
                    }
                case 3:
                    {
                        this.m_AosAttributes = new AosAttributes(this, reader);
                        this.m_AosClothingAttributes = new AosArmorAttributes(this, reader);
                        this.m_AosSkillBonuses = new AosSkillBonuses(this, reader);
                        this.m_AosResistances = new AosElementAttributes(this, reader);

                        goto case 2;
                    }
                case 2:
                    {
                        this.m_PlayerConstructed = reader.ReadBool();
                        goto case 1;
                    }
                case 1:
                    {
                        this.m_Crafter = reader.ReadMobile();
                        this.m_Quality = (ClothingQuality)reader.ReadInt();
                        break;
                    }
                case 0:
                    {
                        this.m_Crafter = null;
                        this.m_Quality = ClothingQuality.Regular;
                        break;
                    }
            }

            #region Mondain's Legacy Sets
            if (this.m_SetAttributes == null)
                this.m_SetAttributes = new AosAttributes(this);

            if (this.m_SetSkillBonuses == null)
                this.m_SetSkillBonuses = new AosSkillBonuses(this);
            #endregion

            if (version < 2)
                this.m_PlayerConstructed = true; // we don't know, so, assume it's crafted

            if (version < 3)
            {
                this.m_AosAttributes = new AosAttributes(this);
                this.m_AosClothingAttributes = new AosArmorAttributes(this);
                this.m_AosSkillBonuses = new AosSkillBonuses(this);
                this.m_AosResistances = new AosElementAttributes(this);
            }

            if (version < 4)
                this.m_Resource = this.DefaultResource;

            if (this.m_MaxHitPoints == 0 && this.m_HitPoints == 0)
                this.m_HitPoints = this.m_MaxHitPoints = Utility.RandomMinMax(this.InitMinHits, this.InitMaxHits);

            Mobile parent = this.Parent as Mobile;

            if (parent != null)
            {
                if (Core.AOS)
                    this.m_AosSkillBonuses.AddTo(parent);

                this.AddStatBonuses(parent);
                parent.CheckStatTimers();
            }
        }
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 6:
				{
					// Genova: suporte ao UO:ML.
					#region Mondain's Legacy
					SetFlag sflags = (SetFlag) reader.ReadEncodedInt();
					
					if ( GetSaveFlag( sflags, SetFlag.Attributes ) )
						m_SetAttributes = new AosAttributes( this, reader );
					else
						m_SetAttributes = new AosAttributes( this );

					if ( GetSaveFlag( sflags, SetFlag.ArmorAttributes ) )
						m_SetClothingAttributes = new AosArmorAttributes( this, reader );
					else
						m_SetClothingAttributes = new AosArmorAttributes( this );
						
					if ( GetSaveFlag( sflags, SetFlag.SkillBonuses ) )
						m_SetSkillBonuses = new AosSkillBonuses( this, reader );
					else
						m_SetSkillBonuses =  new AosSkillBonuses( this );

					if ( GetSaveFlag( sflags, SetFlag.PhysicalBonus ) )
						m_SetPhysicalBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( sflags, SetFlag.FireBonus ) )
						m_SetFireBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( sflags, SetFlag.ColdBonus ) )
						m_SetColdBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( sflags, SetFlag.PoisonBonus ) )
						m_SetPoisonBonus = reader.ReadEncodedInt();

					if ( GetSaveFlag( sflags, SetFlag.EnergyBonus ) )
						m_SetEnergyBonus = reader.ReadEncodedInt();
						
					if ( GetSaveFlag( sflags, SetFlag.SetHue ) )
						m_SetHue = reader.ReadEncodedInt();
						
					if ( GetSaveFlag( sflags, SetFlag.LastEquipped ) )
						m_LastEquipped = reader.ReadBool();
											
					if ( GetSaveFlag( sflags, SetFlag.SetEquipped ) )
						m_SetEquipped = reader.ReadBool();
					#endregion
					
					goto case 5;
				}
				case 5:
				{
					SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.Resource ) )
						m_Resource = (CraftResource)reader.ReadEncodedInt();
					else
						m_Resource = DefaultResource;

					if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
						m_AosAttributes = new AosAttributes( this, reader );
					else
						m_AosAttributes = new AosAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.ClothingAttributes ) )
						m_AosClothingAttributes = new AosArmorAttributes( this, reader );
					else
						m_AosClothingAttributes = new AosArmorAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
						m_AosSkillBonuses = new AosSkillBonuses( this, reader );
					else
						m_AosSkillBonuses = new AosSkillBonuses( this );

					if ( GetSaveFlag( flags, SaveFlag.Resistances ) )
						m_AosResistances = new AosElementAttributes( this, reader );
					else
						m_AosResistances = new AosElementAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.MaxHitPoints ) )
						m_MaxHitPoints = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.HitPoints ) )
						m_HitPoints = reader.ReadEncodedInt();

					if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
						m_Crafter = reader.ReadMobile();

					if ( GetSaveFlag( flags, SaveFlag.Quality ) )
						m_Quality = (ClothingQuality)reader.ReadEncodedInt();
					else
						m_Quality = ClothingQuality.Regular;

					if ( GetSaveFlag( flags, SaveFlag.StrReq ) )
						m_StrReq = reader.ReadEncodedInt();
					else
						m_StrReq = -1;

					if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
						m_PlayerConstructed = true;

					break;
				}
				case 4:
				{
					m_Resource = (CraftResource)reader.ReadInt();

					goto case 3;
				}
				case 3:
				{
					m_AosAttributes = new AosAttributes( this, reader );
					m_AosClothingAttributes = new AosArmorAttributes( this, reader );
					m_AosSkillBonuses = new AosSkillBonuses( this, reader );
					m_AosResistances = new AosElementAttributes( this, reader );

					goto case 2;
				}
				case 2:
				{
					m_PlayerConstructed = reader.ReadBool();
					goto case 1;
				}
				case 1:
				{
					m_Crafter = reader.ReadMobile();
					m_Quality = (ClothingQuality)reader.ReadInt();
					break;
				}
				case 0:
				{
					m_Crafter = null;
					m_Quality = ClothingQuality.Regular;
					break;
				}
			}
			
			// Genova: suporte ao UO:ML.
			#region Mondain's Legacy
			if ( m_SetAttributes == null )
				m_SetAttributes = new AosAttributes( this );
	
			if ( m_SetClothingAttributes == null )
				m_SetClothingAttributes = new AosArmorAttributes( this );
				
			if ( m_SetSkillBonuses == null )
				m_SetSkillBonuses = new AosSkillBonuses( this );
			#endregion

			if ( version < 2 )
				m_PlayerConstructed = true; // we don't know, so, assume it's crafted

			if ( version < 3 )
			{
				m_AosAttributes = new AosAttributes( this );
				m_AosClothingAttributes = new AosArmorAttributes( this );
				m_AosSkillBonuses = new AosSkillBonuses( this );
				m_AosResistances = new AosElementAttributes( this );
			}

			if ( version < 4 )
				m_Resource = DefaultResource;

			if ( m_MaxHitPoints == 0 && m_HitPoints == 0 )
				m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax( InitMinHits, InitMaxHits );

			Mobile parent = Parent as Mobile;

			if ( parent != null )
			{
				if ( Core.AOS )
					m_AosSkillBonuses.AddTo( parent );

				AddStatBonuses( parent );
				parent.CheckStatTimers();
			}
		}
		public BaseClothing(int itemID, Layer layer, int hue) : base( itemID )
		{
			Layer = layer;
			Hue = hue;
			m_Quality = ClothingQuality.Regular;
			m_MagicType = MagicEffect.None;
			m_MagicCharges = 0;
			m_Identified = true;
			m_IOBAlignment = IOBAlignment.None;		//Pigpen - Addition for IOB System
			m_InvisTimer = null;
			m_StatEffectTimer = null;
         m_Dyable = true;								//Froste - Addition for dye control
			m_Scissorable = true;						// Adam - Addition for better Scissor control
			
			// erl: added for clothing wear
			m_HitPoints = m_MaxHitPoints = (short) Utility.RandomMinMax( InitMinHits, InitMaxHits );

		}