public override void OnAdded(IEntity parent)
        {
            Mobile mob = parent as Mobile;

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

                #region Set Items
                if (IsSetItem)
                {
                    m_SetEquipped = SetHelper.FullSetEquipped(mob, SetID, Pieces);

                    if (m_SetEquipped)
                    {
                        m_LastEquipped = true;
                        SetHelper.AddSetBonus(mob, SetID);
                    }
                }
                #endregion


                AddStatBonuses(mob);
                mob.CheckStatTimers();
            }

            base.OnAdded(parent);
        }
示例#2
0
        public override void OnAdded(object parent)
        {
            if (Core.AOS && parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                m_AosSkillBonuses.AddTo(from);

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
                {
                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                from.CheckStatTimers();
            }
        }
示例#3
0
        public override void OnAdded(object parent)
        {
            if (EraAOS && parent is Mobile)
            {
                var from = (Mobile)parent;

                m_AosSkillBonuses.AddTo(from);

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
                {
                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                from.CheckStatTimers();
            }

            if (parent is Mobile)
            {
                var from = (Mobile)parent;

                var talisman = from.FindItemOnLayer(Layer.Talisman) as TransmuteTalisman;
                if (talisman != null)
                {
                    if (OriginalItemID == 0)
                    {
                        OriginalItemID = ItemID;
                        OriginalHue    = Hue;
                    }

                    if (talisman.TransmuteID != 0)
                    {
                        ItemID = talisman.TransmuteID;
                    }

                    if (talisman.TransmuteHue != 0)
                    {
                        Hue = talisman.TransmuteHue;
                    }
                }
            }
        }
示例#4
0
        public override void OnAdded(object parent)
        {
            if (parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                if (Core.AOS)
                {
                    m_AosSkillBonuses.AddTo(from);
                }

                from.Delta(MobileDelta.Armor);                   // Tell them armor rating has changed
            }
        }
示例#5
0
        public override void OnAdded(object parent)
        {
            if (Core.AOS && parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                m_AosSkillBonuses.AddTo(from);

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
                {
                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                from.CheckStatTimers();

                #region Mondain's Legacy Sets
                if (IsSetItem)
                {
                    m_SetEquipped = SetHelper.FullSetEquipped(from, SetID, Pieces);

                    if (m_SetEquipped)
                    {
                        m_LastEquipped = true;
                        SetHelper.AddSetBonus(from, SetID);
                    }
                }
                #endregion
            }

            if (parent is Mobile)
            {
                if (Server.Engines.XmlSpawner2.XmlAttach.CheckCanEquip(this, (Mobile)parent))
                {
                    Server.Engines.XmlSpawner2.XmlAttach.CheckOnEquip(this, (Mobile)parent);
                }
                else
                {
                    ((Mobile)parent).AddToBackpack(this);
                }
            }
        }
        public override void OnAdded(object parent)
        {
            Mobile mob = parent as Mobile;

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

                AddStatBonuses(mob);
                mob.CheckStatTimers();
            }

            base.OnAdded(parent);
        }
示例#7
0
        public override bool OnEquip(Mobile from)
        {
            return(base.OnEquip(from));

            if (Core.AOS)
            {
                m_AosSkillBonuses.AddTo(from);
            }
        }
示例#8
0
        public override void OnAdded(object parent)
        {
            if (parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                m_AosSkillBonuses.AddTo(from);

                from.CheckStatTimers();
            }
        }
示例#9
0
        public override void OnAdded(object parent)
        {
            if (Core.AOS && parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                m_AosSkillBonuses.AddTo(from);

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
                {
                    string modName = this.Serial.ToString();

                    if (strBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                from.CheckStatTimers();
            }

            // XmlAttachment check for OnEquip and CanEquip
            if (parent is Mobile)
            {
                if (Server.Engines.XmlSpawner2.XmlAttach.CheckCanEquip(this, (Mobile)parent))
                {
                    Server.Engines.XmlSpawner2.XmlAttach.CheckOnEquip(this, (Mobile)parent);
                }
                else
                {
                    ((Mobile)parent).AddToBackpack(this);
                }
            }
        }
示例#10
0
        public override void OnAdded(object parent)
        {
            if (parent is Mobile from)
            {
                m_AosSkillBonuses.AddTo(from);

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
                {
                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                from.CheckStatTimers();

                #region Mondain's Legacy Sets
                if (IsSetItem)
                {
                    m_SetEquipped = SetHelper.FullSetEquipped(from, SetID, Pieces);

                    if (m_SetEquipped)
                    {
                        m_LastEquipped = true;
                        SetHelper.AddSetBonus(from, SetID);
                    }
                }
                #endregion
            }
        }
示例#11
0
            public void Clear()
            {
                if (m_PVP)
                {
                    Timer.DelayCall(() =>
                    {
                        foreach (Item item in m_Target.Items)
                        {
                            AosSkillBonuses bonuses = RunicReforging.GetAosSkillBonuses(item);

                            if (bonuses != null)
                            {
                                bonuses.AddTo(m_Target);
                            }
                        }
                    });
                }
                else
                {
                    for (int i = 0; i < m_Mods.Count; ++i)
                    {
                        object mod = m_Mods[i];

                        if (mod is ResistanceMod)
                        {
                            m_Target.RemoveResistanceMod((ResistanceMod)mod);
                        }
                        else if (mod is StatMod)
                        {
                            m_Target.RemoveStatMod(((StatMod)mod).Name);
                        }
                        else if (mod is SkillMod)
                        {
                            m_Target.RemoveSkillMod((SkillMod)mod);
                        }
                    }
                }
            }
示例#12
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 12:
            case 11:
            {
                m_SetPhysicalBonus = reader.ReadInt();
                m_SetFireBonus     = reader.ReadInt();
                m_SetColdBonus     = reader.ReadInt();
                m_SetPoisonBonus   = reader.ReadInt();
                m_SetEnergyBonus   = reader.ReadInt();
                goto case 10;
            }

            case 10:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 9;
            }

            case 9:
            {
                m_TalismanProtection = new TalismanAttribute(reader);
                goto case 8;
            }

            case 8:
            {
                if (version == 11)
                {
                    reader.ReadBool();
                }
                _Owner     = reader.ReadMobile();
                _OwnerName = reader.ReadString();
                goto case 7;
            }

            case 7:
            {
                m_IsImbued = reader.ReadBool();
                goto case 6;
            }

            case 6:
            {
                m_NegativeAttributes = new NegativeAttributes(this, reader);
                goto case 5;
            }

            case 5:
            {
                #region Runic Reforging
                m_ReforgedPrefix = (ReforgedPrefix)reader.ReadInt();
                m_ReforgedSuffix = (ReforgedSuffix)reader.ReadInt();
                m_ItemPower      = (ItemPower)reader.ReadInt();
                if (version == 11 && reader.ReadBool())
                {
                    m_NegativeAttributes.NoRepair = 1;
                }
                #endregion

                #region Stygian Abyss
                m_GorgonLenseCharges = reader.ReadInt();
                m_GorgonLenseType    = (LenseType)reader.ReadInt();
                goto case 4;
            }

            case 4:
            {
                m_TimesImbued = reader.ReadEncodedInt();

                m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this, reader);
                #endregion

                m_BlessedBy    = reader.ReadMobile();
                m_LastEquipped = reader.ReadBool();
                m_SetEquipped  = reader.ReadBool();
                m_SetHue       = reader.ReadEncodedInt();

                m_SetAttributes   = new AosAttributes(this, reader);
                m_SetSkillBonuses = new AosSkillBonuses(this, reader);

                m_Crafter = reader.ReadMobile();
                m_Quality = (ItemQuality)reader.ReadInt();
                goto case 3;
            }

            case 3:
            {
                m_MaxHitPoints = reader.ReadEncodedInt();
                m_HitPoints    = reader.ReadEncodedInt();

                goto case 2;
            }

            case 2:
            {
                m_Resource = (CraftResource)reader.ReadEncodedInt();
                m_GemType  = (GemType)reader.ReadEncodedInt();

                goto case 1;
            }

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

                if (Core.AOS && Parent is Mobile)
                {
                    m_AosSkillBonuses.AddTo((Mobile)Parent);
                }

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
                {
                    Mobile m = (Mobile)Parent;

                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                if (Parent is Mobile)
                {
                    ((Mobile)Parent).CheckStatTimers();
                }

                break;
            }

            case 0:
            {
                m_AosAttributes   = new AosAttributes(this);
                m_AosResistances  = new AosElementAttributes(this);
                m_AosSkillBonuses = new AosSkillBonuses(this);

                break;
            }
            }

            if (m_NegativeAttributes == null)
            {
                m_NegativeAttributes = new NegativeAttributes(this);
            }

            if (m_TalismanProtection == null)
            {
                m_TalismanProtection = new TalismanAttribute();
            }

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

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

            if (version < 2)
            {
                m_Resource = CraftResource.Iron;
                m_GemType  = GemType.None;
            }
        }
示例#13
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				#region ItemID_Mods
				case (3):
				{
				m_Identified = reader.ReadBool();
				goto case 2;
				}
				#endregion
				case 2:
				{
					m_Resource = (CraftResource)reader.ReadEncodedInt();
					m_GemType = (GemType)reader.ReadEncodedInt();

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

					if ( Core.AOS && Parent is Mobile )
						m_AosSkillBonuses.AddTo( (Mobile)Parent );

					int strBonus = m_AosAttributes.BonusStr;
					int dexBonus = m_AosAttributes.BonusDex;
					int intBonus = m_AosAttributes.BonusInt;

					if ( Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
					{
						Mobile m = (Mobile)Parent;

						string modName = Serial.ToString();

						if ( strBonus != 0 )
							m.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

						if ( dexBonus != 0 )
							m.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

						if ( intBonus != 0 )
							m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
					}

					if ( Parent is Mobile )
						((Mobile)Parent).CheckStatTimers();

					break;
				}
				case 0:
				{
					m_AosAttributes = new AosAttributes( this );
					m_AosResistances = new AosElementAttributes( this );
					m_AosSkillBonuses = new AosSkillBonuses( this );

					break;
				}
			}

			if ( version < 2 )
			{
				m_Resource = CraftResource.Iron;
				m_GemType = GemType.None;
			}
		}
