Esempio n. 1
0
        //public virtual int CastDelayBase{ get{ return 3; } }
        //public virtual int CastDelayFastScalar{ get{ return 1; } }
        //public virtual int CastDelayPerSecond{ get{ return 4; } }
        //public virtual int CastDelayMinimum{ get{ return 1; } }

        public virtual TimeSpan GetCastDelay()
        {
            if (m_Scroll is SpellStone)
            {
                return(TimeSpan.Zero);
            }

            if (m_Scroll is BaseWand)
            {
                return(Core.ML ? CastDelayBase : TimeSpan.Zero);                // TODO: Should FC apply to wands?
            }

            // Faster casting cap of 2 (if not using the protection spell)
            // Faster casting cap of 0 (if using the protection spell)
            // Paladin spells are subject to a faster casting cap of 4
            // Paladins with magery of 70.0 or above are subject to a faster casting cap of 2
            int fcMax = 4;

            if (CastSkill == SkillName.Magery || CastSkill == SkillName.Necromancy || CastSkill == SkillName.Mysticism ||
                (CastSkill == SkillName.Chivalry && (m_Caster.Skills[SkillName.Magery].Value >= 70.0 || m_Caster.Skills[SkillName.Mysticism].Value >= 70.0)))
            {
                fcMax = 2;
            }

            int fc = AosAttributes.GetValue(m_Caster, AosAttribute.CastSpeed);

            if (fc > fcMax)
            {
                fc = fcMax;
            }

            if (ProtectionSpell.Registry.ContainsKey(m_Caster) || EodonianPotion.IsUnderEffects(m_Caster, PotionEffect.Urali))
            {
                fc = Math.Min(fcMax - 2, fc - 2);
            }

            TimeSpan baseDelay = CastDelayBase;

            TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick));

            //int delay = CastDelayBase + circleDelay + fcDelay;
            TimeSpan delay = baseDelay + fcDelay;

            if (delay < CastDelayMinimum)
            {
                delay = CastDelayMinimum;
            }

            #region Mondain's Legacy
            if (DreadHorn.IsUnderInfluence(m_Caster))
            {
                delay.Add(delay);
            }
            #endregion

            //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond );
            return(delay);
        }
Esempio n. 2
0
        //public virtual int CastDelayBase{ get{ return 3; } }
        //public virtual int CastDelayFastScalar{ get{ return 1; } }
        //public virtual int CastDelayPerSecond{ get{ return 4; } }
        //public virtual int CastDelayMinimum{ get{ return 1; } }

        public virtual TimeSpan GetCastDelay()
        {
            if (m_Scroll is BaseWand)
            {
                return(TimeSpan.Zero);
            }

            // Faster casting cap of 2 (if not using the protection spell)
            // Faster casting cap of 0 (if using the protection spell)
            // Paladin spells are subject to a faster casting cap of 4
            // Paladins with magery of 70.0 or above are subject to a faster casting cap of 2
            int fcMax = 2;

            if (CastSkill == SkillName.Chivalry && m_Caster.Skills[SkillName.Magery].Value < 70.0)
            {
                fcMax = 4;
            }

            int fc = AosAttributes.GetValue(m_Caster, AosAttribute.CastSpeed);

            if (fc > fcMax)
            {
                fc = fcMax;
            }

            if (ProtectionSpell.Registry.Contains(m_Caster))
            {
                fc -= 2;
            }

            if (EssenceOfWindSpell.IsDebuffed(m_Caster))
            {
                fc -= EssenceOfWindSpell.GetFCMalus(m_Caster);
            }

            TimeSpan baseDelay = CastDelayBase;

            TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick));

            //int delay = CastDelayBase + circleDelay + fcDelay;
            TimeSpan delay = baseDelay + fcDelay;

            if (delay < CastDelayMinimum)
            {
                delay = CastDelayMinimum;
            }

            // genova: other project : Full support UO:ML rev 107
            #region Mondain's Legacy
            if (DreadHorn.IsUnderInfluence(m_Caster))
            {
                delay.Add(delay);
            }
            #endregion

            //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond );
            return(delay);
        }
Esempio n. 3
0
        //public virtual int CastDelayBase{ get{ return 3; } }
        //public virtual int CastDelayFastScalar{ get{ return 1; } }
        //public virtual int CastDelayPerSecond{ get{ return 4; } }
        //public virtual int CastDelayMinimum{ get{ return 1; } }

        public virtual TimeSpan GetCastDelay()
        {
            if (this.m_Scroll is BaseWand)
            {
                return(Core.ML ? this.CastDelayBase : TimeSpan.Zero);                // TODO: Should FC apply to wands?
            }
            // Faster casting cap of 2 (if not using the protection spell)
            // Faster casting cap of 0 (if using the protection spell)
            // Paladin spells are subject to a faster casting cap of 4
            // Paladins with magery of 70.0 or above are subject to a faster casting cap of 2
            int fcMax = 4;

            if (this.CastSkill == SkillName.Magery || this.CastSkill == SkillName.Necromancy || (this.CastSkill == SkillName.Chivalry && this.m_Caster.Skills[SkillName.Magery].Value >= 70.0))
            {
                fcMax = 2;
            }

            int fc = AosAttributes.GetValue(this.m_Caster, AosAttribute.CastSpeed);

            if (fc > fcMax)
            {
                fc = fcMax;
            }

            if (ProtectionSpell.Registry.Contains(this.m_Caster))
            {
                fc -= 2;
            }

            if (EssenceOfWindSpell.IsDebuffed(this.m_Caster))
            {
                fc -= EssenceOfWindSpell.GetFCMalus(this.m_Caster);
            }

            TimeSpan baseDelay = this.CastDelayBase;

            TimeSpan fcDelay = TimeSpan.FromSeconds(-(this.CastDelayFastScalar * fc * this.CastDelaySecondsPerTick));

            //int delay = CastDelayBase + circleDelay + fcDelay;
            TimeSpan delay = baseDelay + fcDelay;

            if (delay < this.CastDelayMinimum)
            {
                delay = this.CastDelayMinimum;
            }

            #region Mondain's Legacy
            if (DreadHorn.IsUnderInfluence(this.m_Caster))
            {
                delay.Add(delay);
            }
            #endregion

            //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond );
            return(delay);
        }