Ejemplo 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 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 (no longer) subject to a faster casting cap of 2
            int fcMax = 4;

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

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

            if (sc > 2 && Mantra != "In Nox")  //sneaky way to increase cap on FC (except poison to avoid poison spam win vs cure)
            {
                fcMax += sc - 2;
            }
            if (fc > fcMax)
            {
                fc = fcMax;
            }

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

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

            if (SpellHelper.IsBuffed(m_Caster))
            {
                fc += SpellHelper.GetFCBonus(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;
            }

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