Ejemplo n.º 1
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen.");
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Int);

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head);
                m.PlaySound(0x1E4);
            }

            FinishSequence();
        }
Ejemplo n.º 2
0
        public void Target(Mobile mobile)
        {
            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(mobile))
            {
                SpellHelper.Turn(Caster, mobile);
                SpellHelper.CheckReflect((int)this.Circle, Caster, ref mobile);
                SpellHelper.AddStatCurse(Caster, mobile, StatType.Str);

                CheckMagicResist(mobile);

                if (mobile.Spell != null)
                {
                    mobile.Spell.OnCasterHurt();
                }

                mobile.Paralyzed = false;

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Weaken);

                mobile.FixedParticles(0x3779, 10, 15, 5002, spellHue, 0, EffectLayer.Head);
                mobile.PlaySound(0x1E6);
            }

            FinishSequence();
        }
Ejemplo n.º 3
0
        public void Target(Mobile m)
        {
            if (!this.Caster.CanSee(m))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (this.CheckHSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, this.Caster, ref m);

                SpellHelper.AddStatCurse(this.Caster, m, StatType.Str);
                int      percentage = (int)(SpellHelper.GetOffsetScalar(this.Caster, m, true) * 100);
                TimeSpan length     = SpellHelper.GetDuration(this.Caster, m);
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Weaken, 1075837, length, m, percentage.ToString()));

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist);
                m.PlaySound(0x1E6);

                this.HarmfulSpell(m);

                m_Table[m] = Timer.DelayCall <Mobile>(length, RemoveEffects, m);
            }

            this.FinishSequence();
        }
Ejemplo n.º 4
0
        public static void DoCurse(Mobile caster, Mobile m)
        {
            SpellHelper.AddStatCurse(caster, m, StatType.Str);
            SpellHelper.DisableSkillCheck = true;
            SpellHelper.AddStatCurse(caster, m, StatType.Dex);
            SpellHelper.AddStatCurse(caster, m, StatType.Int);
            SpellHelper.DisableSkillCheck = false;

            int      percentage = (int)(SpellHelper.GetOffsetScalar(caster, m, true) * 100);
            TimeSpan length     = SpellHelper.GetDuration(caster, m);
            string   args       = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", percentage, percentage, percentage, 10, 10, 10, 10);

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Curse, 1075835, 1075836, length, m, args.ToString()));

            Timer t = (Timer)m_UnderEffect[m];

            if (caster.Player && m.Player /*&& Caster != m */ && t == null)                //On OSI you CAN curse yourself and get this effect.
            {
                TimeSpan duration = SpellHelper.GetDuration(caster, m);
                m_UnderEffect[m] = t = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), m);
                m.UpdateResistances();
            }

            if (m.Spell != null)
            {
                m.Spell.OnCasterHurt();
            }

            m.Paralyzed = false;

            m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
            m.PlaySound(0x1E1);
        }
Ejemplo n.º 5
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target can not be seen.");                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Dex);

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                m.PlaySound(0x1DF);

                int      percentage = (int)((Caster.Skills[SkillName.Magery].Value / 10) + 1);
                TimeSpan length     = TimeSpan.FromSeconds((6 * Caster.Skills[SkillName.Magery].Value / 5) + 1);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Clumsy, 1075831, length, m, percentage.ToString()));
            }

            FinishSequence();
        }
Ejemplo n.º 6
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (SphereSpellTarget is BaseWand)
            {
                BaseWand bw = SphereSpellTarget as BaseWand;
                bw.RechargeWand(Caster, this);
            }
            else if (CheckSequence())
            {
                SpellHelper.GetSurfaceTop(ref p);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 5);

                    foreach (Mobile m in eable)
                    {
                        if (Core.AOS && m == Caster)
                        {
                            continue;
                        }

                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m) && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = (Mobile)targets[i];

                    if (m.Player || !m.Player)
                    {
                        SpellHelper.AddStatCurse(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                        SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                        SpellHelper.AddStatCurse(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;
                    }

                    Caster.DoHarmful(m);
                    m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                    m.PlaySound(Sound);

                    HarmfulSpell(m);
                }
            }

            FinishSequence();
        }
