Ejemplo n.º 1
0
        public MoodletSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "BuffName", Guid))
            {
                if (!row.TryGetEnum <BuffNames>("BuffName", out mBuff, BuffNames.Undefined))
                {
                    mBuff = (BuffNames)row.GetUlong("BuffName", 0);
                    if (mBuff == 0)
                    {
                        mBuff = (BuffNames)ResourceUtils.HashString64(row.GetString("BuffName"));
                    }

                    if (!BuffManager.BuffDictionary.ContainsKey((ulong)mBuff))
                    {
                        BooterLogger.AddError(Guid + " Unknown BuffName: " + row.GetString("BuffName"));
                    }
                }
            }

            mMoodValue = row.GetInt("MoodValue", 0);

            mDuration = row.GetInt("Duration", 30);
            if (mDuration <= 0)
            {
                mDuration = -1;
            }

            mOrigin = (Origin)row.GetUlong("Origin", 0);
            if (mOrigin == Origin.None)
            {
                mOrigin = (Origin)ResourceUtils.HashString64(row.GetString("Origin"));
            }
        }
Ejemplo n.º 2
0
        public MoodletSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "BuffName", Guid))
            {
                if (!row.TryGetEnum<BuffNames>("BuffName", out mBuff, BuffNames.Undefined))
                {
                    mBuff = (BuffNames)row.GetUlong("BuffName", 0);
                    if (mBuff == 0)
                    {
                        mBuff = (BuffNames)ResourceUtils.HashString64(row.GetString("BuffName"));
                    }

                    if (!BuffManager.BuffDictionary.ContainsKey((ulong)mBuff))
                    {
                        BooterLogger.AddError(Guid + " Unknown BuffName: " + row.GetString("BuffName"));
                    }
                }
            }

            mMoodValue = row.GetInt("MoodValue", 0);

            mDuration = row.GetInt("Duration", 30);
            if (mDuration <= 0)
            {
                mDuration = -1;
            }

            mOrigin = (Origin)row.GetUlong("Origin", 0);
            if (mOrigin == Origin.None)
            {
                mOrigin = (Origin)ResourceUtils.HashString64(row.GetString("Origin"));
            }
        }