示例#1
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_Combo == 0)
            {
                spell   = new ExplosionSpell(m_Mobile, null);
                m_Combo = 4;                 // Move to next spell
            }

            if (m_Combo == 3 && spell == null)
            {
                switch (Utility.Random(2))
                {
                default:
                case 0:
                {
                    spell   = new EnergyBoltSpell(m_Mobile, null);
                    m_Combo = -1;                             // Reset combo state
                    break;
                }

                case 1:
                {
                    spell   = new FlameStrikeSpell(m_Mobile, null);
                    m_Combo = -1;                             // Reset combo state
                    break;
                }
                }
            }
            else if (m_Combo == 4 && spell == null)
            {
                spell   = new MindBlastSpell(m_Mobile, null);
                m_Combo = -1;
            }

            return(spell);
        }
示例#2
0
        public virtual Spell GetRandomDamageSpell(Mobile c)
        {
            int maxCircle = (int)((m_Mobile.Skills[SkillName.Magery].Value + 20.0) / (100.0 / 7.0));

            if (maxCircle < 1)
            {
                maxCircle = 1;
            }

            Spell spell = null;

            switch (Utility.Random(maxCircle * 2))
            {
            case 0:
            case 1: spell = new MagicArrowSpell(m_Mobile, null); break;

            case 2:
            case 3: spell = new HarmSpell(m_Mobile, null); break;

            case 4:
            case 5: spell = new FireballSpell(m_Mobile, null); break;

            case 6:
            case 7: spell = new LightningSpell(m_Mobile, null); break;

            case 8:
            case 9: spell = new MindBlastSpell(m_Mobile, null); break;

            case 10: spell = new EnergyBoltSpell(m_Mobile, null); break;

            case 11: spell = new ExplosionSpell(m_Mobile, null); break;

            default: spell = new FlameStrikeSpell(m_Mobile, null); break;
            }
            return(spell);
        }
示例#3
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_Combo == 0)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                ++m_Combo;                 // Move to next spell
            }
            else if (m_Combo == 1)
            {
                spell = new WeakenSpell(m_Mobile, null);
                ++m_Combo;                 // Move to next spell
            }
            else if (m_Combo == 2)
            {
                if (!c.Poisoned)
                {
                    spell = new PoisonSpell(m_Mobile, null);
                }

                ++m_Combo;                 // Move to next spell
            }

            if (m_Combo == 3 && spell == null)
            {
                switch (Utility.Random(3))
                {
                default:
                case 0:
                {
                    if (c.Int < c.Dex)
                    {
                        spell = new FeeblemindSpell(m_Mobile, null);
                    }
                    else
                    {
                        spell = new ClumsySpell(m_Mobile, null);
                    }

                    ++m_Combo;                                     // Move to next spell

                    break;
                }

                case 1:
                {
                    spell   = new EnergyBoltSpell(m_Mobile, null);
                    m_Combo = -1;                                     // Reset combo state
                    break;
                }

                case 2:
                {
                    spell   = new FlameStrikeSpell(m_Mobile, null);
                    m_Combo = -1;                                     // Reset combo state
                    break;
                }
                }
            }
            else if (m_Combo == 4 && spell == null)
            {
                spell   = new MindBlastSpell(m_Mobile, null);
                m_Combo = -1;
            }

            return(spell);
        }