Ejemplo n.º 7
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Str);

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5009, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.Waist);
                m.PlaySound(0x1E6);

                int      percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                TimeSpan length     = SpellHelper.GetDuration(Caster, m);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Weaken, 1075837, length, m, percentage.ToString()));

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Ejemplo n.º 8
0
        public override void OnCast()
        {
            if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); //f**k off, etc.
                goto Return;
            }

            if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); //no
                goto Return;
            }

            if (!Caster.CanBeginAction(typeof(LicheFormSpell)))
            {
                Caster.SendLocalizedMessage(1005559); //no
                goto Return;
            }

            if (!CheckSequence())
            {
                goto Return;
            }

            double dexmod = Caster.RawDex / 2;
            double strmod = Caster.RawStr / 2;
            double intmod = Caster.RawInt * 2;

            if (Spec.GetSpec(Caster).SpecName == SpecName.Mage)
            {
                var bonus = Spec.GetSpec(Caster).Bonus;
                dexmod /= bonus;
                strmod /= bonus;
                intmod *= bonus;
            }

            var newBody = 0x18;

            //hocus pocus... SpellHelper sets its own timers, we only need to clean up after the hue and body mods --sith
            Caster.BodyMod = newBody;
            Caster.HueMod  = 0;
            SpellHelper.AddStatBonus(Caster, Caster, StatType.Int, (int)intmod,
                                     TimeSpan.FromSeconds(Caster.Skills[DamageSkill].Value * 5));
            SpellHelper.AddStatCurse(Caster, Caster, StatType.Dex, (int)dexmod,
                                     TimeSpan.FromSeconds(Caster.Skills[DamageSkill].Value * 5));
            SpellHelper.AddStatCurse(Caster, Caster, StatType.Str, (int)strmod,
                                     TimeSpan.FromSeconds(Caster.Skills[DamageSkill].Value * 5));

            Caster.PlaySound(0x202);

            //polymorph calls these... do we need to? --sith
            BaseArmor.ValidateMobile(Caster);
            BaseClothing.ValidateMobile(Caster);

            new InternalTimer(Caster).Start();

Return:
            FinishSequence();
        }
Ejemplo n.º 9
0
        public static void ApplyEffect(Mobile Caster, Mobile mobile)
        {
            SpellHelper.AddStatCurse(Caster, mobile, StatType.Str); SpellHelper.DisableSkillCheck = true;
            SpellHelper.AddStatCurse(Caster, mobile, StatType.Dex);
            SpellHelper.AddStatCurse(Caster, mobile, StatType.Int); SpellHelper.DisableSkillCheck = false;

            Timer t = (Timer)m_UnderEffect[mobile];

            if (Caster.Player && mobile.Player && t == null)
            {
                TimeSpan duration = SpellHelper.GetDuration(Caster, mobile);
                m_UnderEffect[mobile] = t = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), mobile);
                mobile.UpdateResistances();
            }

            if (mobile.Spell != null)
            {
                mobile.Spell.OnCasterHurt();
            }

            mobile.Paralyzed = false;

            int spellHue = PlayerEnhancementPersistance.GetSpellHueFor(Caster, HueableSpell.Curse);

            mobile.FixedParticles(0x374A, 10, 15, 5028, spellHue, 0, EffectLayer.Waist);
            mobile.PlaySound(0x1E1);
        }
Ejemplo n.º 10
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Dex);

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                m.PlaySound(0x1DF);

                int      percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                TimeSpan length     = SpellHelper.GetDuration(Caster, m);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Clumsy, 1075831, length, m, percentage.ToString()));
            }

            FinishSequence();
        }
Ejemplo n.º 11
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int) Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Str);

                if (m.Spell != null)
                    m.Spell.OnCasterHurt();

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist);
                m.PlaySound(0x1E6);

                var percentage = (int) (SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                var length = SpellHelper.GetDuration(Caster, m);

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Ejemplo n.º 12
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                if (SpellHelper.AddStatCurse(Caster, m, StatType.Str))
                {
                    m.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist);
                    m.PlaySound(0x1E6);
                }
                else
                {
                    Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632); // The spell fizzles.
                    Caster.FixedEffect(0x3735, 6, 30);
                    Caster.PlaySound(0x5C);
                }

                m.Paralyzed = false;
            }

            FinishSequence();
        }
Ejemplo n.º 13
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                SpellHelper.AddStatCurse(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

                Timer t = (Timer)UnderEffect[m];

                if (Caster.Player && m.Player && t == null)
                {
                    TimeSpan duration = SpellHelper.GetDuration(Caster, m);
                    UnderEffect[m] = t = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), m);
                    m.UpdateResistances();
                }

                m.Paralyzed = false;

                m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                m.PlaySound(0x1EA);
            }

            FinishSequence();
        }