示例#14
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
                case 7:
                    {
                        m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this, reader);
                        goto case 6;
                    }
				case 6:
				{
                        if (version == 6)
                            m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this);

					m_MaxHitPoints = reader.ReadEncodedInt();
					m_HitPoints = reader.ReadEncodedInt();

					goto case 5;
				}
				//personal bless deed
				case 5:
				{
					m_BlessedBy = reader.ReadMobile();
					goto case 4;
				}
				#region Mondain's Legacy Sets
				case 4:
				{
					m_LastEquipped = reader.ReadBool();
					m_SetEquipped = reader.ReadBool();
					m_SetHue = reader.ReadEncodedInt();

					m_SetAttributes = new AosAttributes( this, reader );
					m_SetSkillBonuses = new AosSkillBonuses( this, reader );

					goto case 3;
				}
				#endregion
				#region Mondain's Legacy
				case 3:
				{
					m_Crafter = reader.ReadMobile();
					m_Quality = (ArmorQuality) reader.ReadInt();
										
					goto case 2;
				}
				#endregion
				case 2:
				{
					m_Resource = (CraftResource)reader.ReadEncodedInt();
					m_GemType = (GemType)reader.ReadEncodedInt();

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

					if ( Core.AOS && Parent is Mobile )
						m_AosSkillBonuses.AddTo( (Mobile)Parent );

					int strBonus = m_AosAttributes.BonusStr;
					int dexBonus = m_AosAttributes.BonusDex;
					int intBonus = m_AosAttributes.BonusInt;

					if ( Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
					{
						Mobile m = (Mobile)Parent;

						string modName = Serial.ToString();

						if ( strBonus != 0 )
							m.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

						if ( dexBonus != 0 )
							m.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

						if ( intBonus != 0 )
							m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
					}

					if ( Parent is Mobile )
						((Mobile)Parent).CheckStatTimers();

					break;
				}
				case 0:
				{
					m_AosAttributes = new AosAttributes( this );
					m_AosResistances = new AosElementAttributes( this );
					m_AosSkillBonuses = new AosSkillBonuses( this );

					break;
				}
			}

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

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

			if ( version < 2 )
			{
				m_Resource = CraftResource.Iron;
				m_GemType = GemType.None;
			}
		}
