Example #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                this.m_UsesRemaining = reader.ReadInt();

                this.m_Poison        = Poison.Deserialize(reader);
                this.m_PoisonCharges = reader.ReadInt();

                break;
            }
            }
        }
Example #2
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                Poison = reader.ReadInt() switch
                {
                    0 => null,
                    1 => Poison.Lesser,
                    2 => Poison.Regular,
                    3 => Poison.Greater,
                    4 => Poison.Deadly,
                    _ => Poison
                };

                break;
            }

            case 2:
            {
                Poison = Poison.Deserialize(reader);
                break;
            }

            case 3:
            {
                Poison     = Poison.Deserialize(reader);
                FillFactor = reader.ReadInt();
                break;
            }

            case 4:
            {
                Poisoner = reader.ReadEntity <Mobile>();
                goto case 3;
            }
            }
        }
Example #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_AnimHue = reader.ReadInt();
                goto case 0;
            }

            case 0:
            {
                m_Poison = Poison.Deserialize(reader);
                break;
            }
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_Poisoner = reader.ReadMobile();
                goto case 0;
            }

            case 0:
            {
                m_Poison   = Poison.Deserialize(reader);
                m_Content  = (BeverageType)reader.ReadInt();
                m_Quantity = reader.ReadInt();
                break;
            }
            }
        }
Example #5
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int      version = reader.ReadInt();
            SaveFlag flags   = (SaveFlag)reader.ReadEncodedInt();

            if (GetSaveFlag(flags, SaveFlag.Crafter))
            {
                m_Crafter = reader.ReadMobile();
            }
            if (GetSaveFlag(flags, SaveFlag.Quality))
            {
                m_Quality = (CoffeeQuality)reader.ReadEncodedInt();
            }
            else
            {
                m_Quality = CoffeeQuality.Regular;
            }
            if (m_Quality == CoffeeQuality.Low)
            {
                m_Quality = CoffeeQuality.Regular;
            }
            if (GetSaveFlag(flags, SaveFlag.Variety))
            {
                m_Variety = (HopsVariety)reader.ReadEncodedInt();
            }
            else
            {
                m_Variety = DefaultVariety;
            }
            if (m_Variety == HopsVariety.None)
            {
                m_Variety = DefaultVariety;
            }
            m_Poisoner   = reader.ReadMobile();
            m_Poison     = Poison.Deserialize(reader);
            m_FillFactor = reader.ReadInt();
        }
Example #6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 3:
                m_BonusSkill = (SkillName)reader.ReadInt();
                goto case 2;

            case 2:
                delay = reader.ReadTimeSpan();
                goto case 1;

            case 1:
                m_DamageType = reader.ReadString();
                goto case 0;

            case 0:
            {
                m_TrapOwner     = reader.ReadMobile();
                m_UsesRemaining = reader.ReadInt();
                m_TrapPower     = reader.ReadInt();
                m_ManaCost      = reader.ReadInt();
                m_DamageRange   = reader.ReadInt();
                m_TriggerRange  = reader.ReadInt();
                m_ParalyzeTime  = reader.ReadInt();
                m_Poison        = Poison.Deserialize(reader);
                m_DamageScalar  = reader.ReadDouble();
                m_PointDest     = reader.ReadPoint3D();
                m_MapDest       = reader.ReadMap();

                break;
            }
            }
        }
Example #7
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_Poisoner = reader.ReadMobile();

                goto case 0;
            }

            case 0:
            {
                m_Poison     = Poison.Deserialize(reader);
                m_FillFactor = reader.ReadInt();
                break;
            }
            }
        }
Example #8
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            case 0:
            {
                m_PotionEffect = (PotionEffect)reader.ReadInt();
                m_Poisoner     = reader.ReadMobile();
                m_Poison       = Poison.Deserialize(reader);
                break;
            }
            }

            if (version == 0)
            {
                Stackable = false;
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

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

                goto case 0;
            }

            case 0:
            {
                m_Poison = Poison.Deserialize(reader);

                m_PoisonCharges = reader.ReadInt();

                m_UsesRemaining = reader.ReadInt();

                m_Crafter = reader.ReadMobile();

                m_Quality = (BeltQuality)reader.ReadEncodedInt();

                break;
            }
            }

            if (UsesRemaining > 10)
            {
                UsesRemaining = 10;
            }
        }
