Exemple #1
0
        public BaseJewel(int itemID, Layer layer)
            : base(itemID)
        {
            m_AosAttributes        = new AosAttributes(this);
            m_AosResistances       = new AosElementAttributes(this);
            m_SkillBonuses         = new SkillBonuses(this);
            m_AbsorptionAttributes = new AbsorptionAttributes(this);

            m_Resource = CraftResource.Iron;
            m_GemType  = GemType.None;

            Layer = layer;

            m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
        }
Exemple #2
0
        public BaseJewel( int itemID, Layer layer )
            : base(itemID)
        {
            m_MagicalAttributes = new MagicalAttributes( this );
            m_AosResistances = new ElementAttributes( this );
            m_SkillBonuses = new SkillBonuses( this );
            m_AbsorptionAttributes = new AbsorptionAttributes( this );

            m_Resource = CraftResource.Iron;
            m_GemType = GemType.None;

            Layer = layer;

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

            m_Resource = DefaultResource;

            m_AosAttributes        = new AosAttributes(this);
            m_ClothingAttributes   = new AosArmorAttributes(this);
            m_SkillBonuses         = new SkillBonuses(this);
            m_Resistances          = new AosElementAttributes(this);
            m_AbsorptionAttributes = new AbsorptionAttributes(this);

            m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
        }
Exemple #4
0
        public virtual void AlterFrom(BaseClothing orig)
        {
            m_Altered = true;

            m_AosAttributes        = orig.Attributes;
            m_ClothingAttributes   = orig.ClothingAttributes;
            m_SkillBonuses         = orig.SkillBonuses;
            m_Resistances          = orig.Resistances;
            m_AbsorptionAttributes = orig.AbsorptionAttributes;

            Crafter     = orig.Crafter;
            Exceptional = orig.Exceptional;

            MaxHitPoints = orig.MaxHitPoints;
            HitPoints    = orig.HitPoints;
        }
Exemple #5
0
        public BaseClothing( int itemID, Layer layer, int hue )
            : base(itemID)
        {
            Layer = layer;
            Hue = hue;

            m_Resource = DefaultResource;

            m_MagicalAttributes = new MagicalAttributes( this );
            m_ClothingAttributes = new ArmorAttributes( this );
            m_SkillBonuses = new SkillBonuses( this );
            m_Resistances = new ElementAttributes( this );
            m_AbsorptionAttributes = new AbsorptionAttributes( this );

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

            int version = reader.ReadInt();

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

                if (GetSaveFlag(flags, SaveFlag.Resource))
                {
                    m_Resource = (CraftResource)reader.ReadInt();
                }
                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_ClothingAttributes = new AosArmorAttributes(this, reader);
                }
                else
                {
                    m_ClothingAttributes = new AosArmorAttributes(this);
                }

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

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

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

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

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

                if (GetSaveFlag(flags, SaveFlag.Exceptional))
                {
                    m_Exceptional = true;
                }

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

                if (GetSaveFlag(flags, SaveFlag.AbsorptionAttributes))
                {
                    m_AbsorptionAttributes = new AbsorptionAttributes(this, reader);
                }
                else
                {
                    m_AbsorptionAttributes = new AbsorptionAttributes(this);
                }

                if (GetSaveFlag(flags, SaveFlag.Altered))
                {
                    m_Altered = true;
                }

                break;
            }

            case 8:
            {
                m_AbsorptionAttributes = new AbsorptionAttributes(this, reader);

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

                m_Resource = (CraftResource)reader.ReadInt();

                m_AosAttributes      = new AosAttributes(this, reader);
                m_ClothingAttributes = new AosArmorAttributes(this, reader);
                m_SkillBonuses       = new SkillBonuses(this, reader);
                m_Resistances        = new AosElementAttributes(this, reader);

                break;
            }
            }

            Mobile parent = Parent as Mobile;

            if (parent != null)
            {
                m_SkillBonuses.AddTo(parent);

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

            int version = reader.ReadInt();

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

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

                        if ( GetSaveFlag( flags, SaveFlag.Attributes ) )
                            m_MagicalAttributes = new MagicalAttributes( this, reader );
                        else
                            m_MagicalAttributes = new MagicalAttributes( this );

                        if ( GetSaveFlag( flags, SaveFlag.ClothingAttributes ) )
                            m_ClothingAttributes = new ArmorAttributes( this, reader );
                        else
                            m_ClothingAttributes = new ArmorAttributes( this );

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

                        if ( GetSaveFlag( flags, SaveFlag.Resistances ) )
                            m_Resistances = new ElementAttributes( this, reader );
                        else
                            m_Resistances = new ElementAttributes( this );

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

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

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

                        if ( GetSaveFlag( flags, SaveFlag.Exceptional ) )
                            m_Exceptional = true;

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

                        if ( GetSaveFlag( flags, SaveFlag.AbsorptionAttributes ) )
                            m_AbsorptionAttributes = new AbsorptionAttributes( this, reader );
                        else
                            m_AbsorptionAttributes = new AbsorptionAttributes( this );

                        if ( GetSaveFlag( flags, SaveFlag.Altered ) )
                            m_Altered = true;

                        break;
                    }
                case 8:
                    {
                        m_AbsorptionAttributes = new AbsorptionAttributes( this, reader );

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

                        m_Resource = (CraftResource) reader.ReadInt();

                        m_MagicalAttributes = new MagicalAttributes( this, reader );
                        m_ClothingAttributes = new ArmorAttributes( this, reader );
                        m_SkillBonuses = new SkillBonuses( this, reader );
                        m_Resistances = new ElementAttributes( this, reader );

                        break;
                    }
            }

            Mobile parent = Parent as Mobile;

            if ( parent != null )
            {
                m_SkillBonuses.AddTo( parent );

                AddStatBonuses( parent );
                parent.CheckStatTimers();
            }
        }
