Beispiel #1
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendAsciiMessage("Target is not in line of sight."); DoFizzle();//One line so i could use VS Replace, feel free to change/remove comment:p
            }
            else if (CheckBSequence(m))
            {
                if ((m.Player && m.Int <= 150 && m.Str <= 150 && m.Dex <= 150 && m.RawStatTotal <= 400) || (!m.Player))
                {
                    if (CurseSpell.UnderEffect(m))
                    {
                        bool message = true;

                        if (m.Str < m.RawStr)
                        {
                            m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Str));
                            message = false;
                        }
                        if (m.Dex < m.RawDex)
                        {
                            m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Dex));
                            message = false;
                        }
                        if (m.Int < m.RawInt)
                        {
                            m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Int));
                            message = false;
                        }

                        if (message)
                        {
                            m.SendAsciiMessage("You are under the effect of a curse spell and cannot get any stat bonuses");
                        }
                    }
                    else
                    {
                        SpellHelper.AddStatBonus(Caster, m, StatType.Str);
                        SpellHelper.DisableSkillCheck = true;
                        SpellHelper.AddStatBonus(Caster, m, StatType.Dex);
                        SpellHelper.AddStatBonus(Caster, m, StatType.Int);
                        SpellHelper.DisableSkillCheck = false;
                    }
                }

                m.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
                m.PlaySound(Sound);

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

                m_UnderEffect[m] = Timer.DelayCall(length, new TimerStateCallback(RemoveEffect), m);

                string args = String.Format("{0}\t{1}\t{2}", percentage, percentage, percentage);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Bless, 1075847, 1075848, length, m, args));
            }

            FinishSequence();
        }
        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
                {
                    if (from.Player && target.Player && !CurseSpell.UnderEffect(target))
                    {
                        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.PutUnderEffect(target, 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);
        }
Beispiel #3
0
        public virtual Spell GetRandomCurseSpell(Mobile c)
        {
            if (!CurseSpell.UnderEffect(c) && Utility.RandomBool())
            {
                if (m_Mobile.Skills[SkillName.Magery].Value >= 40.0)
                {
                    return(new CurseSpell(m_Mobile, null));
                }
            }

            switch (Utility.Random(3))
            {
            default:
            case 0: return(new WeakenSpell(m_Mobile, null));

            case 1: return(new ClumsySpell(m_Mobile, null));

            case 2: return(new FeeblemindSpell(m_Mobile, null));
            }
        }
Beispiel #4
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckBSequence(m))
            {
                if ((m.Player && m.Dex <= 120) || (!m.Player))
                {
                    if (CurseSpell.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 curse spell and cannot get any stat bonuses");
                        }
                    }
                    else
                    {
                        SpellHelper.AddStatBonus(Caster, m, StatType.Dex);
                    }
                }
                else
                {
                    m.SendAsciiMessage(33, "You are too fast to benefit from that!");
                    return;
                }

                m.FixedParticles(0x373A, 10, 15, 5010, EffectLayer.Waist);
                m.PlaySound(Sound);
            }

            FinishSequence();
        }