Example #10
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                switch (reader.ReadInt())
                {
                case 0:
                    this.m_Poison = null;
                    break;

                case 1:
                    this.m_Poison = Poison.Lesser;
                    break;

                case 2:
                    this.m_Poison = Poison.Regular;
                    break;

                case 3:
                    this.m_Poison = Poison.Greater;
                    break;

                case 4:
                    this.m_Poison = Poison.Deadly;
                    break;
                }

                break;
            }

            case 2:
            {
                this.m_Poison = Poison.Deserialize(reader);
                break;
            }

            case 3:
            {
                this.m_Poison     = Poison.Deserialize(reader);
                this.m_FillFactor = reader.ReadInt();
                break;
            }

            case 4:
            {
                this.m_Poisoner = reader.ReadMobile();
                goto case 3;
            }

            case 5:
            {
                this.m_PlayerConstructed = reader.ReadBool();
                goto case 4;
            }

                #region Raw
            case 6:
            {
                m_Raw = reader.ReadBool();
                goto case 5;
            }

                #endregion
                #region Rotten Food
            case 7:
            {
                m_Rotten = reader.ReadBool();
                goto case 6;
            }

                #endregion
                #region Stat and skill boost
            case 8:
            {
                m_IntBoost       = reader.ReadInt();
                m_DexBoost       = reader.ReadInt();
                m_StrBoost       = reader.ReadInt();
                m_StatBoostTime  = reader.ReadDouble();
                m_Skill          = reader.ReadString();
                m_SkillBoost     = reader.ReadInt();
                m_SkillBoostTime = reader.ReadDouble();
                goto case 7;
            }
                #endregion
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

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

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

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

                if (GetSaveFlag(flags, SaveFlag.Variety))
                {
                    m_Variety = (HopsVariety)reader.ReadEncodedInt();
                }
                else
                {
                    m_Variety = DefaultVariety;
                }

                if (m_Variety == HopsVariety.None)
                {
                    m_Variety = DefaultVariety;
                }

                //break;
                goto case 1;
            }

            case 1:
            {
                m_Poisoner = reader.ReadMobile();

                goto case 0;
            }

            case 0:
            {
                m_Poison     = Poison.Deserialize(reader);
                m_FillFactor = reader.ReadInt();

                /*
                 * m_Crafter = reader.ReadMobile();
                 * m_Quality = (MeadQuality)reader.ReadInt();
                 *
                 * if ( version >= 2 )
                 * {
                 *      m_Variety = (HopsVariety)reader.ReadInt();
                 * }
                 * else
                 * {
                 *      HopsInfo info;
                 *
                 *      switch ( reader.ReadInt() )
                 *      {
                 *              default:
                 *              case 0: info = HopsInfo.BitterHops; break;
                 *              case 1: info = HopsInfo.SnowHops; break;
                 *              case 2: info = HopsInfo.ElvenHops; break;
                 *              case 3: info = HopsInfo.SweetHops; break;
                 *      }
                 *
                 *      m_Variety = BrewingResources.GetFromHopsInfo( info );
                 * }
                 */
                break;
            }
            }
        }
Example #12
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            m_Poison = Poison.Deserialize(reader);
        }
Example #13
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                switch (reader.ReadInt())
                {
                case 0:
                    m_Poison = null;
                    break;

                case 1:
                    m_Poison = Poison.Lesser;
                    break;

                case 2:
                    m_Poison = Poison.Regular;
                    break;

                case 3:
                    m_Poison = Poison.Greater;
                    break;

                case 4:
                    m_Poison = Poison.Deadly;
                    break;
                }

                break;
            }

            case 2:
            {
                m_Poison = Poison.Deserialize(reader);
                break;
            }

            case 3:
            {
                m_Poison     = Poison.Deserialize(reader);
                m_FillFactor = reader.ReadInt();
                break;
            }

            case 4:
            {
                m_Poisoner = reader.ReadMobile();
                goto case 3;
            }

            case 5:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 4;
            }
            }
        }
Example #14
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

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

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

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

                if (GetSaveFlag(flags, SaveFlag.Variety))
                {
                    m_Variety = (GrapeVariety)reader.ReadEncodedInt();
                }
                else
                {
                    m_Variety = DefaultVariety;
                }

                if (m_Variety == GrapeVariety.None)
                {
                    m_Variety = DefaultVariety;
                }

                goto case 1;
            }

            case 1:
            {
                m_Poisoner = reader.ReadMobile();

                goto case 0;
            }

            case 0:
            {
                m_Poison     = Poison.Deserialize(reader);
                m_FillFactor = reader.ReadInt();

                break;
            }
            }
        }