Exemple #8
0
        public virtual void AlterFrom( BaseClothing orig )
        {
            m_Altered = true;

            m_MagicalAttributes = orig.Attributes;
            m_ClothingAttributes = orig.ClothingAttributes;
            m_SkillBonuses = orig.SkillBonuses;
            m_Resistances = orig.Resistances;
            m_AbsorptionAttributes = orig.AbsorptionAttributes;

            Crafter = orig.Crafter;
            Exceptional = orig.Exceptional;

            MaxHitPoints = orig.MaxHitPoints;
            HitPoints = orig.HitPoints;
        }
Exemple #9
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 8:
            {
                m_Exceptional       = reader.ReadBool();
                m_PlayerConstructed = reader.ReadBool();
                m_Crafter           = reader.ReadMobile();

                goto case 7;
            }

            case 7:
            {
                m_AbsorptionAttributes = new AbsorptionAttributes(this, reader);

                m_TimesImbued = reader.ReadEncodedInt();

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

                m_Resource = (CraftResource)reader.ReadEncodedInt();
                m_GemType  = (GemType)reader.ReadEncodedInt();

                m_AosAttributes  = new AosAttributes(this, reader);
                m_AosResistances = new AosElementAttributes(this, reader);
                m_SkillBonuses   = new SkillBonuses(this, reader);

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

                break;
            }
            }

            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();
            }
        }
Exemple #10
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 8:
                    {
                        m_Exceptional = reader.ReadBool();
                        m_PlayerConstructed = reader.ReadBool();
                        m_Crafter = reader.ReadMobile();

                        goto case 7;
                    }
                case 7:
                    {
                        m_AbsorptionAttributes = new AbsorptionAttributes( this, reader );

                        m_TimesImbued = reader.ReadEncodedInt();

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

                        m_Resource = (CraftResource) reader.ReadEncodedInt();
                        m_GemType = (GemType) reader.ReadEncodedInt();

                        m_MagicalAttributes = new MagicalAttributes( this, reader );
                        m_AosResistances = new ElementAttributes( this, reader );
                        m_SkillBonuses = new SkillBonuses( this, reader );

                        if ( Parent is Mobile )
                            m_SkillBonuses.AddTo( (Mobile) Parent );

                        break;
                    }
            }

            int strBonus = m_MagicalAttributes.BonusStr;
            int dexBonus = m_MagicalAttributes.BonusDex;
            int intBonus = m_MagicalAttributes.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();
        }