Exemple #1
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);
        }
Exemple #2
0
        public void Target(BaseTalisman talis, Mobile owner, Mobile m)
        {
            if (this.Parent == owner)
            {
                //Curse Removal
                if (talis.m_TalismanType == TalismanType.CurseRemoval)
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    StatMod mod;

                    mod = m.GetStatMod("[Magic] Str Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Str Malus");
                    }

                    mod = m.GetStatMod("[Magic] Dex Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Dex Malus");
                    }

                    mod = m.GetStatMod("[Magic] Int Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Int Malus");
                    }

                    m.Paralyzed = false;

                    EvilOmenSpell.CheckEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072409);               // Your targets curses have been lifted
                    }
                    m.SendLocalizedMessage(1072408);                       // Any curses on you have been lifted
                }

                //Damage Removal
                if (talis.m_TalismanType == TalismanType.DamageRemoval)
                {
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 8);
                    Effects.PlaySound(m, m.Map, 0x201);
                    BleedAttack.EndBleed(m, false);
                    MortalStrike.EndWound(m);
                    m.CurePoison(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Bleed);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072406);               // Your Targets lasting damage effects have been removed!
                    }
                    m.SendLocalizedMessage(1072405);                       // Your lasting damage effects have been removed!
                }

                //Ward Removal
                if (talis.m_TalismanType == TalismanType.WardRemoval)
                {
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 8);
                    Effects.PlaySound(m, m.Map, 0x201);

                    ProtectionSpell.RemoveWard(m);
                    ReactiveArmorSpell.RemoveWard(m);
                    MagicReflectSpell.RemoveWard(m);
                    TransformationSpell.RemoveContext(m, true);
                    ReaperFormSpell.RemoveEffects(m);
                    if (StoneFormSpell.UnderEffect(m))
                    {
                        StoneFormSpell.RemoveEffects(m);
                    }

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072403);               // Your target's wards have been removed!
                    }
                    m.SendLocalizedMessage(1072402);                       // Your wards have been removed!
                }

                //Wildfire Removal
                if (talis.m_TalismanType == TalismanType.WildfireRemoval)
                {
                    owner.SendLocalizedMessage(1042753, "Wildfire Removal");                       // ~1_SOMETHING~ has been temporarily disabled.
                }
                //CARGE TIMER
                ChargeTimeLeft = 1200;
                m_ChargeTimer  = new ChargeTimeLeftTimer(this);
                m_ChargeTimer.Start();
                m_ChargeTimeLeft3 = DateTime.Now;
            }
            else if (m_TalismanType != 0)
            {
                m.SendLocalizedMessage(502641);                   // You must equip this item to use it.
            }
        }