示例#4
0
文件: MageAI.cs 项目: pallop/Servuo
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_ComboType == ComboType.None)
            {
                m_ComboType = (ComboType)Utility.RandomMinMax(1, 7);
            }

            if (m_Combo == 1)
            {
                switch (m_ComboType)
                {
                case ComboType.Exp_FS_Poison:
                case ComboType.Exp_MB_Poison:
                case ComboType.Exp_EB_Poison:
                case ComboType.Exp_FB_MA_Poison:
                case ComboType.Exp_FB_Poison_Light:
                case ComboType.Exp_FB_MA_Light:
                case ComboType.Exp_Poison_FB_Light: spell = new ExplosionSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 2)
            {
                switch (m_ComboType)
                {
                case ComboType.Exp_FS_Poison: spell = new FlameStrikeSpell(m_Mobile, null); break;

                case ComboType.Exp_MB_Poison: spell = new MindBlastSpell(m_Mobile, null); break;

                case ComboType.Exp_EB_Poison: spell = new EnergyBoltSpell(m_Mobile, null); break;

                case ComboType.Exp_FB_MA_Poison: spell = new FireballSpell(m_Mobile, null); break;

                case ComboType.Exp_FB_Poison_Light: spell = new FireballSpell(m_Mobile, null); break;

                case ComboType.Exp_FB_MA_Light: spell = new FireballSpell(m_Mobile, null); break;

                case ComboType.Exp_Poison_FB_Light: spell = new PoisonSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 3)
            {
                switch (m_ComboType)
                {
                case ComboType.Exp_FS_Poison:
                case ComboType.Exp_MB_Poison:
                case ComboType.Exp_EB_Poison:
                    spell = new PoisonSpell(m_Mobile, null);
                    EndCombo();
                    return(spell);

                case ComboType.Exp_FB_MA_Poison: spell = new MagicArrowSpell(m_Mobile, null); break;

                case ComboType.Exp_FB_Poison_Light: spell = new PoisonSpell(m_Mobile, null); break;

                case ComboType.Exp_FB_MA_Light: spell = new MagicArrowSpell(m_Mobile, null); break;

                case ComboType.Exp_Poison_FB_Light: spell = new FireballSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 4)
            {
                switch (m_ComboType)
                {
                case ComboType.Exp_FS_Poison:
                case ComboType.Exp_MB_Poison:
                case ComboType.Exp_EB_Poison:
                    spell = new LightningSpell(m_Mobile, null);
                    EndCombo();
                    return(spell);

                case ComboType.Exp_FB_MA_Poison: spell = new PoisonSpell(m_Mobile, null); break;

                case ComboType.Exp_FB_Poison_Light:
                case ComboType.Exp_FB_MA_Light:
                case ComboType.Exp_Poison_FB_Light: spell = new LightningSpell(m_Mobile, null);
                    EndCombo();
                    return(spell);
                }
            }
            else if (m_Combo == 5)
            {
                switch (m_ComboType)
                {
                case ComboType.Exp_FS_Poison:
                case ComboType.Exp_MB_Poison:
                case ComboType.Exp_EB_Poison:
                case ComboType.Exp_FB_MA_Poison:
                case ComboType.Exp_FB_Poison_Light:
                case ComboType.Exp_FB_MA_Light:
                case ComboType.Exp_Poison_FB_Light:
                    spell = new LightningSpell(m_Mobile, null);
                    EndCombo();
                    return(spell);
                }
            }

            m_Combo++; // Move to next spell

            if (spell == null)
            {
                spell = new PoisonSpell(m_Mobile, null);
            }

            return(spell);
        }
示例#5
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_Combo == 0)
            {
                spell = new FlameStrikeSpell(m_Mobile, null);
                ++m_Combo;                 // Move to next spell
            }
            else if (m_Combo == 1)
            {
                spell = new WitherSpell(m_Mobile, null);
                ++m_Combo;                 // Move to next spell
            }
            else if (m_Combo == 2)
            {
                if (!c.Poisoned)
                {
                    spell = new PoisonSpell(m_Mobile, null);
                }

                ++m_Combo;                 // Move to next spell
            }

            if (m_Combo == 3 && spell == null)
            {
                switch (Utility.Random(3))
                {
                default:
                case 0:
                {
                    if (c.Int < c.Dex)
                    {
                        spell = new MindRotSpell(m_Mobile, null);
                    }
                    else
                    {
                        spell = new WitherSpell(m_Mobile, null);
                    }

                    ++m_Combo;                             // Move to next spell

                    break;
                }

                case 1:
                {
                    spell   = new StrangleSpell(m_Mobile, null);
                    m_Combo = -1;                             // Reset combo state
                    break;
                }

                case 2:
                {
                    spell   = new WitherSpell(m_Mobile, null);
                    m_Combo = -1;                             // Reset combo state
                    break;
                }
                }
            }
            else if (m_Combo == 4 && spell == null)
            {
                spell   = new VengefulSpiritSpell(m_Mobile, null);
                m_Combo = -1;
            }

            return(spell);
        }
