Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        private void OnBeginDream(PlayerMobile m)
        {
            if ((!m.Alive))
            {
                return;
            }

            m.SendMessage("Thou hast fallen asleep.");

            //Create the player's box and label it
            MetalBox playerBox = new MetalBox();

            playerBox.Name = m.Name;

            //Items list so we can remove them
            List <Item> equipItems = m.Items;

            //Remove clothing/equipment
            for (int x = m.Items.Count - 1; x >= 0; x--)
            {
                if (!(m.Items[x] is Backpack))
                {
                    playerBox.AddItem(m.Items[x]);
                }
            }

            //Create the box for the backpack items
            MetalBox backpackBox = new MetalBox();

            playerBox.AddItem(backpackBox);

            //Remove backpack items
            for (int y = m.Backpack.Items.Count - 1; y >= 0; y--)
            {
                if ((m.Backpack.Items[y] is HelmOfCourage) || (m.Backpack.Items[y] is CrystalRoseOfLove) || (m.Backpack.Items[y] is MirrorOfTruth) || (m.Backpack.Items[y] is StaffOrb))
                {
                }
                else
                {
                    backpackBox.AddItem(m.Backpack.Items[y]);
                }
            }

            //Move the container away
            playerBox.MoveToWorld(new Point3D(0, 0, 0), Map.SerpentIsle);

            //Move pets away
            foreach (Mobile mobile in m.AllFollowers)
            {
                mobile.MoveToWorld(new Point3D(0, 0, 0), Map.SerpentIsle);
                mobile.Frozen = true;
            }

            //Send to random destination in the dream
            switch (Utility.Random(4))
            {
            case 0:
                m.MoveToWorld(new Point3D(1988, 1536, 0), Map.SerpentIsle);
                m.SetDirection(Direction.East);
                break;

            case 1:
                m.MoveToWorld(new Point3D(2050, 1491, 0), Map.SerpentIsle);
                m.SetDirection(Direction.North);
                break;

            case 2:
                m.MoveToWorld(new Point3D(2040, 1389, 0), Map.SerpentIsle);
                m.SetDirection(Direction.East);
                break;

            case 3:
                m.MoveToWorld(new Point3D(1904, 1376, 0), Map.SerpentIsle);
                m.SetDirection(Direction.West);
                break;
            }

            //Restore player to full
            ((PlayerMobile)m).Hits   = m.HitsMax;
            ((PlayerMobile)m).Mana   = m.ManaMax;
            ((PlayerMobile)m).Stam   = m.StamMax;
            ((PlayerMobile)m).Hunger = 20;
            ((PlayerMobile)m).Thirst = 20;

            ((PlayerMobile)m).Paralyzed = false;
            ((PlayerMobile)m).Poison    = null;

            EvilOmenSpell.TryEndEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.RemoveCurse(m);
            MindRotSpell.ClearMindRotScalar(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);

            //Additionally, remove any polymorphs
            PolymorphSpell.EndPolymorph(m);
            StoneFormSpell.EndEffect(m);

            m.BodyMod = 0;
            m.HueMod  = -1;
        }
Ejemplo n.º 3
0
        public Spell GetMysticSpell()
        {
            Spell spell = null;

            switch (Utility.Random(8))
            {
            case 0:
            case 1:
            {
                if (this.CheckForSleep(this.m_Mobile.Combatant))
                {
                    this.m_Mobile.DebugSay("Casting Sleep");
                    spell = new SleepSpell(this.m_Mobile, null);
                    break;
                }
                else
                {
                    goto case 7;
                }
            }

            case 2:
            {
                if (this.m_Mobile.Followers < 2)
                {
                    int whichone = Utility.Random(3);

                    if (this.m_Mobile.Skills[SkillName.Mysticism].Value > 80.0 && whichone > 0)
                    {
                        this.m_Mobile.DebugSay("Casting Rising Colossus");
                        spell = new RisingColossusSpell(this.m_Mobile, null);
                    }
                    else if (this.m_Mobile.Skills[SkillName.Mysticism].Value > 30.0)
                    {
                        this.m_Mobile.DebugSay("Casting Animated Weapon");
                        spell = new AnimatedWeaponSpell(this.m_Mobile, null);
                    }
                }

                if (spell != null)
                {
                    break;
                }
                else
                {
                    goto case 7;
                }
            }

            case 3:
            {
                if (this.m_CanShapeShift && this.m_Mobile.Skills[SkillName.Mysticism].Value > 30.0)
                {
                    this.m_Mobile.DebugSay("Casting Stone Form");
                    spell = new StoneFormSpell(this.m_Mobile, null);
                    break;
                }
                else
                {
                    goto case 7;
                }
            }

            case 4:
            case 5:
            {
                if (!SpellPlagueSpell.HasSpellPlague(this.m_Mobile.Combatant) && this.m_Mobile.Skills[SkillName.Mysticism].Value > 70.0)
                {
                    this.m_Mobile.DebugSay("Casting Spell Plague");
                    spell = new SpellPlagueSpell(this.m_Mobile, null);
                    break;
                }
                else
                {
                    goto case 7;
                }
            }

            case 6:
            case 7:
            {
                switch (Utility.Random((int)(this.m_Mobile.Skills[SkillName.Mysticism].Value / 20)))
                {
                default:
                    spell = new NetherBoltSpell(this.m_Mobile, null);
                    break;

                case 1:
                    spell = new EagleStrikeSpell(this.m_Mobile, null);
                    break;

                case 2:
                    spell = new BombardSpell(this.m_Mobile, null);
                    break;

                case 3:
                    spell = new HailStormSpell(this.m_Mobile, null);
                    break;

                case 4:
                    spell = new NetherCycloneSpell(this.m_Mobile, null);
                    break;
                }

                break;
            }
            }

            return(spell);
        }
Ejemplo n.º 4
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.
            }
        }