示例#15
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 6: m_OldJewel = reader.ReadBool(); goto case 5;
                case 5: m_Seal = reader.ReadString(); goto case 4;
                case 4:
                case 3:
                {
                    m_Crafter = reader.ReadMobile();
                    m_CraftersOriginalName = reader.ReadString();
                    m_Quality = (WeaponQuality)reader.ReadInt();
                    goto case 2;
                }
                case 2:
                {
                    m_Resource = (CraftResource)reader.ReadEncodedInt();
                    m_GemType = (GemType)reader.ReadEncodedInt();

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

                    if ( Core.AOS && Parent is Mobile )
                        m_AosSkillBonuses.AddTo( (Mobile)Parent );

                    int strBonus = m_AosAttributes.BonusStr;
                    int dexBonus = m_AosAttributes.BonusDex;
                    int intBonus = m_AosAttributes.BonusInt;

                    if ( Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
                    {
                        Mobile m = (Mobile)Parent;

                        string modName = Serial.ToString();

                        if ( strBonus != 0 )
                            m.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

                        if ( dexBonus != 0 )
                            m.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

                        if ( intBonus != 0 )
                            m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
                    }

                    if ( Parent is Mobile )
                        ((Mobile)Parent).CheckStatTimers();

                    break;
                }
                case 0:
                {
                    m_AosAttributes = new AosAttributes( this );
                    m_AosResistances = new AosElementAttributes( this );
                    m_AosSkillBonuses = new AosSkillBonuses( this );

                    break;
                }
            }

            if ( version < 2 )
            {
                m_Resource = CraftResource.Iron;
                m_GemType = GemType.None;
            }

            if( version < 4 )
                Hue = 0;

            if (!String.IsNullOrEmpty(m_Seal) && !Seals.Contains(m_Seal))
                Seals.Add(m_Seal);
        }
