Exemplo n.º 1
0
        public override int GetSpellCastSpeedBonus(SkillName castSkill)
        {
            int castSpeed = base.GetSpellCastSpeedBonus(castSkill);

            castSpeed += AosAttributes.GetValue(this, AosAttribute.CastSpeed);

            // 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.Chivalry && Skills[SkillName.Magery].Value >= 70.0))
            {
                fcMax = 2;
            }

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

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

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

            return(castSpeed);
        }
Exemplo n.º 2
0
        public override TimeSpan GetCastDelay()
        {               //Pre-AOS delay is 0.25 * circle
            int fc = AosAttributes.GetValue(Caster, AosAttribute.CastSpeed);

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

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

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

            double delay = 0.15 * PowerLevel;

            delay -= ((double)fc) * 0.15;

            return(TimeSpan.FromSeconds(delay));
        }
Exemplo 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 (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);
        }
Exemplo n.º 4
0
        public virtual TimeSpan GetCastDelay()
        {
            // Staff members cast instantly
            if (Caster.AccessLevel >= AccessLevel.GameMaster)
            {
                return(TimeSpan.Zero);
            }

            if (Scroll is SpellStone)
            {
                return(TimeSpan.Zero);
            }

            if (Caster is BaseCreature && ((BaseCreature)Caster).InstantCast)
            {
                return(TimeSpan.Zero);
            }

            int fcMax = FasterCastingCap;
            int fc    = Caster.GetMagicalAttribute(AosAttribute.CastSpeed);

            if (Caster is BaseCreature && !((BaseCreature)Caster).Controlled && !((BaseCreature)Caster).Summoned)
            {
                fc = 2;
            }

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

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

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

            if (StoneFormSpell.UnderEffect(Caster))
            {
                fc -= 2;
            }

            TimeSpan baseDelay = CastDelayBase;

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

            TimeSpan delay = baseDelay + fcDelay;

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

            return(delay);
        }
Exemplo n.º 5
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 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);

            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;
            }

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

            //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond );
            return(delay);
        }
Exemplo n.º 6
0
        //public virtual int CastDelayMinimum{ get{ return 1; } }

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


            if (CastSkill == SkillName.Magery)
            {
                int circle = (int)(((MagerySpell)this).Circle);
                return(TimeSpan.FromSeconds(0.5 + (circle) * 0.5));
            }

            // 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.Chivalry && m_Caster.Skills[SkillName.Magery].Value >= 70.0))
            {
                fcMax = 2;
            }

            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;
            }

            //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond );
            return(delay);
        }
Exemplo n.º 7
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 || m_Scroll is BaseJewel || m_Scroll is GnarledStaff || m_Scroll is BaseStationary)
            {
                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));

            TimeSpan delay = baseDelay + fcDelay;

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

            if (m_Scroll != null)
            {
                delay = TimeSpan.FromSeconds(((((m_Scroll.ItemID - 7981) - 1) / 8) + 1) / 4);
            }
            //return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond );

            return(delay);
        }
Exemplo n.º 8
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 || m_Scroll is GnarledStaff)
            {
                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 = 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);

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

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

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

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

            TimeSpan delay = CastDelayBase + fcDelay;

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

            return(delay);
        }