Example #15
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

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

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

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

                if (GetSaveFlag(flags, SaveFlag.Variety))
                {
                    m_Variety = (FruitsVariety)reader.ReadEncodedInt();
                }
                else
                {
                    m_Variety = DefaultVariety;
                }

                if (m_Variety == FruitsVariety.None)
                {
                    m_Variety = DefaultVariety;
                }

                //break;
                goto case 1;
            }

            case 1:
            {
                m_Poisoner = reader.ReadMobile();

                goto case 0;
            }

            case 0:
            {
                m_Poison     = Poison.Deserialize(reader);
                m_FillFactor = reader.ReadInt();

                /*
                 * m_Crafter = reader.ReadMobile();
                 * m_Quality = (JuiceQuality)reader.ReadInt();
                 *
                 * if ( version >= 2 )
                 * {
                 *      m_Variety = (FruitsVariety)reader.ReadInt();
                 * }
                 * else
                 * {
                 *      FruitsInfo info;
                 *
                 *      switch ( reader.ReadInt() )
                 *      {
                 *              default:
                 *              case 0: info = FruitsInfo.Apple; break;
                 *              case 1: info = FruitsInfo.Banana; break;
                 *              case 2: info = FruitsInfo.Dates; break;
                 *              case 3: info = FruitsInfo.Grapes; break;
                 *              case 4: info = FruitsInfo.Lemon; break;
                 *              case 5: info = FruitsInfo.Lime; break;
                 *              case 6: info = FruitsInfo.Orange; break;
                 *              case 7: info = FruitsInfo.Peach; break;
                 *              case 8: info = FruitsInfo.Pear; break;
                 *              case 9: info = FruitsInfo.Pumpkin; break;
                 *              case 10: info = FruitsInfo.Tomato; break;
                 *              case 11: info = FruitsInfo.Watermelon; break;
                 *              case 12: info = FruitsInfo.Apricot; break;
                 *              case 13: info = FruitsInfo.Blackberries; break;
                 *              case 14: info = FruitsInfo.Blueberries; break;
                 *              case 15: info = FruitsInfo.Cherries; break;
                 *              case 16: info = FruitsInfo.Cranberries; break;
                 *              case 17: info = FruitsInfo.Grapefruit; break;
                 *              case 18: info = FruitsInfo.Kiwi; break;
                 *              case 19: info = FruitsInfo.Mango; break;
                 *              case 20: info = FruitsInfo.Pineappe; break;
                 *              case 21: info = FruitsInfo.Pomegranate; break;
                 *              case 22: info = FruitsInfo.Strawberry; break;
                 *      }
                 *
                 *      m_Variety = BrewingResources.GetFromFruitsInfo( info );
                 * }
                 */
                break;
            }
            }
        }
Example #16
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                switch (reader.ReadInt())
                {
                case 0:
                    Poison = null;
                    break;

                case 1:
                    Poison = Poison.Lesser;
                    break;

                case 2:
                    Poison = Poison.Regular;
                    break;

                case 3:
                    Poison = Poison.Greater;
                    break;

                case 4:
                    Poison = Poison.Deadly;
                    break;
                }

                break;
            }

            case 2:
            {
                Poison = Poison.Deserialize(reader);
                break;
            }

            case 3:
            {
                Poison     = Poison.Deserialize(reader);
                FillFactor = reader.ReadInt();
                break;
            }

            case 4:
            {
                Poisoner = reader.ReadMobile();
                goto case 3;
            }

            case 5:
            {
                m_PlayerConstructed = reader.ReadBool();
                goto case 4;
            }

            case 6:
                m_EngravedText = reader.ReadString();
                goto case 5;

            case 7:
                _Quality = (ItemQuality)reader.ReadInt();
                goto case 6;
            }
        }
Example #17
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

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

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

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

                if (GetSaveFlag(flags, SaveFlag.Variety))
                {
                    m_Variety = (GrapeVariety)reader.ReadEncodedInt();
                }
                else
                {
                    m_Variety = DefaultVariety;
                }

                if (m_Variety == GrapeVariety.None)
                {
                    m_Variety = DefaultVariety;
                }

                //break;
                goto case 1;
            }

            case 1:
            {
                m_Poisoner = reader.ReadMobile();

                goto case 0;
            }

            case 0:
            {
                m_Poison     = Poison.Deserialize(reader);
                m_FillFactor = reader.ReadInt();

                /*
                 * m_Crafter = reader.ReadMobile();
                 * m_Quality = (WineQuality)reader.ReadInt();
                 *
                 * if ( version >= 2 )
                 * {
                 *      m_Variety = (GrapeVariety)reader.ReadInt();
                 * }
                 * else
                 * {
                 *      WineGrapeInfo info;
                 *
                 *      switch ( reader.ReadInt() )
                 *      {
                 *              default:
                 *              case 0: info = WineGrapeInfo.CabernetSauvignon; break;
                 *              case 1: info = WineGrapeInfo.Chardonnay; break;
                 *              case 2: info = WineGrapeInfo.CheninBlanc; break;
                 *              case 3: info = WineGrapeInfo.Merlot; break;
                 *              case 4: info = WineGrapeInfo.PinotNoir; break;
                 *              case 5: info = WineGrapeInfo.Riesling; break;
                 *              case 6: info = WineGrapeInfo.Sangiovese; break;
                 *              case 7: info = WineGrapeInfo.SauvignonBlanc; break;
                 *              case 8: info = WineGrapeInfo.Shiraz; break;
                 *              case 9: info = WineGrapeInfo.Viognier; break;
                 *              case 10: info = WineGrapeInfo.Zinfandel; break;
                 *      }
                 *
                 *      m_Variety = WinemakingResources.GetFromWineGrapeInfo( info );
                 * }
                 */
                break;
            }
            }
        }