示例#16
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 7:
            {
                m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this, reader);
                goto case 6;
            }

            case 6:
            {
                if (version == 6)
                {
                    m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this);
                }

                m_MaxHitPoints = reader.ReadEncodedInt();
                m_HitPoints    = reader.ReadEncodedInt();

                goto case 5;
            }

            //personal bless deed
            case 5:
            {
                m_BlessedBy = reader.ReadMobile();
                goto case 4;
            }

                #region Mondain's Legacy Sets
            case 4:
            {
                m_LastEquipped = reader.ReadBool();
                m_SetEquipped  = reader.ReadBool();
                m_SetHue       = reader.ReadEncodedInt();

                m_SetAttributes   = new AosAttributes(this, reader);
                m_SetSkillBonuses = new AosSkillBonuses(this, reader);

                goto case 3;
            }

                #endregion
                #region Mondain's Legacy
            case 3:
            {
                m_Crafter = reader.ReadMobile();
                m_Quality = (ArmorQuality)reader.ReadInt();

                goto case 2;
            }

                #endregion
            case 2:
            {
                m_Resource = (CraftResource)reader.ReadEncodedInt();
                m_GemType  = (GemType)reader.ReadEncodedInt();

                goto case 1;
            }

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

                if (Core.AOS && Parent is Mobile)
                {
                    m_AosSkillBonuses.AddTo((Mobile)Parent);
                }

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
                {
                    Mobile m = (Mobile)Parent;

                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                if (Parent is Mobile)
                {
                    ((Mobile)Parent).CheckStatTimers();
                }

                break;
            }

            case 0:
            {
                m_AosAttributes   = new AosAttributes(this);
                m_AosResistances  = new AosElementAttributes(this);
                m_AosSkillBonuses = new AosSkillBonuses(this);

                break;
            }
            }

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

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

            if (version < 2)
            {
                m_Resource = CraftResource.Iron;
                m_GemType  = GemType.None;
            }
        }