Ejemplo n.º 14
0
        public void DoCurse(Mobile m)
        {
            SpellHelper.Turn(Caster, m);

            SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

            SpellHelper.AddStatCurse(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
            SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
            SpellHelper.AddStatCurse(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

            Timer t = (Timer)m_UnderEffect[m];

            if (t == null)
            {
                TimeSpan duration = ComputeDuration(Caster, m);

                int    percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                string buffFormat = String.Format("{0}\t{0}\t{0}\t{1}\t{1}\t{1}\t{1}", percentage, 10);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Curse, 1075835, duration, m, buffFormat));

                m_UnderEffect[m] = t = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), m);
                m.UpdateResistances();
            }

            if (m.Spell != null)
            {
                m.Spell.OnCasterHurt();
            }

            m.Paralyzed = false;

            m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
            m.PlaySound(0x1E1);
        }
Ejemplo n.º 15
0
        public static bool DoCurse(Mobile caster, Mobile m, bool masscurse)
        {
            if (Mysticism.StoneFormSpell.CheckImmunity(m))
            {
                caster.SendLocalizedMessage(1080192); // Your target resists your ability reduction magic.
                return(true);
            }

            int oldStr = SpellHelper.GetCurseOffset(m, StatType.Str);
            int oldDex = SpellHelper.GetCurseOffset(m, StatType.Dex);
            int oldInt = SpellHelper.GetCurseOffset(m, StatType.Int);

            int newStr = SpellHelper.GetOffset(caster, m, StatType.Str, true, true);
            int newDex = SpellHelper.GetOffset(caster, m, StatType.Dex, true, true);
            int newInt = SpellHelper.GetOffset(caster, m, StatType.Int, true, true);

            if ((-newStr > oldStr && -newDex > oldDex && -newInt > oldInt) ||
                (newStr == 0 && newDex == 0 && newInt == 0))
            {
                return(false);
            }

            SpellHelper.AddStatCurse(caster, m, StatType.Str, false);
            SpellHelper.AddStatCurse(caster, m, StatType.Dex, true);
            SpellHelper.AddStatCurse(caster, m, StatType.Int, true);

            int      percentage             = (int)(SpellHelper.GetOffsetScalar(caster, m, true) * 100);
            TimeSpan length                 = SpellHelper.GetDuration(caster, m);
            var      ssDurationBonusSeconds = caster.Skills[SkillName.SpiritSpeak].Value;

            length.Add(TimeSpan.FromSeconds(ssDurationBonusSeconds));

            string args;

            if (masscurse)
            {
                args = String.Format("{0}\t{0}\t{0}", percentage);
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.MassCurse, 1075839, length, m, args));
            }
            else
            {
                args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", percentage, percentage, percentage, 10, 10, 10, 10);
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Curse, 1075835, 1075836, length, m, args.ToString()));
            }

            AddEffect(m, SpellHelper.GetDuration(caster, m), oldStr, oldDex, oldInt);

            if (m.Spell != null)
            {
                m.Spell.OnCasterHurt();
            }

            m.Paralyzed = false;

            m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
            m.PlaySound(0x1E1);

            return(true);
        }
Ejemplo n.º 16
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    var eable = map.GetMobilesInRange(new Point3D(p), 2);

                    foreach (Mobile m in eable)
                    {
                        if (m == Caster)
                        {
                            continue;
                        }

                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m) && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);
                        }
                    }
                }

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = targets[i];

                    Caster.DoHarmful(m);

                    SpellHelper.AddStatCurse(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                    SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                    SpellHelper.AddStatCurse(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

                    m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                    m.PlaySound(0x1FB);

                    TimeSpan duration = SpellHelper.GetDuration(Caster, m);

                    int    percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                    string buffFormat = String.Format("{0}\t{0}\t{0}", percentage);

                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.MassCurse, 1075839, duration, m, buffFormat));
                }
            }

            FinishSequence();
        }
Ejemplo n.º 17
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);
                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);

                    foreach (Mobile m in eable)
                    {
                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m) && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.MassCurse);

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile mobile = targets[i];

                    CheckMagicResist(mobile);

                    Caster.DoHarmful(mobile);

                    SpellHelper.AddStatCurse(Caster, mobile, StatType.Str);
                    SpellHelper.AddStatCurse(Caster, mobile, StatType.Dex);
                    SpellHelper.AddStatCurse(Caster, mobile, StatType.Int);

                    if (mobile.Spell != null)
                    {
                        mobile.Spell.OnCasterHurt();
                    }

                    mobile.Paralyzed = false;

                    mobile.FixedParticles(0x374A, 10, 15, 5028, spellHue, 0, EffectLayer.Waist);
                    mobile.PlaySound(0x1FB);
                }
            }

            FinishSequence();
        }
