コード例 #1
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))
                {
                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;
                }

                default:
                {
                    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
ファイル: RemoveCurse.cs プロジェクト: phpjunkie420/ServUO
        public void Target(Mobile m)
        {
            if (this.CheckBSequence(m))
            {
                SpellHelper.Turn(this.Caster, m);

                /* Attempts to remove all Curse effects from Target.
                 * Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze
                 * as well as all Necromancer curses.
                 * Chance of removing curse is affected by Caster's Karma.
                 */

                int chance = 0;

                if (this.Caster.Karma < -5000)
                {
                    chance = 0;
                }
                else if (this.Caster.Karma < 0)
                {
                    chance = (int)Math.Sqrt(20000 + this.Caster.Karma) - 122;
                }
                else if (this.Caster.Karma < 5625)
                {
                    chance = (int)Math.Sqrt(this.Caster.Karma) + 25;
                }
                else
                {
                    chance = 100;
                }

                if (chance > Utility.Random(100))
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), this.Caster.Map);
                    IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), this.Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    m.Paralyzed = false;

                    EvilOmenSpell.TryEndEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);
                    MortalStrike.EndWound(m);
                    WeakenSpell.RemoveEffects(m);
                    FeeblemindSpell.RemoveEffects(m);
                    ClumsySpell.RemoveEffects(m);

                    BloodOathSpell.RemoveCurse(m);

                    MindRotSpell.ClearMindRotScalar(m);
                    SpellPlagueSpell.RemoveFromList(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                }
                else
                {
                    m.PlaySound(0x1DF);
                }
            }

            this.FinishSequence();
        }