Beispiel #1
0
            private void EndHeal()
            {
                if (Context.ContainsKey(Healer))
                    Context.Remove(Healer);

                if (Patient != Healer && Patient.InRange(Healer.Location, 2))
                {
                    Healer.PlaySound(0x57);

                    if (EnchantedApple.GetTotalCurses(Patient) == 0)
                        Healer.SendLocalizedMessage(500968); // You apply the bandages, but they barely help.
                    else
                        Healer.SendLocalizedMessage(500969); // You finish applying the bandages.

                    EvilOmenSpell.TryEndEffect(Patient);
                    StrangleSpell.RemoveCurse(Patient);
                    CorpseSkinSpell.RemoveCurse(Patient);
                    WeakenSpell.RemoveEffects(Patient);
                    FeeblemindSpell.RemoveEffects(Patient);
                    ClumsySpell.RemoveEffects(Patient);
                    CurseSpell.RemoveEffect(Patient);
                    MortalStrike.EndWound(Patient);
                    BloodOathSpell.RemoveCurse(Patient);
                    MindRotSpell.ClearMindRotScalar(Patient);
                    SpellPlagueSpell.RemoveFromList(Patient);
                    SleepSpell.EndSleep(Patient);

                    BuffInfo.RemoveBuff(Patient, BuffIcon.MassCurse);
                }
                else
                {
                    Healer.SendLocalizedMessage(500295); // You are too far away to do that.
                }
            }
        }// A tasty bite of the enchanted apple lifts all curses from your soul.

        public override bool Eat(Mobile from)
        {
            if (!IsUnderInfluence(from, FoodID))
            {
                if (CoolingDown(from, FoodID))
                {
                    from.SendLocalizedMessage(1151180); // You must wait a while before eating another enchanted apple.
                }
                else
                {
                    from.PlaySound(0xF6);
                    from.PlaySound(0x1F7);
                    from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

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

                    if (Core.SA)
                    {
                        int totalCurses = GetTotalCurses(from);

                        if (totalCurses > 2 && totalCurses > Utility.Random(10))
                        {
                            from.SendLocalizedMessage(1150174); // The apple was not strong enough to purify you.

                            Consume();

                            return(false);
                        }
                    }

                    EvilOmenSpell.TryEndEffect(from);
                    StrangleSpell.RemoveCurse(from);
                    CorpseSkinSpell.RemoveCurse(from);
                    WeakenSpell.RemoveEffects(from);
                    FeeblemindSpell.RemoveEffects(from);
                    ClumsySpell.RemoveEffects(from);
                    CurseSpell.RemoveEffect(from);
                    MortalStrike.EndWound(from);
                    BloodOathSpell.RemoveCurse(from);
                    MindRotSpell.ClearMindRotScalar(from);
                    SpellPlagueSpell.RemoveFromList(from);
                    SleepSpell.EndSleep(from);

                    BuffInfo.RemoveBuff(from, BuffIcon.MassCurse);

                    from.SendLocalizedMessage(EatMessage);

                    StartInfluence(from, FoodID, Duration, Cooldown);
                    Consume();

                    return(true);
                }
            }

            return(false);
        }
Beispiel #3
0
        public static void RemoveCurses(Mobile m)
        {
            // play the sound
            m.PlaySound(0xF6);
            m.PlaySound(0x1F7);

            // do the effects
            m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

            IEntity from = new DummyEntity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), m.Map);
            IEntity to   = new DummyEntity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), m.Map);

            Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

            // remove stat mods
            StatMod mod;

            foreach (string 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);
        }
Beispiel #4
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 #5
0
        public static int GetCursePower(Mobile m)
        {
            int power = 0;

            // 1st circle debuffs
            foreach (string statModName in StatModNames)
            {
                if (m.GetStatMod(statModName) != null)
                {
                    power += 1;
                }
            }

            // 3rd circle debuffs
            if (EvilOmenSpell.UnderEffect(m))
            {
                power += 3;
            }

            if (BloodOathSpell.UnderEffect(m))
            {
                power += 3;
            }

            if (CorpseSkinSpell.UnderEffect(m))
            {
                power += 3;
            }

            if (MindRotSpell.HasMindRotScalar(m))
            {
                power += 3;
            }

            if (SleepSpell.IsSlept(m))
            {
                power += 3;
            }

            // 4th circle debuffs
            if (CurseSpell.UnderEffect(m))
            {
                power += 4;
            }

            // 6th circle debuffs
            if (StrangleSpell.UnderEffect(m))
            {
                power += 6;
            }

            // 7th circle debuffs
            if (SpellPlagueSpell.UnderEffect(m))
            {
                power += 7;
            }

            if (MortalStrike.IsWounded(m))
            {
                power += 7;
            }

            return(power);
        }
Beispiel #6
0
        public static int GetTotalCurses(Mobile m)
        {
            int curses = 0;

            if (EvilOmenSpell.UnderEffects(m))
            {
                curses++;
            }

            if (StrangleSpell.UnderEffects(m))
            {
                curses++;
            }

            if (CorpseSkinSpell.IsUnderEffects(m))
            {
                curses++;
            }

            if (BloodOathSpell.GetBloodOath(m) != null)
            {
                curses++;
            }

            if (MindRotSpell.HasMindRotScalar(m))
            {
                curses++;
            }

            if (SpellPlagueSpell.HasSpellPlague(m))
            {
                curses++;
            }

            if (SleepSpell.IsUnderSleepEffects(m))
            {
                curses++;
            }

            if (CurseSpell.UnderEffect(m))
            {
                curses++;
            }

            if (FeeblemindSpell.IsUnderEffects(m))
            {
                curses++;
            }

            if (ClumsySpell.IsUnderEffects(m))
            {
                curses++;
            }

            if (WeakenSpell.IsUnderEffects(m))
            {
                curses++;
            }

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

                spell = new BlessSpell(m_Mobile, null);

                break;
            }

            case 4:                     // Sleep
            {
                m_Mobile.DebugSay("¡A dormir!");

                spell = new SleepSpell(m_Mobile, null);

                break;
            }

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

                spell = GetRandomCurseSpell(c);
                break;
            }

            case 6:
            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);
        }