Ejemplo n.º 18
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (!CheckLineOfSight(p))
            {
                this.DoFizzle();
                Caster.SendAsciiMessage("Target is not in line of sight");
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2);

                    foreach (Mobile m in eable)
                    {
                        if (Core.AOS && m == Caster)
                        {
                            continue;
                        }

                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m) && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = targets[i];

                    Caster.DoHarmful(m);

                    SpellHelper.AddStatCurse(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                    SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                    SpellHelper.AddStatCurse(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

                    m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                    m.PlaySound(0x1FB);
                }
            }

            FinishSequence();
        }
Ejemplo n.º 19
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);
                SpellHelper.CheckReflect(this, Caster, ref m);

                if (Mysticism.StoneFormSpell.CheckImmunity(m))
                {
                    Caster.SendLocalizedMessage(1080192); // Your target resists your ability reduction magic.
                    return;
                }

                int oldOffset = SpellHelper.GetCurseOffset(m, StatType.Int);
                int newOffset = SpellHelper.GetOffset(Caster, m, StatType.Int, true, false);

                if (-newOffset > oldOffset || newOffset == 0)
                {
                    DoHurtFizzle();
                }
                else
                {
                    m.Spell?.OnCasterHurt();

                    m.Paralyzed = false;

                    m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                    m.PlaySound(0x1DF);

                    HarmfulSpell(m);

                    if (-newOffset < oldOffset)
                    {
                        SpellHelper.AddStatCurse(Caster, m, StatType.Int, false, newOffset);

                        int      percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                        TimeSpan length     = SpellHelper.GetDuration(Caster, m);
                        BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.FeebleMind, 1075833, length, m, percentage.ToString()));

                        if (m_Table.ContainsKey(m))
                        {
                            m_Table[m].Stop();
                        }

                        m_Table[m] = Timer.DelayCall(length, () =>
                        {
                            RemoveEffects(m);
                        });
                    }
                }
            }

            FinishSequence();
        }
Ejemplo n.º 20
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendAsciiMessage("Target can not be seen.");                   // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2);

                    foreach (Mobile m in eable)
                    {
                        if (Core.AOS && m == Caster)
                        {
                            continue;
                        }

                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m) && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = targets[i];

                    Caster.DoHarmful(m);


                    SpellHelper.AddStatCurse(Caster, m, StatType.Str, (int)((Caster.Skills[SkillName.Magery].Value / 10) + 1), TimeSpan.FromSeconds((6 * Caster.Skills[SkillName.Magery].Value / 5) + 1)); //SpellHelper.DisableSkillCheck = true;
                    SpellHelper.AddStatCurse(Caster, m, StatType.Dex, (int)((Caster.Skills[SkillName.Magery].Value / 10) + 1), TimeSpan.FromSeconds((6 * Caster.Skills[SkillName.Magery].Value / 5) + 1));
                    SpellHelper.AddStatCurse(Caster, m, StatType.Int, (int)((Caster.Skills[SkillName.Magery].Value / 10) + 1), TimeSpan.FromSeconds((6 * Caster.Skills[SkillName.Magery].Value / 5) + 1)); //SpellHelper.DisableSkillCheck = false;


                    m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                    m.PlaySound(0x1FB);
                }
            }

            FinishSequence();
        }