示例#6
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            m_Mobile.DebugSay("Doing Combo");
            if (m_Combo == 0)
            {
                m_Mobile.DebugSay(" Casting Explosion and moving to the next spell ");
                spell = new ExplosionSpell(m_Mobile, null);
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 1)
            {
                if (m_Mobile.Skills[SkillName.Magery].Value * Utility.RandomDouble() > m_Mobile.Skills[SkillName.Necromancy].Value * Utility.RandomDouble())
                {
                    spell = new FlameStrikeSpell(m_Mobile, null);
                    m_Mobile.DebugSay("Casting Flamestrike and moving to the next spell ");
                }
                else
                {
                    spell = new PoisonStrikeSpell(m_Mobile, null);
                    m_Mobile.DebugSay("Casting Poison Strike and moving to the next spell ");
                }
                ++m_Combo;     // Move to next spell
            }
            else if (m_Combo == 2)
            {
                m_Mobile.DebugSay("Casting maybe poison and moving to next spell");
                if (!c.Poisoned && (!(c is BaseCreature) ||
                                    (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null &&
                                     ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) ||
                                    ((BaseCreature)c).PoisonImmune == null))
                {
                    spell = new PoisonSpell(m_Mobile, null);
                }
                else
                {
                    spell = new PainSpikeSpell(m_Mobile, null);
                }

                ++m_Combo;                 // Move to next spell
            }
            else if (m_Combo == 3 && spell == null)
            {
                switch (Utility.Random(3))
                {
                default:
                case 0:
                {
                    m_Mobile.DebugSay("Casting small spell");
                    spell = GetSmallDamageSpell();
                    m_Mobile.DebugSay("Moving to next spell");
                    ++m_Combo;     // Move to next spell

                    break;
                }

                case 1:
                {
                    m_Mobile.DebugSay("Casting Strangle and resetting combo");
                    spell   = new StrangleSpell(m_Mobile, null);
                    m_Combo = -1;                             // Reset combo state
                    break;
                }

                case 2:
                {
                    m_Mobile.DebugSay("Casting small spell");
                    spell = GetSmallDamageSpell();
                    break;
                }
                }
            }
            else if (m_Combo == 4 && spell == null)
            {
                m_Mobile.DebugSay("Casting Vengeful Spirit and resetting combo");
                spell   = new VengefulSpiritSpell(m_Mobile, null);
                m_Combo = -1;
            }

            return(spell);
        }