Beispiel #5
0
        public static int RemoveCurses(Mobile m)
        {
            int curseLevel = 0;

            if (SleepSpell.IsUnderSleepEffects(m))
            {
                SleepSpell.EndSleep(m);
                curseLevel += 2;
            }

            if (EvilOmenSpell.TryEndEffect(m))
            {
                curseLevel += 1;
            }

            if (StrangleSpell.RemoveCurse(m))
            {
                curseLevel += 2;
            }

            if (CorpseSkinSpell.RemoveCurse(m))
            {
                curseLevel += 3;
            }

            if (CurseSpell.UnderEffect(m))
            {
                CurseSpell.RemoveEffect(m);
                curseLevel += 4;
            }

            if (BloodOathSpell.RemoveCurse(m))
            {
                curseLevel += 3;
            }

            if (MindRotSpell.HasMindRotScalar(m))
            {
                MindRotSpell.ClearMindRotScalar(m);
                curseLevel += 2;
            }

            if (SpellPlagueSpell.HasSpellPlague(m))
            {
                SpellPlagueSpell.RemoveFromList(m);
                curseLevel += 4;
            }

            if (FeeblemindSpell.IsUnderEffects(m))
            {
                FeeblemindSpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (ClumsySpell.IsUnderEffects(m))
            {
                ClumsySpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (WeakenSpell.IsUnderEffects(m))
            {
                WeakenSpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (MortalStrike.IsWounded(m))
            {
                MortalStrike.EndWound(m);
                curseLevel += 2;
            }

            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);
            BuffInfo.RemoveBuff(m, BuffIcon.CorpseSkin);
            BuffInfo.RemoveBuff(m, BuffIcon.Strangle);
            BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);

            return(curseLevel);
        }
Beispiel #6
0
        public static int GetCursePower(Mobile m)
        {
            int power = 0;

            // 1st circle debuffs
            foreach (string statModName in StatModNames)
            {
                if (m.GetStatMod(statModName) != null)
                {
                    power += 1;
                }
            }

            // 3rd circle debuffs
            if (EvilOmenSpell.UnderEffect(m))
            {
                power += 3;
            }

            if (BloodOathSpell.UnderEffect(m))
            {
                power += 3;
            }

            if (CorpseSkinSpell.UnderEffect(m))
            {
                power += 3;
            }

            if (MindRotSpell.HasMindRotScalar(m))
            {
                power += 3;
            }

            if (SleepSpell.IsSlept(m))
            {
                power += 3;
            }

            // 4th circle debuffs
            if (CurseSpell.UnderEffect(m))
            {
                power += 4;
            }

            // 6th circle debuffs
            if (StrangleSpell.UnderEffect(m))
            {
                power += 6;
            }

            // 7th circle debuffs
            if (SpellPlagueSpell.UnderEffect(m))
            {
                power += 7;
            }

            if (MortalStrike.IsWounded(m))
            {
                power += 7;
            }

            return(power);
        }
Beispiel #7
0
        public static int GetTotalCurses(Mobile m)
        {
            int curses = 0;

            if (EvilOmenSpell.UnderEffects(m))
            {
                curses++;
            }

            if (StrangleSpell.UnderEffects(m))
            {
                curses++;
            }

            if (CorpseSkinSpell.IsUnderEffects(m))
            {
                curses++;
            }

            if (BloodOathSpell.GetBloodOath(m) != null)
            {
                curses++;
            }

            if (MindRotSpell.HasMindRotScalar(m))
            {
                curses++;
            }

            if (SpellPlagueSpell.HasSpellPlague(m))
            {
                curses++;
            }

            if (SleepSpell.IsUnderSleepEffects(m))
            {
                curses++;
            }

            if (CurseSpell.UnderEffect(m))
            {
                curses++;
            }

            if (FeeblemindSpell.IsUnderEffects(m))
            {
                curses++;
            }

            if (ClumsySpell.IsUnderEffects(m))
            {
                curses++;
            }

            if (WeakenSpell.IsUnderEffects(m))
            {
                curses++;
            }

            return(curses);
        }
        public override void OnTarget(Object o)
        {
            IPoint3D p = o as IPoint3D;

            if (p == null)
            {
                return;
            }

            if (CheckSequence())
            {
                List <Mobile> targets = new List <Mobile>();
                Party         party   = Party.Get(Caster);

                double prim = Caster.Skills[CastSkill].Value;
                double sec  = Caster.Skills[DamageSkill].Value;

                IPooledEnumerable eable = Caster.Map.GetMobilesInRange(new Point3D(p), 3);
                foreach (Mobile mob in eable)
                {
                    if (mob == null)
                    {
                        continue;
                    }

                    if (mob == Caster)
                    {
                        targets.Add(mob);
                    }

                    if (Caster.CanBeBeneficial(mob, false) && party != null && party.Contains(mob))
                    {
                        targets.Add(mob);
                    }
                }
                eable.Free();

                Mobile m;
                int    toheal = (int)(((prim + sec) / 2) * 0.3) - 6;
                Caster.PlaySound(0x64C);

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

                    if (!m.Alive)
                    {
                        continue;
                    }

                    if (m.Poisoned)
                    {
                        int level        = m.Poison.RealLevel + 1;
                        int chanceToCure = (10000 + (int)(((prim + sec) / 2) * 75) - (level * 1750)) / 100;

                        if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster))
                        {
                            toHealMod /= level;
                        }
                        else
                        {
                            toHealMod = 0;
                        }
                    }

                    if (MortalStrike.IsWounded(m))
                    {
                        MortalStrike.EndWound(m);
                        toHealMod = 0;
                    }

                    int curselevel = 0;

                    if (SleepSpell.IsUnderSleepEffects(m))
                    {
                        SleepSpell.EndSleep(m);
                        curselevel += 2;
                    }

                    if (EvilOmenSpell.TryEndEffect(m))
                    {
                        curselevel += 1;
                    }

                    if (StrangleSpell.RemoveCurse(m))
                    {
                        curselevel += 2;
                    }

                    if (CorpseSkinSpell.RemoveCurse(m))
                    {
                        curselevel += 3;
                    }

                    if (CurseSpell.UnderEffect(m))
                    {
                        CurseSpell.RemoveEffect(m);
                        curselevel += 4;
                    }

                    if (BloodOathSpell.RemoveCurse(m))
                    {
                        curselevel += 3;
                    }

                    if (MindRotSpell.HasMindRotScalar(m))
                    {
                        MindRotSpell.ClearMindRotScalar(m);
                        curselevel += 2;
                    }

                    if (SpellPlagueSpell.HasSpellPlague(m))
                    {
                        SpellPlagueSpell.RemoveFromList(m);
                        curselevel += 4;
                    }

                    if (m.GetStatMod("[Magic] Str Curse") != null)
                    {
                        m.RemoveStatMod("[Magic] Str Curse");
                        curselevel += 1;
                    }

                    if (m.GetStatMod("[Magic] Dex Curse") != null)
                    {
                        m.RemoveStatMod("[Magic] Dex Curse");
                        curselevel += 1;
                    }

                    if (m.GetStatMod("[Magic] Int Curse") != null)
                    {
                        m.RemoveStatMod("[Magic] Int Curse");
                        curselevel += 1;
                    }

                    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);
                    BuffInfo.RemoveBuff(m, BuffIcon.CorpseSkin);
                    BuffInfo.RemoveBuff(m, BuffIcon.Strangle);
                    BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);

                    if (toHealMod > 0 && curselevel > 0)
                    {
                        int toHealMod1 = toHealMod - (curselevel * 3);
                        int toHealMod2 = toHealMod - (int)((double)toHealMod * ((double)curselevel / 100));

                        toHealMod -= toHealMod1 + toHealMod2;
                    }

                    if (toHealMod > 0)
                    {
                        SpellHelper.Heal(toHealMod + Utility.RandomMinMax(1, 6), m, Caster);
                    }
                }
            }

            FinishSequence();
        }