Ejemplo n.º 21
0
        public void Target(Mobile m)
        {
            if (m == null)
            {
                return;
            }

            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Str);
                SpellHelper.DisableSkillCheck = true;
                SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                SpellHelper.AddStatCurse(Caster, m, StatType.Int);
                SpellHelper.DisableSkillCheck = false;

                if (Caster.Player && m.Player /*&& Caster != m */ && !UnderEffect(m)
                    ) // On OSI you CAN curse yourself and get this effect.
                {
                    var duration = SpellHelper.GetDuration(Caster, m);
                    m_UnderEffect.Add(m);
                    Timer.DelayCall(duration, RemoveEffect, m);
                    m.UpdateResistances();
                }

                m.Spell?.OnCasterHurt();

                m.Paralyzed = false;

                m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                m.PlaySound(0x1E1);

                var percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                var length     = SpellHelper.GetDuration(Caster, m);

                var args = $"{percentage}\t{percentage}\t{percentage}\t{10}\t{10}\t{10}\t{10}";

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Curse, 1075835, 1075836, length, m, args));

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Ejemplo n.º 22
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                SpellHelper.AddStatCurse(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

                Timer t = (Timer)m_UnderEffect[m];

                if (Caster.Player && m.Player /*&& Caster != m */ && t == null)                         //On OSI you CAN curse yourself and get this effect.
                {
                    TimeSpan duration = SpellHelper.GetDuration(Caster, m);
                    m_UnderEffect[m] = t = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), m);
                    m.UpdateResistances();
                }

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                m.PlaySound(0x1E1);

                int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                int bardic     = Caster.Skills[SkillName.Musicianship].Fixed;
                bardic     += Caster.Skills[SkillName.Provocation].Fixed;
                bardic     += Caster.Skills[SkillName.Discordance].Fixed;
                percentage += bardic / 24;
                TimeSpan length = SpellHelper.GetDuration(Caster, m);

                string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", percentage, percentage, percentage, 10, 10, 10, 10);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Curse, 1075835, 1075836, length, m, args.ToString()));

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Ejemplo n.º 23
0
        public void MassCurse()
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            ArrayList targets = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(15))
            {
                if (m == this || !this.CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))
                {
                    targets.Add(m);
                }
                else if (m.Player)
                {
                    targets.Add(m);
                }
            }

            for (int i = 0; i < targets.Count; ++i)
            {
                Mobile m = (Mobile)targets[i];

                this.DoHarmful(m);

                SpellHelper.AddStatCurse(this, m, StatType.Str);
                SpellHelper.DisableSkillCheck = true;
                SpellHelper.AddStatCurse(this, m, StatType.Dex);
                SpellHelper.AddStatCurse(this, m, StatType.Int);
                SpellHelper.DisableSkillCheck = false;

                m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                m.PlaySound(0x1FB);
                int      percentage = (int)(SpellHelper.GetOffsetScalar(this, m, true) * 100);
                TimeSpan length     = SpellHelper.GetDuration(this, m);

                string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", percentage, percentage, percentage, 10, 10, 10, 10);
                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Curse, 1075835, 1075836, length, m, args.ToString()));
                m.SendMessage("You have been cursed!");
            }
        }
Ejemplo n.º 24
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)Circle, Caster, ref m);

                int oldOffset = SpellHelper.GetCurseOffset(m, StatType.Int);
                SpellHelper.AddStatCurse(Caster, m, StatType.Int, false);
                int newOffset = SpellHelper.GetCurseOffset(m, StatType.Int);

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head);
                m.PlaySound(0x1E4);

                HarmfulSpell(m);

                if (newOffset < oldOffset)
                {
                    int      percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
                    TimeSpan length     = SpellHelper.GetDuration(Caster, m);

                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.FeebleMind, 1075833, length, m, percentage.ToString()));

                    if (m_Table.ContainsKey(m))
                    {
                        m_Table[m].Stop();
                    }

                    m_Table[m] = Timer.DelayCall(length, () =>
                    {
                        RemoveEffects(m);
                    });
                }
            }

            FinishSequence();
        }
Ejemplo n.º 25
0
        public override bool DoEffect(Mobile from, Mobile target)
        {
            bool result = false;

            if (!SpellHelper.HasStatEffect(target, m_Stat) && from.CanSee(target) && from.InLOS(target) && target.Alive && from.CanBeHarmful(target))
            {
                from.DoHarmful(target);
                SpellHelper.Turn(from, target);

                SpellHelper.CheckReflect(2, from, ref target);

                if (m_Stat != StatType.All)
                {
                    SpellHelper.AddStatCurse(null, target, m_Stat);
                    result = true;
                }
                else
                {
                    Timer t = (Timer)CurseSpell.UnderEffect[target];
                    if (from.Player && target.Player && t == null)
                    {
                        SpellHelper.AddStatCurse(null, target, StatType.Str); SpellHelper.DisableSkillCheck = true;
                        SpellHelper.AddStatCurse(null, target, StatType.Dex);
                        SpellHelper.AddStatCurse(null, target, StatType.Int); SpellHelper.DisableSkillCheck = false;

                        TimeSpan duration = SpellHelper.GetDuration(from, target);
                        CurseSpell.UnderEffect[target] = t = Timer.DelayCall(duration, new TimerStateCallback(CurseSpell.RemoveEffect), target);
                        target.UpdateResistances();

                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }

                if (result)
                {
                    target.Paralyzed = false;

                    target.FixedParticles(m_EffIID, m_EffSpd, m_Dur, m_Eff, m_ELayer);
                    target.PlaySound(m_Snd);
                }
            }

            return(result);
        }
Ejemplo n.º 26
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable <Mobile> eable = map.GetMobilesInRange(new Point3D(p), 2);

                    foreach (Mobile m in eable)
                    {
                        if (Core.AOS && (m == Caster || !SpellHelper.ValidIndirectTarget(Caster, m) || !Caster.CanSee(m) ||
                                         !Caster.CanBeHarmful(m, false)))
                        {
                            continue;
                        }

                        Caster.DoHarmful(m);

                        SpellHelper.AddStatCurse(Caster, m, StatType.Str);
                        SpellHelper.DisableSkillCheck = true;
                        SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                        SpellHelper.AddStatCurse(Caster, m, StatType.Int);
                        SpellHelper.DisableSkillCheck = false;

                        m.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                        m.PlaySound(0x1FB);

                        HarmfulSpell(m);
                    }

                    eable.Free();
                }
            }

            FinishSequence();
        }
