Пример #1
0
            public InternalTimer(
                int serial, int helperserial, TimeSpan timeleft, bool stats, bool skills, bool feat, bool messageon, bool emoteon, bool potionon, PotionEffect potion, int strmod,
                int dexmod, int intmod, int hitsmaxmod, int stammaxmod, int manamaxmod, TAVFeats featmod, double[] skillmods,
                string message, string emote) : base(timeleft)
            {
                Priority = TimerPriority.TwoFiftyMS;

                m_Stats        = stats;
                m_Skills       = skills;
                m_Feat         = feat;
                m_MessageOn    = messageon;
                m_EmoteOn      = emoteon;
                m_PotionOn     = potionon;
                m_PotionEffect = potion;

                m_StrMod       = strmod;
                m_DexMod       = dexmod;
                m_IntMod       = intmod;
                m_HitsMaxMod   = hitsmaxmod;
                m_StamMaxMod   = stammaxmod;
                m_ManaMaxMod   = manamaxmod;
                m_PlayerSerial = serial;
                m_HelperSerial = helperserial;

                m_TimeLeft = timeleft;

                m_FeatMod = featmod;

                m_Message = message;
                m_Emote   = emote;

                m_SkillMods = skillmods;
            }
Пример #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            TimeSpan m_TimeLeft = new TimeSpan();
            TimeSpan m_Compare  = new TimeSpan(0, 0, 0);

            m_Stats     = reader.ReadBool();
            m_Skills    = reader.ReadBool();
            m_Feat      = reader.ReadBool();
            m_MessageOn = reader.ReadBool();
            m_EmoteOn   = reader.ReadBool();
            m_PotionOn  = reader.ReadBool();

            m_StrMod     = reader.ReadInt();
            m_DexMod     = reader.ReadInt();
            m_IntMod     = reader.ReadInt();
            m_HitsMaxMod = reader.ReadInt();
            m_StamMaxMod = reader.ReadInt();
            m_ManaMaxMod = reader.ReadInt();

            m_EndTime = reader.ReadDateTime();

            m_FeatMod = (TAVFeats)reader.ReadInt();

            m_PlayerSerial = reader.ReadInt();

            if (m_MessageOn)
            {
                m_Message = reader.ReadString();
            }

            if (m_EmoteOn)
            {
                m_Message = reader.ReadString();
            }

            if (m_PotionOn)
            {
                m_Potion = (PotionEffect)reader.ReadInt();
            }

            for (int i = 0; i < 52; i++)
            {
                m_SkillMods[i] = reader.ReadDouble();
            }

            // Remaining time check
            m_TimeLeft = m_EndTime.Subtract(DateTime.Now);

            if (TimeSpan.Compare(m_TimeLeft, m_Compare) <= 0)
            {
                m_TimeLeft = new TimeSpan(0, 0, 0);
            }

            InternalTimer m_Timer = new InternalTimer(
                m_PlayerSerial, (int)this.Serial, m_TimeLeft, m_Stats, m_Skills, m_Feat, m_MessageOn, m_EmoteOn, m_PotionOn, m_Potion, m_StrMod, m_DexMod, m_IntMod, m_HitsMaxMod,
                m_StamMaxMod, m_ManaMaxMod, m_FeatMod, m_SkillMods, m_Message, m_Emote);

            m_Timer.Start();
        }