示例#1
0
        public virtual TimeSpan GetCastRecovery()
        {
            if (!Core.AOS)
            {
                return(NextSpellDelay);
            }

            int fcr = AosAttributes.GetValue(m_Caster, AosAttribute.CastRecovery);

            if (fcr > 8)
            {
                fcr = 8;
            }

            fcr -= ThunderstormSpell.GetCastRecoveryMalus(m_Caster);

            int fcrDelay = -(CastRecoveryFastScalar * fcr);

            int delay = CastRecoveryBase + fcrDelay;

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

            return(TimeSpan.FromSeconds((double)delay / CastRecoveryPerSecond));
        }
示例#2
0
文件: Spell.cs 项目: dpisanu/xrunuo
        public virtual TimeSpan GetCastRecovery()
        {
            // Staff members have no recovery
            if (Caster.AccessLevel >= AccessLevel.GameMaster)
            {
                return(TimeSpan.Zero);
            }

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

            int fcr = Caster.GetMagicalAttribute(AosAttribute.CastRecovery);

            if (Caster is BaseCreature && !((BaseCreature)Caster).Controlled && !((BaseCreature)Caster).Summoned)
            {
                fcr = 4;
            }

            fcr -= ThunderstormSpell.GetCastRecoveryMalus(Caster);

            int fcrDelay = -(CastRecoveryFastScalar * fcr);

            int delay = CastRecoveryBase + fcrDelay;

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

            return(TimeSpan.FromSeconds((double)delay / CastRecoveryPerSecond));
        }
示例#3
0
        public override TimeSpan GetCastRecovery()
        {               //Pre-AOS delay is 0.75 seconds.
            int fcr = AosAttributes.GetValue(Caster, AosAttribute.CastRecovery);

            if (fcr > 4)
            {
                fcr = 4;
            }

            fcr -= ThunderstormSpell.GetCastRecoveryMalus(Caster);

            double delay = 0.25 * PowerLevel;

            delay -= ((double)fcr) * 0.25;

            return(TimeSpan.FromSeconds(delay));
        }
示例#4
0
        public override Spell ChooseSpell(Mobile c)
        {
            Spell spell = CheckCastHealingSpell();

            if (spell != null)
            {
                return(spell);
            }

            switch (Utility.Random(16))
            {
            case 0:
            case 1:
            case 2:                     // Poison them
            {
                m_Mobile.DebugSay("Attempting to poison");

                if (!c.Poisoned)
                {
                    spell = new PoisonSpell(m_Mobile, null);
                }

                break;
            }

            case 3:                     // Bless ourselves.
            {
                m_Mobile.DebugSay("Blessing myself");

                if (Utility.RandomBool() && !ArcaneEmpowermentSpell.IsBuffed(m_Mobile))
                {
                    spell = new ArcaneEmpowermentSpell(m_Mobile, null);
                }
                else
                {
                    spell = new BlessSpell(m_Mobile, null);
                }

                break;
            }

            case 4:                     // Wildfire
            {
                m_Mobile.DebugSay("Incendio!");

                spell = new WildfireSpell(m_Mobile, null);

                break;
            }

            case 5:                     // Reduce their cast speed
            {
                if (c.InRange(m_Mobile.Location, 6))
                {
                    if (m_Mobile.Skills[SkillName.Spellweaving].Value >= 90.0)
                    {
                        spell = new EssenceOfWindSpell(m_Mobile, null);
                    }
                    else if (c.InRange(m_Mobile.Location, 2))
                    {
                        spell = new ThunderstormSpell(m_Mobile, null);
                    }
                }

                m_Mobile.DebugSay("Attempting to reduce their cast speed");

                break;
            }

            case 6:                     // Curse them.
            {
                m_Mobile.DebugSay("Attempting to curse");

                spell = GetRandomCurseSpell(c);
                break;
            }

            case 7:                     // Paralyze them.
            {
                m_Mobile.DebugSay("Attempting to paralyze");

                if (m_Mobile.Skills[SkillName.Magery].Value > 50.0)
                {
                    spell = new ParalyzeSpell(m_Mobile, null);
                }

                break;
            }

            case 8:                     // Drain mana
            {
                m_Mobile.DebugSay("Attempting to drain mana");

                spell = GetRandomManaDrainSpell(c);
                break;
            }

            default:                     // Damage them.
            {
                m_Mobile.DebugSay("Just doing damage");

                spell = GetRandomDamageSpell(c);
                break;
            }
            }

            return(spell);
        }