示例#17
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

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

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

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

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

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

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

                if (m_Resource == CraftResource.None)
                {
                    m_Resource = DefaultResource;
                }

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

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

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

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

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

                if (GetSaveFlag(flags, SaveFlag.BonusRandomAttributes))
                {
                    m_BonusRandomAttributes = new BonusAttribute[reader.ReadInt()];

                    for (int i = 0; i < m_BonusRandomAttributes.Length; i++)
                    {
                        m_BonusRandomAttributes[i] = new BonusAttribute(reader);
                    }
                }

                break;
            }

            case 0:
            {
                m_InheritsItem       = true;
                m_OldVersion         = version;
                m_AosAttributes      = new AosAttributes(this);
                m_AosArmorAttributes = new AosArmorAttributes(this);
                m_Quality            = CraftQuality.Regular;
                m_Resource           = DefaultResource;
                m_PlayerConstructed  = true;
                break;
            }
            }

            if (m_AosSkillBonuses == null)
            {
                m_AosSkillBonuses = new AosSkillBonuses(this);
            }

            if (Core.AOS && Parent is Mobile)
            {
                m_AosSkillBonuses.AddTo((Mobile)Parent);
            }

            if (Parent is Mobile)
            {
                ((Mobile)Parent).CheckStatTimers();
            }
        }
示例#18
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 2:
                    m_OriginalHue = reader.ReadInt();
                    int idx = reader.ReadInt();
                    m_BaitType = FishInfo.GetTypeFromIndex(idx);
                    m_HookType = (HookType)reader.ReadInt();
                    m_HookUses = reader.ReadInt();
                    m_BaitUses = reader.ReadInt();
                    m_EnhancedBait = reader.ReadBool();

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

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

                    if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
                        m_AosSkillBonuses = new AosSkillBonuses(this, reader);
                    else
                        m_AosSkillBonuses = new AosSkillBonuses(this);
                    break;
                case 1:
                    m_AosAttributes = new AosAttributes(this);
                    m_AosSkillBonuses = new AosSkillBonuses(this);
                    break;
            }

            if (Core.AOS && Parent is Mobile)
                m_AosSkillBonuses.AddTo((Mobile)Parent);

            int strBonus = m_AosAttributes.BonusStr;
            int dexBonus = m_AosAttributes.BonusDex;
            int intBonus = m_AosAttributes.BonusInt;

            if (this.Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
            {
                Mobile m = (Mobile)this.Parent;

                string modName = this.Serial.ToString();

                if (strBonus != 0)
                    m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));

                if (dexBonus != 0)
                    m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));

                if (intBonus != 0)
                    m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
            }

            if (Parent is Mobile)
                ((Mobile)Parent).CheckStatTimers();

            if (m_BaitType != null && m_BaitUses <= 0)
                BaitType = null;

            if (m_HookType != HookType.None && m_HookUses <= 0)
                HookType = HookType.None;
        }
示例#19
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
                m_OriginalHue = reader.ReadInt();
                int idx = reader.ReadInt();
                m_BaitType     = FishInfo.GetTypeFromIndex(idx);
                m_HookType     = (HookType)reader.ReadInt();
                m_HookUses     = reader.ReadInt();
                m_BaitUses     = reader.ReadInt();
                m_EnhancedBait = reader.ReadBool();

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

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

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

            case 1:
                m_AosAttributes   = new AosAttributes(this);
                m_AosSkillBonuses = new AosSkillBonuses(this);
                break;
            }

            if (Core.AOS && Parent is Mobile)
            {
                m_AosSkillBonuses.AddTo((Mobile)Parent);
            }

            int strBonus = m_AosAttributes.BonusStr;
            int dexBonus = m_AosAttributes.BonusDex;
            int intBonus = m_AosAttributes.BonusInt;

            if (this.Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
            {
                Mobile m = (Mobile)this.Parent;

                string modName = this.Serial.ToString();

                if (strBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                }

                if (dexBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                }

                if (intBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                }
            }

            if (Parent is Mobile)
            {
                ((Mobile)Parent).CheckStatTimers();
            }

            if (m_BaitType != null && m_BaitUses <= 0)
            {
                BaitType = null;
            }

            if (m_HookType != HookType.None && m_HookUses <= 0)
            {
                HookType = HookType.None;
            }
        }
