コード例 #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);
        }
コード例 #2
0
ファイル: Spell.cs プロジェクト: zerodowned/genovaproject-1
        //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);
        }
コード例 #3
0
ファイル: Spell.cs プロジェクト: blasterdude9/ForkUO-1
        //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);
        }
コード例 #4
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            switch (info.ButtonID)
            {
            case 0:
            {
                from.CloseGump(typeof(DreadhornGump));
                break;
            }

            case 1:                                                     //Case uses the ActionIDs defenied above. Case 1 defenies the actions for the button with the action id 1
            {
                Party party = Party.Get(from);

                if (party != null)
                {
                    for (int i = 0; i < party.Count; i++)
                    {
                        Mobile m = party[i].Mobile;

                        if (Utility.InRange(from.Location, m.Location, 6))
                        {
                            m.MoveToWorld(new Point3D(2153, 1262, -60), Map.Ilshenar);
                            DreadHorn dh = new DreadHorn();
                            dh.MoveToWorld(new Point3D(2139, 1249, -60), Map.Ilshenar);
                            m_Deed.Delete();                                             // Delete the deed
                        }
                    }
                }
                else
                {
                    from.MoveToWorld(new Point3D(2153, 1262, -60), Map.Ilshenar);
                    DreadHorn dh = new DreadHorn();
                    dh.MoveToWorld(new Point3D(2139, 1249, -60), Map.Ilshenar);
                    m_Deed.Delete();
                }
                break;
            }
            }
        }