示例#7
0
        public virtual Spell ChooseSpell(Mobile c)
        {
            Spell spell = null;

            int    healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits));
            int    spellResult;
            double witherChance = .10; //05% chance to wither per enemy in range

            m_Mobile.DebugSay("Choosing a Spell");
            spellResult = Utility.Random(4 + healChance);
            m_Mobile.DebugSay("Chose " + spellResult);
            switch (spellResult)
            {
            case 0:                     // Heal  myself
            {
                m_Mobile.DebugSay("0. Heal");
                if (m_Mobile.Hits < (m_Mobile.HitsMax - 50))
                {
                    spell = new GreaterHealSpell(m_Mobile, null);
                }
                else if (m_Mobile.Hits < (m_Mobile.HitsMax - 20))
                {
                    spell = new HealSpell(m_Mobile, null);
                }

                break;
            }

            case 1:                     // PoisonStrike them
            {
                m_Mobile.DebugSay("1. Poison Strike or Pfield or Ffield");
                if (!c.Poisoned && (!(c is BaseCreature) ||
                                    (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null &&
                                     ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) ||
                                    ((BaseCreature)c).PoisonImmune == null))
                {
                    if (Utility.RandomDouble() > .5)
                    {
                        spell = new PoisonStrikeSpell(m_Mobile, null);
                    }
                    else
                    {
                        spell = new PoisonFieldSpell(m_Mobile, null);      //need to do targeting on fields
                    }
                }
                else
                if (Utility.RandomDouble() > .5)
                {
                    spell = new FireFieldSpell(m_Mobile, null);
                }
                else
                {
                    spell = new FlameStrikeSpell(m_Mobile, null);
                }

                break;
            }

            case 2:                     // Deal some damage
            {
                List <Mobile> targets = new List <Mobile>();

                BaseCreature cbc       = m_Mobile as BaseCreature;
                bool         isMonster = (cbc != null && !cbc.Controlled && !cbc.Summoned);
                //check if enough wither targets.
                foreach (Mobile m in m_Mobile.GetMobilesInRange(Core.ML ? 4 : 5))
                {
                    if (m_Mobile != m && m_Mobile.InLOS(m) && (isMonster || SpellHelper.ValidIndirectTarget(m_Mobile, m)) && m_Mobile.CanBeHarmful(m, false))
                    {
                        /*
                         * if (isMonster)
                         * {
                         * if (m is BaseCreature)
                         * {
                         *  BaseCreature bc = (BaseCreature)m;
                         *
                         *  if (!bc.Controlled && !bc.Summoned && bc.Team == cbc.Team)
                         *      continue;
                         * }
                         * else if (!m.Player)
                         * {
                         *  continue;
                         * }
                         * }
                         */
                        targets.Add(m);
                    }
                }

                if (targets.Count * witherChance > Utility.RandomDouble())
                {
                    m_Mobile.DebugSay("2. Wither");
                    spell = new WitherSpell(m_Mobile, null);
                }
                else
                {
                    spell = GetRandomDamageSpell();
                    m_Mobile.DebugSay("2. Random Spell");
                }


                break;
            }

            case 3:                     // Set up a combo of attacks
            {
                if (m_Mobile.Mana < 30 && m_Mobile.Mana > 15)
                {
                    if (c.Paralyzed && !c.Poisoned)
                    {
                        m_Mobile.DebugSay("I am going to meditate");

                        m_Mobile.UseSkill(SkillName.Meditation);
                    }
                    else if (!c.Poisoned && (!(c is BaseCreature) ||
                                             (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null &&
                                              ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) ||
                                             ((BaseCreature)c).PoisonImmune == null))
                    {
                        m_Mobile.DebugSay("3. Casting Poison");
                        spell = new PoisonSpell(m_Mobile, null);
                    }
                }
                else if (m_Mobile.Mana > 30 && m_Mobile.Mana < 80)
                {
                    if (Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned)
                    {
                        m_Mobile.DebugSay("3. Pain Spike (Explo)");
                        m_Combo = 0;
                        spell   = new PainSpikeSpell(m_Mobile, null);
                    }
                    else
                    {
                        m_Mobile.DebugSay("3. Mind Rot or Curse (FS)");
                        m_Combo = 1;
                        if (Utility.RandomBool())
                        {
                            spell = new CurseSpell(m_Mobile, null);
                        }
                        else
                        {
                            spell = new MindRotSpell(m_Mobile, null);
                        }
                    }
                }
                else
                {
                    if (Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned)
                    {
                        m_Mobile.DebugSay("4. Vengeful Spirit (Explo)");
                        m_Combo = 0;
                        spell   = new VengefulSpiritSpell(m_Mobile, null);
                    }
                    else
                    {
                        m_Mobile.DebugSay("4. Poison Strike (FS)");
                        m_Combo = 1;
                        spell   = new PoisonStrikeSpell(m_Mobile, null);
                    }
                }
                break;
            }
            }

            return(spell);
        }
