Beispiel #1
0
        public Spell GetMysticSpell()
        {
            Spell spell = null;

            switch (Utility.Random(8))
            {
            case 0:
            case 1:
            {
                if (this.CheckForSleep(this.m_Mobile.Combatant))
                {
                    this.m_Mobile.DebugSay("Casting Sleep");
                    spell = new SleepSpell(this.m_Mobile, null);
                    break;
                }
                else
                {
                    goto case 7;
                }
            }

            case 2:
            {
                if (this.m_Mobile.Followers < 2)
                {
                    int whichone = Utility.Random(3);

                    if (this.m_Mobile.Skills[SkillName.Mysticism].Value > 80.0 && whichone > 0)
                    {
                        this.m_Mobile.DebugSay("Casting Rising Colossus");
                        spell = new RisingColossusSpell(this.m_Mobile, null);
                    }
                    else if (this.m_Mobile.Skills[SkillName.Mysticism].Value > 30.0)
                    {
                        this.m_Mobile.DebugSay("Casting Animated Weapon");
                        spell = new AnimatedWeaponSpell(this.m_Mobile, null);
                    }
                }

                if (spell != null)
                {
                    break;
                }
                else
                {
                    goto case 7;
                }
            }

            case 3:
            {
                if (this.m_CanShapeShift && this.m_Mobile.Skills[SkillName.Mysticism].Value > 30.0)
                {
                    this.m_Mobile.DebugSay("Casting Stone Form");
                    spell = new StoneFormSpell(this.m_Mobile, null);
                    break;
                }
                else
                {
                    goto case 7;
                }
            }

            case 4:
            case 5:
            {
                if (!SpellPlagueSpell.HasSpellPlague(this.m_Mobile.Combatant) && this.m_Mobile.Skills[SkillName.Mysticism].Value > 70.0)
                {
                    this.m_Mobile.DebugSay("Casting Spell Plague");
                    spell = new SpellPlagueSpell(this.m_Mobile, null);
                    break;
                }
                else
                {
                    goto case 7;
                }
            }

            case 6:
            case 7:
            {
                switch (Utility.Random((int)(this.m_Mobile.Skills[SkillName.Mysticism].Value / 20)))
                {
                default:
                    spell = new NetherBoltSpell(this.m_Mobile, null);
                    break;

                case 1:
                    spell = new EagleStrikeSpell(this.m_Mobile, null);
                    break;

                case 2:
                    spell = new BombardSpell(this.m_Mobile, null);
                    break;

                case 3:
                    spell = new HailStormSpell(this.m_Mobile, null);
                    break;

                case 4:
                    spell = new NetherCycloneSpell(this.m_Mobile, null);
                    break;
                }

                break;
            }
            }

            return(spell);
        }
Beispiel #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();
        }