示例#20
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 5:
            {
                // erl: New "crafted by" and quality properties

                m_Crafter = reader.ReadMobile();
                m_Quality = (JewelQuality)reader.ReadShort();
                goto case 4;
            }

            case 4:
            {
                // remove AOS crap
                // see case 1 below
                goto case 3;
            }

            case 3:
            {
                m_MagicType    = (JewelMagicEffect)reader.ReadInt();
                m_MagicCharges = reader.ReadInt();
                m_Identified   = reader.ReadBool();

                goto case 2;
            }

            case 2:
            {
                m_Resource = (CraftResource)reader.ReadEncodedInt();
                m_GemType  = (GemType)reader.ReadEncodedInt();

                goto case 1;
            }

            case 1:
            {
                // pack these out of furture versions.
                if (version < 4)
                {
                    AosAttributes        dmy_AosAttributes;
                    AosElementAttributes dmy_AosResistances;
                    AosSkillBonuses      dmy_AosSkillBonuses;
                    dmy_AosAttributes   = new AosAttributes(this, reader);
                    dmy_AosResistances  = new AosElementAttributes(this, reader);
                    dmy_AosSkillBonuses = new AosSkillBonuses(this, reader);

                    if (Core.AOS && Parent is Mobile)
                    {
                        dmy_AosSkillBonuses.AddTo((Mobile)Parent);
                    }

                    int strBonus = dmy_AosAttributes.BonusStr;
                    int dexBonus = dmy_AosAttributes.BonusDex;
                    int intBonus = dmy_AosAttributes.BonusInt;

                    if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
                    {
                        Mobile m = (Mobile)Parent;

                        string modName = Serial.ToString();

                        if (strBonus != 0)
                        {
                            m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                        }

                        if (dexBonus != 0)
                        {
                            m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                        }

                        if (intBonus != 0)
                        {
                            m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                        }
                    }
                }

                if (Parent is Mobile)
                {
                    ((Mobile)Parent).CheckStatTimers();
                }

                break;
            }

            case 0:
            {
                // pack these out of furture versions.
                if (version < 4)
                {
                    AosAttributes        dmy_AosAttributes;
                    AosElementAttributes dmy_AosResistances;
                    AosSkillBonuses      dmy_AosSkillBonuses;
                    dmy_AosAttributes   = new AosAttributes(this);
                    dmy_AosResistances  = new AosElementAttributes(this);
                    dmy_AosSkillBonuses = new AosSkillBonuses(this);
                }

                break;
            }
            }

            if (version < 2)
            {
                m_Resource = CraftResource.Iron;
                m_GemType  = GemType.None;
            }

            if (version < 5)
            {
                m_Quality = JewelQuality.Regular;
            }
        }
示例#21
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 3:
            {
                #region Mondain's Legacy
                m_Crafter = reader.ReadMobile();
                m_Quality = (ArmorQuality)reader.ReadInt();
                #endregion

                goto case 2;
            }

            case 2:
            {
                m_Resource = (CraftResource)reader.ReadEncodedInt();
                m_GemType  = (GemType)reader.ReadEncodedInt();

                goto case 1;
            }

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

                if (Core.AOS && Parent is Mobile)
                {
                    m_AosSkillBonuses.AddTo((Mobile)Parent);
                }

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
                {
                    Mobile m = (Mobile)Parent;

                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                if (Parent is Mobile)
                {
                    ((Mobile)Parent).CheckStatTimers();
                }

                break;
            }

            case 0:
            {
                m_AosAttributes   = new AosAttributes(this);
                m_AosResistances  = new AosElementAttributes(this);
                m_AosSkillBonuses = new AosSkillBonuses(this);

                break;
            }
            }

            if (version < 2)
            {
                m_Resource = CraftResource.Iron;
                m_GemType  = GemType.None;
            }
        }