示例#8
0
        public override Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_NecroComboType == NecroComboType.None)
            {
                m_NecroComboType = (NecroComboType)Utility.RandomMinMax(1, 7);
                m_Combo          = 0;
                m_Mobile.DebugSay("Doing {0} Combo", m_NecroComboType);
            }

            if (m_Combo == 0)
            {
                switch (m_NecroComboType)
                {
                case NecroComboType.Exp_FS_Omen_Poison_PS:
                case NecroComboType.Exp_MB_Omen_Poison_PS:
                case NecroComboType.Exp_EB_Omen_Poison_PS:
                case NecroComboType.Exp_FB_MA_Poison_PS:
                case NecroComboType.Exp_FB_Poison_PS:
                case NecroComboType.Exp_FB_MA_PS:
                case NecroComboType.Exp_Poison_FB_PS: spell = new ExplosionSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 1)
            {
                switch (m_NecroComboType)
                {
                case NecroComboType.Exp_FS_Omen_Poison_PS: spell = new FlameStrikeSpell(m_Mobile, null); break;

                case NecroComboType.Exp_MB_Omen_Poison_PS: spell = new MindBlastSpell(m_Mobile, null); break;

                case NecroComboType.Exp_EB_Omen_Poison_PS: spell = new EnergyBoltSpell(m_Mobile, null); break;

                case NecroComboType.Exp_FB_MA_Poison_PS:
                case NecroComboType.Exp_FB_Poison_PS:
                case NecroComboType.Exp_FB_MA_PS: spell = new FireballSpell(m_Mobile, null); break;

                case NecroComboType.Exp_Poison_FB_PS: spell = new PoisonSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 2)
            {
                switch (m_NecroComboType)
                {
                case NecroComboType.Exp_FS_Omen_Poison_PS:
                case NecroComboType.Exp_MB_Omen_Poison_PS:
                case NecroComboType.Exp_EB_Omen_Poison_PS: spell = new EvilOmenSpell(m_Mobile, null); break;

                case NecroComboType.Exp_FB_MA_Poison_PS: spell = new MagicArrowSpell(m_Mobile, null); break;

                case NecroComboType.Exp_FB_Poison_PS: spell = new PoisonSpell(m_Mobile, null); break;

                case NecroComboType.Exp_FB_MA_PS: spell = new MagicArrowSpell(m_Mobile, null); break;

                case NecroComboType.Exp_Poison_FB_PS: spell = new FireballSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 3)
            {
                switch (m_NecroComboType)
                {
                case NecroComboType.Exp_FS_Omen_Poison_PS:
                case NecroComboType.Exp_MB_Omen_Poison_PS:
                case NecroComboType.Exp_EB_Omen_Poison_PS:
                case NecroComboType.Exp_FB_MA_Poison_PS:
                case NecroComboType.Exp_FB_Poison_PS: spell = new PoisonSpell(m_Mobile, null); break;

                case NecroComboType.Exp_FB_MA_PS:
                case NecroComboType.Exp_Poison_FB_PS:
                    if (Utility.RandomBool())
                    {
                        spell = new PoisonStrikeSpell(m_Mobile, null);
                    }
                    else
                    {
                        spell = new PainSpikeSpell(m_Mobile, null);
                    }
                    EndCombo();
                    return(spell);
                }

                ++m_Combo;
            }

            else if (m_Combo == 4)
            {
                switch (m_NecroComboType)
                {
                case NecroComboType.Exp_FS_Omen_Poison_PS:
                case NecroComboType.Exp_MB_Omen_Poison_PS:
                case NecroComboType.Exp_EB_Omen_Poison_PS:
                case NecroComboType.Exp_FB_MA_Poison_PS:
                case NecroComboType.Exp_FB_Poison_PS:
                case NecroComboType.Exp_FB_MA_PS:
                case NecroComboType.Exp_Poison_FB_PS:
                    if (Utility.RandomBool())
                    {
                        spell = new PoisonStrikeSpell(m_Mobile, null);
                    }
                    else
                    {
                        spell = new PainSpikeSpell(m_Mobile, null);
                    }
                    EndCombo();
                    return(spell);
                }
            }

            return(spell);
        }
示例#9
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            m_Mobile.DebugSay("Doing Combo");
            if (m_Combo == 0)
            {
                m_Mobile.DebugSay(" Casting Explosion and moving to the next spell ");
                spell = new ExplosionSpell(m_Mobile, null);
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 1)
            {
                spell = new FlameStrikeSpell(m_Mobile, null);
                m_Mobile.DebugSay("Casting Flamestrike and moving to the next spell ");
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 2)
            {
                m_Mobile.DebugSay("Casting maybe poison and moving to next spell");
                if (!c.Poisoned && (!(c is BaseCreature) ||
                                    (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null &&
                                     ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) ||
                                    ((BaseCreature)c).PoisonImmune == null))
                {
                    spell = new PoisonSpell(m_Mobile, null);
                }
                else
                {
                    spell = new HarmSpell(m_Mobile, null);
                }

                ++m_Combo;                 // Move to next spell
            }
            else if (m_Combo == 3 && spell == null)
            {
                switch (Utility.Random(3))
                {
                default:
                case 0:
                {
                    m_Mobile.DebugSay("Random small Spell and next spell");
                    spell = GetSmallDamageSpell();
                    ++m_Combo;     // Move to next spell

                    break;
                }

                case 1:
                {
                    m_Mobile.DebugSay("Random small spell and resetting combo");
                    spell   = GetSmallDamageSpell();
                    m_Combo = -1;     // Reset combo state
                    break;
                }

                case 2:
                {
                    m_Mobile.DebugSay("Random small spell and same state");
                    spell = GetSmallDamageSpell();
                    break;
                }
                }
            }
            else if (m_Combo == 4 && spell == null)
            {
                m_Mobile.DebugSay("Casting Flamestrike and resetting combo");
                spell   = new FlameStrikeSpell(m_Mobile, null);
                m_Combo = -1;
            }
            return(spell);
        }
示例#10
0
        public virtual Spell ChooseSpell(Mobile c)
        {
            Spell spell = null;

            int    healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits));
            int    spellResult;
            double witherChance = .05; //05% chance to wither per enemy in range

            m_Mobile.DebugSay("Choosing a Spell");
            spellResult = Utility.Random(4 + healChance);
            m_Mobile.DebugSay("Chose " + spellResult);
            switch (spellResult)
            {
            case 0:                     // Heal  myself
            {
                m_Mobile.DebugSay("0. Heal");
                if (m_Mobile.Hits < (m_Mobile.HitsMax - 50))
                {
                    spell = new GreaterHealSpell(m_Mobile, null);
                }
                else if (m_Mobile.Hits < (m_Mobile.HitsMax - 20))
                {
                    spell = new HealSpell(m_Mobile, null);
                }

                break;
            }

            case 1:                     // PoisonStrike them
            {
                if (!c.Poisoned && (!(c is BaseCreature) ||
                                    (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null &&
                                     ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) ||
                                    ((BaseCreature)c).PoisonImmune == null))
                {
                    spell = new PoisonFieldSpell(m_Mobile, null);
                }
                else
                if (Utility.RandomDouble() > .5)
                {
                    spell = new FlameStrikeSpell(m_Mobile, null);
                }
                else
                {
                    spell = new FireFieldSpell(m_Mobile, null);
                }



                break;
            }

            case 2:                     // Deal some damage
            {
                List <Mobile> targets = new List <Mobile>();

                BaseCreature cbc       = m_Mobile as BaseCreature;
                bool         isMonster = (cbc != null && !cbc.Controlled && !cbc.Summoned);
                //check if enough Earthquake targets.
                if (m_Mobile.Map != null)
                {
                    foreach (Mobile m in m_Mobile.GetMobilesInRange(1 + (int)(m_Mobile.Skills[SkillName.Magery].Value / 15.0)))
                    {
                        if (m_Mobile != m && SpellHelper.ValidIndirectTarget(m_Mobile, m) && m_Mobile.CanBeHarmful(m, false) && (!Core.AOS || m_Mobile.InLOS(m)))
                        {
                            targets.Add(m);
                        }
                    }
                }

                if (targets.Count * witherChance > Utility.RandomDouble())
                {
                    m_Mobile.DebugSay("2. Earthquake");
                    spell = new EarthquakeSpell(m_Mobile, null);
                }
                else
                {
                    spell = GetRandomDamageSpell();
                    m_Mobile.DebugSay("2. Random Spell");
                }


                break;
            }

            case 3:                     // Set up a combo of attacks
            {
                if (m_Mobile.Mana < 30 && m_Mobile.Mana > 15)
                {
                    if (c.Paralyzed && !c.Poisoned)
                    {
                        m_Mobile.DebugSay("I am going to meditate");

                        m_Mobile.UseSkill(SkillName.Meditation);
                    }
                    else if (!c.Poisoned && (!(c is BaseCreature) ||
                                             (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null &&
                                              ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) ||
                                             ((BaseCreature)c).PoisonImmune == null))
                    {
                        m_Mobile.DebugSay("3. Casting Poison");
                        spell = new PoisonSpell(m_Mobile, null);
                    }
                }
                else if (m_Mobile.Mana > 30 && m_Mobile.Mana < 80)
                {
                    if (Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned)
                    {
                        m_Mobile.DebugSay("3. Curse (Explo)");
                        m_Combo = 0;
                        spell   = new CurseSpell(m_Mobile, null);
                    }
                    else
                    {
                        m_Mobile.DebugSay("3. Curse (FS)");
                        m_Combo = 1;
                        spell   = new CurseSpell(m_Mobile, null);
                    }
                }
                else
                {
                    if (Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned)
                    {
                        m_Mobile.DebugSay("4. Mana Vampire (Explo)");
                        m_Combo = 0;
                        spell   = new ManaVampireSpell(m_Mobile, null);
                    }
                    else
                    {
                        m_Mobile.DebugSay("4. Mana Vampire (FS)");
                        m_Combo = 1;
                        spell   = new ManaVampireSpell(m_Mobile, null);
                    }
                }
                break;
            }
            }

            return(spell);
        }