Ejemplo n.º 27
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                Map map = m_Owner.Map;

                if (map == null)
                {
                    return;
                }

                if (0.2 > Utility.RandomDouble())
                {
                    return;
                }

                Mobile toCurse = null;

                foreach (Mobile m in m_Owner.GetMobilesInRange(6))
                {
                    if (m != m_Owner && m.IsPlayer && m_Owner.CanBeHarmful(m) && m_Owner.CanSee(m) && m.Region == m_Owner.Region)
                    {
                        toCurse = m;
                        break;
                    }
                }

                if (toCurse != null && !UnderEffect(toCurse))
                {
                    Timer t = (Timer)m_UnderEffect[toCurse];
                    m_UnderEffect[toCurse] = t = Timer.DelayCall(TimeSpan.FromSeconds(60.0), new TimerStateCallback(RemoveEffect), toCurse);

                    SpellHelper.AddStatCurse(m_Owner, toCurse, StatType.Str, 20, TimeSpan.FromSeconds(50.0));
                    SpellHelper.AddStatCurse(m_Owner, toCurse, StatType.Dex, 20, TimeSpan.FromSeconds(50.0));
                    SpellHelper.AddStatCurse(m_Owner, toCurse, StatType.Int, 20, TimeSpan.FromSeconds(50.0));

                    toCurse.SendLocalizedMessage(1072067);                       // A wave of hopelessness washes over you, suppressing your ability to react in combat.
                }
            }
Ejemplo n.º 28
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                // Seems like this should be responsibility of the targetting system.  --daleron
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
                goto Return;
            }

            if (!CheckSequence()) goto Return;

            SpellHelper.Turn(Caster, m);

            m.FixedParticles(0x3709, 10, 15, 5021, EffectLayer.Waist); //probably wrong particles ID
            m.PlaySound(0x20e);

            Caster.DoHarmful(m);

            //yeah lots of casting is ugly but... f**k it :^)
            var dmg =
                (double) Utility.Dice((uint) (Caster.Skills[DamageSkill].Value / 15.0), 5,
                    0); //caps around 20 damage at 130 skill

            if (CheckResisted(m))
            {
                dmg *= 0.75;

                m.SendLocalizedMessage(501783);
            }

            //m.Damage((int)dmg, Caster, ElementalType.Earth);
            SpellHelper.Damage(dmg, m, Caster, this, TimeSpan.Zero);

            SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
            var percentage = (int) (SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
            var length = SpellHelper.GetDuration(Caster, m);

            // BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Clumsy, 1075831, length, m, percentage.ToString()));

            Return:
            FinishSequence();
        }
Ejemplo n.º 29
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.CheckReflect((int)Circle, Caster, ref m);

                if (BlessSpell.UnderEffect(m))
                {
                    if (m.Dex > m.RawDex)
                    {
                        m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Dex));
                    }
                    else
                    {
                        m.SendAsciiMessage("You are under the effect of a bless spell and cannot get any stat penalties");
                    }
                }
                else
                {
                    SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                }

                m.FixedParticles(0x374A, 10, 15, 5002, EffectLayer.Head);
                m.PlaySound(Sound);

                //Any better way for this? //Clumsy is supposed to be a harmfull spell
                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                HarmfulSpell(m);
            }

            FinishSequence();
        }
Ejemplo n.º 30
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                SpellHelper.AddStatCurse(Caster, m, StatType.Dex);

                m.Paralyzed = false;

                m.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                m.PlaySound(0x1DF);
            }

            FinishSequence();
        }