Пример #1
0
        public override Spell ChooseSpell(Mobile c)
        {
            Spell spell = CheckCastHealingSpell();

            if (spell != null)
            {
                return(spell);
            }

            switch (Utility.Random(16))
            {
            case 0:
            case 1:
            case 2:                     // Poison them
            {
                m_Mobile.DebugSay("Attempting to poison");

                if (!c.Poisoned)
                {
                    spell = new PoisonSpell(m_Mobile, null);
                }

                break;
            }

            case 3:                     // Bless ourselves.
            {
                m_Mobile.DebugSay("Blessing myself");

                if (Utility.RandomBool() && !ArcaneEmpowermentSpell.IsBuffed(m_Mobile))
                {
                    spell = new ArcaneEmpowermentSpell(m_Mobile, null);
                }
                else
                {
                    spell = new BlessSpell(m_Mobile, null);
                }

                break;
            }

            case 4:                     // Wildfire
            {
                m_Mobile.DebugSay("Incendio!");

                spell = new WildfireSpell(m_Mobile, null);

                break;
            }

            case 5:                     // Reduce their cast speed
            {
                if (c.InRange(m_Mobile.Location, 6))
                {
                    if (m_Mobile.Skills[SkillName.Spellweaving].Value >= 90.0)
                    {
                        spell = new EssenceOfWindSpell(m_Mobile, null);
                    }
                    else if (c.InRange(m_Mobile.Location, 2))
                    {
                        spell = new ThunderstormSpell(m_Mobile, null);
                    }
                }

                m_Mobile.DebugSay("Attempting to reduce their cast speed");

                break;
            }

            case 6:                     // Curse them.
            {
                m_Mobile.DebugSay("Attempting to curse");

                spell = GetRandomCurseSpell(c);
                break;
            }

            case 7:                     // Paralyze them.
            {
                m_Mobile.DebugSay("Attempting to paralyze");

                if (m_Mobile.Skills[SkillName.Magery].Value > 50.0)
                {
                    spell = new ParalyzeSpell(m_Mobile, null);
                }

                break;
            }

            case 8:                     // Drain mana
            {
                m_Mobile.DebugSay("Attempting to drain mana");

                spell = GetRandomManaDrainSpell(c);
                break;
            }

            default:                     // Damage them.
            {
                m_Mobile.DebugSay("Just doing damage");

                spell = GetRandomDamageSpell(c);
                break;
            }
            }

            return(spell);
        }
Пример #2
0
        public override void OnThink()
        {
            //if (!pvp && Combatant != null && Combatant is PlayerMobile)
            //{
            //    Combatant = null; ControlOrder = OrderType.Follow; ControlTarget = this.ControlMaster; DebugSay("hahah pvp  no "); return;
            //}

            //else
            if (Combatant != null && Combatant is Mobile && this.InRange(Combatant.Location, 8))
            {
                #region old no use
                ////Spells.Spell spell = Spells.SpellRegistry.NewSpell(690, this, null);
                //var t = Combatant as Targeting.Target;
                //Spells.Spell spell = new Spells.Mysticism.HailStormSpell(this, null);
                //Spells.Spell ss = new Spells.Necromancy.WitherSpell(this, null);
                //if (Combatant != null && this.InRange(Combatant.Location, 8))
                //{
                //    spell.Cast();
                //    ss.Cast();
                //    //t.Invoke(this, Combatant);
                //}
                //Timer.DelayCall(TimeSpan.FromSeconds(5.0) + TimeSpan.FromSeconds(Utility.RandomMinMax(3, 10)), () =>
                //{
                //    this.Say("haha");
                //});********************************************
                //List<Mobile> targets = new List<Mobile>();
                //foreach (Mobile m in (this.Combatant as Mobile).GetMobilesInRange(3))
                //{
                //    if (m == ControlMaster || m == this)
                //        continue;
                //    targets.Add(m);
                //}

                //if (targets.Count >= 2)//敌人数量>=2 使用冰风暴
                //{
                //    Spell sp;
                //    if (Utility.Random(2) < 1)
                //        sp = new HailStormSpell(this, null);
                //    else
                //        sp = new WildfireSpell(this, null);
                //    ProcessTarget();
                //    sp.Cast();
                //}
                //targets.Clear();
                //targets = null;
                #endregion no use

                ArrayList         targets = new ArrayList();
                IPooledEnumerable eable   = ((Mobile)Combatant).GetMobilesInRange(3);
                foreach (Mobile m in eable)
                {
                    if (m == this || !this.CanBeHarmful(m))
                    {
                        continue;
                    }
                    targets.Add(m);
                }
                if (targets.Count >= 2) //敌人数量>=2 使用冰风暴
                {
                    ProcessTarget();
                    Spell sp;
                    if (Utility.Random(3) < 1)
                    {
                        sp = new HailStormSpell(this, null);
                    }
                    else
                    {
                        sp = new WildfireSpell(this, null);
                    }

                    if (sp.Cast())
                    {
                        Emote(sp.Name.ToString());
                    }
                }
                //Timer.DelayCall(TimeSpan.FromSeconds(6), () => Say("oh"));
                eable.Free();
                targets.Clear();
                targets = null;
            }
            base.OnThink();
        }