示例#22
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 3:
            {
                m_MaxHitPoints = reader.ReadEncodedInt();
                m_HitPoints    = reader.ReadEncodedInt();

                goto case 2;
            }

            case 2:
            {
                m_Resource = (CraftResource)reader.ReadEncodedInt();
                m_GemType  = (GemType)reader.ReadEncodedInt();

                goto case 1;
            }

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

                if (Core.AOS && Parent is Mobile)
                {
                    m_AosSkillBonuses.AddTo((Mobile)Parent);
                }

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
                {
                    Mobile m = (Mobile)Parent;

                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                if (Parent is Mobile)
                {
                    ((Mobile)Parent).CheckStatTimers();
                }

                break;
            }

            case 0:
            {
                m_AosAttributes   = new AosAttributes(this);
                m_AosResistances  = new AosElementAttributes(this);
                m_AosSkillBonuses = new AosSkillBonuses(this);
                m_AosSkillBonuses = new AosSkillBonuses(this);
// Xml Spawner XmlSockets - SOF
// mod to randomly add sockets and socketability features to armor. These settings will yield
// 2% drop rate of socketed/socketable items
// 0.1% chance of 5 sockets
// 0.5% of 4 sockets
// 3% chance of 3 sockets
// 15% chance of 2 sockets
// 50% chance of 1 socket
// the remainder will be 0 socket (31.4% in this case)
// uncomment the next line to prevent artifacts from being socketed
// if(ArtifactRarity == 0)
                XmlSockets.ConfigureRandom(this, 2.0, 0.1, 0.5, 3.0, 15.0, 50.0);
// Xml Spawner XmlSockets - EOF

                break;
            }
            }

            if (version < 2)
            {
                m_Resource = CraftResource.Iron;
                m_GemType  = GemType.None;
            }
        }
示例#23
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 4:
            {
                m_MaxHitPoints = reader.ReadEncodedInt();
                m_HitPoints    = reader.ReadEncodedInt();

                goto case 3;
            }

            case 3:
            {
//					if ( version < 4 )
//					{
                m_Identified     = reader.ReadBool();
                m_ChargedAbility = reader.ReadInt();
                m_AbilityCharges = reader.ReadInt();
//					}

                goto case 2;
            }

            case 2:
            {
                m_Resource = (CraftResource)reader.ReadEncodedInt();
                m_GemType  = (GemType)reader.ReadEncodedInt();

                goto case 1;
            }

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

                if (Core.AOS && Parent is Mobile)
                {
                    m_AosSkillBonuses.AddTo((Mobile)Parent);
                }

                int strBonus = m_AosAttributes.BonusStr;
                int dexBonus = m_AosAttributes.BonusDex;
                int intBonus = m_AosAttributes.BonusInt;

                if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
                {
                    Mobile m = (Mobile)Parent;

                    string modName = Serial.ToString();

                    if (strBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                if (Parent is Mobile)
                {
                    ((Mobile)Parent).CheckStatTimers();
                }

                break;
            }

            case 0:
            {
                m_AosAttributes   = new AosAttributes(this);
                m_AosResistances  = new AosElementAttributes(this);
                m_AosSkillBonuses = new AosSkillBonuses(this);

                break;
            }
            }

            if (version < 2)
            {
                m_Resource = CraftResource.Iron;
                m_GemType  = GemType.None;
            }
        }
示例#24
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 4:
                m_PlayerConstructed = reader.ReadBool();
                m_LowerStatReq      = reader.ReadInt();
                goto case 3;

            case 3:
                m_UsesRemaining     = reader.ReadInt();
                m_ShowUsesRemaining = reader.ReadBool();
                goto case 2;

            case 2:
                m_OriginalHue = reader.ReadInt();
                int idx = reader.ReadInt();
                m_BaitType     = FishInfo.GetTypeFromIndex(idx);
                m_HookType     = (HookType)reader.ReadInt();
                m_HookUses     = reader.ReadInt();
                m_BaitUses     = reader.ReadInt();
                m_EnhancedBait = reader.ReadBool();

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

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

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

            case 1:
                m_AosAttributes   = new AosAttributes(this);
                m_AosSkillBonuses = new AosSkillBonuses(this);
                break;
            }

            if (Parent is Mobile)
            {
                m_AosSkillBonuses.AddTo((Mobile)Parent);
            }

            int strBonus = m_AosAttributes.BonusStr;
            int dexBonus = m_AosAttributes.BonusDex;
            int intBonus = m_AosAttributes.BonusInt;

            if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
            {
                Mobile m = (Mobile)Parent;

                string modName = Serial.ToString();

                if (strBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                }

                if (dexBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                }

                if (intBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                }
            }

            if (Parent is Mobile)
            {
                ((Mobile)Parent).CheckStatTimers();
            }

            if (m_BaitType != null && m_BaitUses <= 0)
            {
                BaitType = null;
            }

            if (m_HookType != HookType.None && m_HookUses <= 0)
            {
                HookType = HookType.None;
            }

            if (version < 3 && m_Crafter != null)
            {
                m_PlayerConstructed = true;

                if (m_Resource == CraftResource.None)
                {
                    Resource = CraftResource.RegularWood;
                }
                else
                {
                    DistributeMaterialBonus();
                }
            }
        }
