示例#1
0
        private void RemoveCurses(Mobile m)
        {
            StatMod mod;

            foreach (var statModName in StatModNames)
            {
                mod = m.GetStatMod(statModName);
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod(statModName);
                }
            }

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.EndEffect(m);
            SpellPlagueSpell.RemoveEffect(m);
            SleepSpell.RemoveEffect(m);
            MindRotSpell.ClearMindRotScalar(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);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Sleep);
            BuffInfo.RemoveBuff(m, BuffIcon.MassSleep);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
        }
示例#2
0
 private void EndTimer()
 {
     this.Stop();
     SpellPlagueSpell.RemoveFromList(m_Owner);
 }
示例#3
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);
        }
示例#4
0
 public InternalTarget(SpellPlagueSpell owner, bool allowland)
     : base(12, allowland, TargetFlags.Harmful)
 {
     Owner = owner;
 }
示例#5
0
 public InternalTarget(SpellPlagueSpell owner)
     : this(owner, false)
 {
 }
示例#6
0
 public InternalTarget(SpellPlagueSpell owner)
     : base(12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
示例#7
0
 public SpellPlagueContext(SpellPlagueSpell owner, Mobile target)
 {
     m_Owner  = owner;
     m_Target = target;
 }
示例#8
0
 public InternalTarget(SpellPlagueSpell owner, bool allowland, TargetFlags flags)
     : base(12, allowland, flags)
 {
     Owner = owner;
 }
示例#9
0
 public InternalTarget(SpellPlagueSpell owner, TargetFlags flags)
     : this(owner, false, flags)
 {
 }
示例#10
0
 public SpellPlagueContext( SpellPlagueSpell owner, Mobile target )
 {
     m_Owner = owner;
     m_Target = target;
 }
示例#11
0
 public InternalTarget( SpellPlagueSpell owner )
     : base(12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
示例#12
0
        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();
        }