示例#25
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_ReplenishesCharges = reader.ReadBool();
            if (m_ReplenishesCharges)
            {
                m_LastReplenished = reader.ReadDateTime();
            }

            m_Crafter = reader.ReadMobile();

            m_Quality = (InstrumentQuality)reader.ReadEncodedInt();
            m_Slayer  = (SlayerName)reader.ReadEncodedInt();
            m_Slayer2 = (SlayerName)reader.ReadEncodedInt();

            UsesRemaining = reader.ReadEncodedInt();

            m_WellSound  = reader.ReadEncodedInt();
            m_BadlySound = reader.ReadEncodedInt();

            m_MaxHitPoints = reader.ReadEncodedInt();
            m_HitPoints    = reader.ReadEncodedInt();

            m_Resource = (CraftResource)reader.ReadEncodedInt();

            m_AosAttributes   = new AosAttributes(this, reader);
            m_AosResistances  = new AosElementAttributes(this, reader);
            m_AosSkillBonuses = new AosSkillBonuses(this, reader);

            CheckReplenishUses();

            if (Core.AOS && Parent is Mobile)
            {
                m_AosSkillBonuses.AddTo((Mobile)Parent);
            }

            int strBonus = m_AosAttributes.BonusStr;
            int dexBonus = m_AosAttributes.BonusDex;
            int intBonus = m_AosAttributes.BonusInt;

            if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
            {
                Mobile m = (Mobile)Parent;

                string modName = Serial.ToString();

                if (strBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                }

                if (dexBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                }

                if (intBonus != 0)
                {
                    m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                }
            }

            if (Parent is Mobile)
            {
                ((Mobile)Parent).CheckStatTimers();
            }
        }
示例#26
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 6:
                    {
                        m_Crafter = reader.ReadMobile();
                        goto case 5;
                    }
                case 5:
                    {
                        m_PlayerConstructed = reader.ReadBool();
                        goto case 4;
                    }
                case 4:
                    {
                        m_Identified = reader.ReadBool();
                        goto case 3;
                    }
                case 3:
                    {
                        m_MaxHitPoints = reader.ReadEncodedInt();
                        m_HitPoints = reader.ReadEncodedInt();
                        goto case 2;
                    }
                case 2:
                    {
                        m_Resource = (CraftResource)reader.ReadEncodedInt();
                        m_GemType = (GemType)reader.ReadEncodedInt();

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

                        if (Core.AOS && Parent is Mobile)
                            m_AosSkillBonuses.AddTo((Mobile)Parent);

                        int strBonus = m_AosAttributes.BonusStr;
                        int dexBonus = m_AosAttributes.BonusDex;
                        int intBonus = m_AosAttributes.BonusInt;

                        if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
                        {
                            Mobile m = (Mobile)Parent;

                            string modName = Serial.ToString();

                            if (strBonus != 0)
                                m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));

                            if (dexBonus != 0)
                                m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));

                            if (intBonus != 0)
                                m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                        }

                        if (Parent is Mobile)
                            ((Mobile)Parent).CheckStatTimers();

                        break;
                    }
                case 0:
                    {
                        m_AosAttributes = new AosAttributes(this);
                        m_AosResistances = new AosElementAttributes(this);
                        m_AosSkillBonuses = new AosSkillBonuses(this);

                        break;
                    }
            }
            if (version < 5)
            {
                m_PlayerConstructed = false; //Assume it wasn't crafted
            }
            if (version < 4)
            {
                m_Identified = true; //Assume it was identified
            }
            if (version < 2)
            {
                m_Resource = CraftResource.MIron;
                m_GemType = GemType.None;
            }
        }