Exemplo n.º 1
0
 public override void RemoveEffect(Mobile m)
 {
     BuffInfo.RemoveBuff(m, BuffIcon.ReaperForm);
 }
Exemplo n.º 2
0
 protected override void OnTick()
 {
     EndConfidence(this.m_Mobile);
     BuffInfo.RemoveBuff(m_Mobile, BuffIcon.Confidence);
     this.m_Mobile.SendLocalizedMessage(1063116); // Your confidence wanes.
 }
Exemplo n.º 3
0
        public override void EndEffects()
        {
            Caster.SendLocalizedMessage(1156087); // Your Mana Shield has expired.

            BuffInfo.RemoveBuff(Caster, BuffIcon.ManaShield);
        }
Exemplo n.º 4
0
 public override void OnClearMove(Mobile from)
 {
     BuffInfo.RemoveBuff(from, BuffIcon.Onslaught);
 }
Exemplo n.º 5
0
 public override void RemovePartyEffects(Mobile m)
 {
     BuffInfo.RemoveBuff(m, BuffIcon.Resilience);
 }
Exemplo n.º 6
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (!m.Hidden)
            {
                m.SendLocalizedMessage(502725); // You must hide first
            }
            else if (m.Flying)
            {
                m.SendLocalizedMessage(1113415); // You cannot use this ability while flying.
                m.RevealingAction();
                BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
            }
            else if (m.Skills[SkillName.Hiding].Base < HidingRequirement)
            {
                m.SendLocalizedMessage(502726); // You are not hidden well enough.  Become better at hiding.
                m.RevealingAction();
                BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
            }
            else if (!m.CanBeginAction(typeof(Stealth)))
            {
                m.SendLocalizedMessage(1063086); // You cannot use this skill right now.
                m.RevealingAction();
                BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
            }
            else
            {
                int armorRating = GetArmorRating(m);

                if (armorRating >= (Core.AOS ? 42 : 26)) //I have a hunch '42' was chosen cause someone's a fan of DNA
                {
                    m.SendLocalizedMessage(502727);      // You could not hope to move quietly wearing this much armor.
                    m.RevealingAction();
                    BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
                }
                else if (m.CheckSkill(SkillName.Stealth, -20.0 + (armorRating * 2), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2)))
                {
                    int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 5.0 : 10.0));

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

                    m.AllowedStealthSteps = steps;

                    m.IsStealthing = true;

                    m.SendLocalizedMessage(502730); // You begin to move quietly.

                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.HidingAndOrStealth, 1044107, 1075655));
                    return(TimeSpan.FromSeconds(10.0));
                }
                else
                {
                    m.SendLocalizedMessage(502731); // You fail in your attempt to move unnoticed.
                    m.RevealingAction();
                    BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
                }
            }

            return(TimeSpan.FromSeconds(10.0));
        }
Exemplo n.º 7
0
        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);

                    if (Core.ML)
                    {
                        BloodOathSpell.RemoveCurse(m);
                    }

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

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

            this.FinishSequence();
        }
Exemplo n.º 8
0
 public override void RemovePartyEffects(Mobile m)
 {
     BuffInfo.RemoveBuff(m, BuffIcon.PlayingTheOdds);
 }
Exemplo n.º 9
0
 public override void RemovePartyEffects(Mobile m)
 {
     BuffInfo.RemoveBuff(m, BuffIcon.Inspire);
 }
Exemplo n.º 10
0
 public override void EndEffects()
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.InjectedStrike);
 }
Exemplo n.º 11
0
 public override void EndEffects()
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.ShieldBash);
 }
Exemplo n.º 12
0
 public override void EndEffects()
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.Tolerance);
 }
Exemplo n.º 13
0
        public static int RemoveCurses(Mobile m)
        {
            int curseLevel = 0;

            if (SleepSpell.IsUnderSleepEffects(m))
            {
                SleepSpell.EndSleep(m);
                curseLevel += 2;
            }

            if (EvilOmenSpell.TryEndEffect(m))
            {
                curseLevel += 1;
            }

            if (StrangleSpell.RemoveCurse(m))
            {
                curseLevel += 2;
            }

            if (CorpseSkinSpell.RemoveCurse(m))
            {
                curseLevel += 3;
            }

            if (CurseSpell.UnderEffect(m))
            {
                CurseSpell.RemoveEffect(m);
                curseLevel += 4;
            }

            if (BloodOathSpell.RemoveCurse(m))
            {
                curseLevel += 3;
            }

            if (MindRotSpell.HasMindRotScalar(m))
            {
                MindRotSpell.ClearMindRotScalar(m);
                curseLevel += 2;
            }

            if (SpellPlagueSpell.HasSpellPlague(m))
            {
                SpellPlagueSpell.RemoveFromList(m);
                curseLevel += 4;
            }

            if (FeeblemindSpell.IsUnderEffects(m))
            {
                FeeblemindSpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (ClumsySpell.IsUnderEffects(m))
            {
                ClumsySpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (WeakenSpell.IsUnderEffects(m))
            {
                WeakenSpell.RemoveEffects(m);
                curseLevel += 1;
            }

            if (MortalStrike.IsWounded(m))
            {
                MortalStrike.EndWound(m);
                curseLevel += 2;
            }

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
            BuffInfo.RemoveBuff(m, BuffIcon.CorpseSkin);
            BuffInfo.RemoveBuff(m, BuffIcon.Strangle);
            BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);

            return(curseLevel);
        }
Exemplo n.º 14
0
        public override void OnTick()
        {
            base.OnTick();

            BuffInfo.RemoveBuff(Victim, BuffIcon.SplinteringEffect);
        }
Exemplo n.º 15
0
 public override void EndEffects()
 {
     BuffInfo.RemoveBuff(Target, BuffIcon.TribulationTarget);
     BuffInfo.RemoveBuff(Caster, BuffIcon.TribulationCaster);
 }
Exemplo n.º 16
0
 public override void EndEffects()
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.CalledShot);
 }
Exemplo n.º 17
0
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(m_Healer, m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Healer, m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962; // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healerNumber  = 500963; // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) ||
                    (Core.SE && petPatient is FactionWarHorse && petPatient.ControlMaster == m_Healer) ||
                    (Server.Engines.VvV.ViceVsVirtueSystem.Enabled && petPatient is Server.Engines.VvV.VvVMount && petPatient.ControlMaster == m_Healer))
                //TODO: Dbl check doesn't check for faction of the horse here?
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042; // Target can not be resurrected at that location.
                        patientNumber = 502391; // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965; // You are able to resurrect your patient.
                        patientNumber = -1;

                        m_Patient.PlaySound(0x214);
                        m_Patient.FixedEffect(0x376A, 10, 16);

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && m_Healer == master)
                            {
                                petPatient.ResurrectPet();

                                for (int i = 0; i < petPatient.Skills.Length; ++i)
                                {
                                    petPatient.Skills[i].Base -= 0.1;
                                }
                            }
                            else if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 503255; // You are able to resurrect the creature.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(m_Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                var friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 503255; // You are able to resurrect the creature.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection.
                                }
                            }
                        }
                        else
                        {
                            m_Patient.CloseGump(typeof(ResurrectGump));
                            m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256; // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966; // You are unable to resurrect your patient.
                    }

                    patientNumber = -1;
                }
            }
            else if (m_Patient.Poisoned)
            {
                m_Healer.SendLocalizedMessage(500969); // You finish applying the bandages.

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 30.0) / 50.0) - (m_Patient.Poison.RealLevel * 0.1) - (m_Slips * 0.02);

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.CurePoison(m_Healer))
                    {
                        healerNumber  = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                                // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060; // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088; // You bind the wound and stop the bleeding
                patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967; // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

                #region Heritage Items
                if (m_Enhanced)
                {
                    healing += EnhancedBandage.HealingBonus;
                }
                #endregion

                #region Exodus Items
                Item item = m_Healer.FindItemOnLayer(Layer.TwoHanded);

                if (item is Asclepius || item is GargishAsclepius)
                {
                    healing += 15;
                }
                #endregion

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969; // You finish applying the bandages.

                    double min, max;

                    if (Core.AOS)
                    {
                        min = (anatomy / 8.0) + (healing / 5.0) + 4.0;
                        max = (anatomy / 6.0) + (healing / 2.5) + 4.0;
                    }
                    else
                    {
                        min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
                        max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
                    }

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    if (Core.AOS)
                    {
                        toHeal -= toHeal * m_Slips * 0.35; // TODO: Verify algorithm
                    }
                    else
                    {
                        toHeal -= m_Slips * 4;
                    }

                    #region City Loyalty
                    if (Server.Engines.CityLoyalty.CityLoyaltySystem.HasTradeDeal(m_Healer, Server.Engines.CityLoyalty.TradeDeal.GuildOfHealers))
                    {
                        toHeal += (int)Math.Ceiling(toHeal * 0.05);
                    }
                    #endregion

                    if (m_HealedPoisonOrBleed > 0)
                    {
                        toHeal /= m_HealedPoisonOrBleed;
                    }

                    if (SearingWounds.IsUnderEffects(m_Patient))
                    {
                        toHeal /= 2;
                        m_Patient.SendLocalizedMessage(1151178); // The cauterized wound resists some of your healing.
                    }

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968; // You apply the bandages, but they barely help.
                    }
                    else if (m_Patient != m_Healer && m_Patient is PlayerMobile && m_Healer is PlayerMobile)
                    {
                        SpiritualityVirtue.OnHeal(m_Healer, Math.Min((int)toHeal, m_Patient.HitsMax - m_Patient.Hits));
                    }

                    m_Patient.Heal((int)toHeal, m_Healer, false);
                }
                else
                {
                    healerNumber = 500968; // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }

            if (m_Patient is PlayerMobile)
            {
                BuffInfo.RemoveBuff(m_Healer, BuffIcon.Healing);
            }
            else
            {
                BuffInfo.RemoveBuff(m_Healer, BuffIcon.Veterinary);
            }
        }
Exemplo n.º 18
0
 public override void EndEffects()
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.HeightenedSenses);
 }
Exemplo n.º 19
0
        public void Target(Mobile m)
        {
            if (CheckBSequence(m))
            {
                SpellHelper.Turn(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 (Caster.Karma < -5000)
                {
                    chance = 0;
                }
                else if (Caster.Karma < 0)
                {
                    chance = (int)Math.Sqrt(20000 + Caster.Karma) - 122;
                }
                else if (Caster.Karma < 5625)
                {
                    chance = (int)Math.Sqrt(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), Caster.Map);
                    IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map);
                    Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                    StatMod mod;

                    mod = m.GetStatMod("[Magic] Str Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Str Offset");
                    }

                    mod = m.GetStatMod("[Magic] Dex Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Dex Offset");
                    }

                    mod = m.GetStatMod("[Magic] Int Offset");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Int Offset");
                    }

                    m.Paralyzed = false;

                    EvilOmenSpell.TryEndEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);
                    MortalStrike.EndWound(m);
                    if (Core.ML)
                    {
                        BloodOathSpell.RemoveCurse(m);
                    }
                    MindRotSpell.ClearMindRotScalar(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
                    BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);

                    // TODO: Should this remove blood oath? Pain spike?
                }
                else
                {
                    m.PlaySound(0x1DF);
                }
            }

            FinishSequence();
        }
Exemplo n.º 20
0
 public override void RemoveEffect(Mobile m)
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.PoisonImmunity);
     BuffInfo.RemoveBuff(Caster, BuffIcon.VampiricEmbrace);
 }
Exemplo n.º 21
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (m_Talisman == null || m_Talisman.Deleted)
                {
                    return;
                }

                Mobile target = o as Mobile;

                if (from.Talisman != m_Talisman)
                {
                    from.SendLocalizedMessage(502641);                     // You must equip this item to use it.
                }
                else if (target == null)
                {
                    from.SendLocalizedMessage(1046439);                     // That is not a valid target.
                }
                else if (m_Talisman.ChargeTime > 0)
                {
                    from.SendLocalizedMessage(1074882, m_Talisman.ChargeTime.ToString());                     // You must wait ~1_val~ seconds for this to recharge.
                }
                else if (m_Talisman.Charges == 0 && m_Talisman.MaxCharges > 0)
                {
                    from.SendLocalizedMessage(1042544);                     // This item is out of charges.
                }
                else
                {
                    switch (m_Talisman.Removal)
                    {
                    case TalismanRemoval.Curse:
                        target.PlaySound(0xF6);
                        target.PlaySound(0x1F7);
                        target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

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

                        StatMod mod;

                        mod = target.GetStatMod("[Magic] Str Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Str Offset");
                        }

                        mod = target.GetStatMod("[Magic] Dex Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Dex Offset");
                        }

                        mod = target.GetStatMod("[Magic] Int Offset");
                        if (mod != null && mod.Offset < 0)
                        {
                            target.RemoveStatMod("[Magic] Int Offset");
                        }

                        target.Paralyzed = false;

                        EvilOmenSpell.TryEndEffect(target);
                        StrangleSpell.RemoveCurse(target);
                        CorpseSkinSpell.RemoveCurse(target);
                        CurseSpell.RemoveEffect(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Clumsy);
                        BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind);
                        BuffInfo.RemoveBuff(target, BuffIcon.Weaken);
                        BuffInfo.RemoveBuff(target, BuffIcon.MassCurse);

                        target.SendLocalizedMessage(1072408);                                 // Any curses on you have been lifted

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072409);                                     // Your targets curses have been lifted
                        }
                        break;

                    case TalismanRemoval.Damage:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        BleedAttack.EndBleed(target, true);
                        MortalStrike.EndWound(target);

                        BuffInfo.RemoveBuff(target, BuffIcon.Bleed);
                        BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike);

                        target.SendLocalizedMessage(1072405);                                 // Your lasting damage effects have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072406);                                     // Your Targets lasting damage effects have been removed!
                        }
                        break;

                    case TalismanRemoval.Ward:
                        target.PlaySound(0x201);
                        Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                        MagicReflectSpell.EndReflect(target);
                        ReactiveArmorSpell.EndArmor(target);
                        ProtectionSpell.EndProtection(target);

                        target.SendLocalizedMessage(1072402);                                 // Your wards have been removed!

                        if (target != from)
                        {
                            from.SendLocalizedMessage(1072403);                                     // Your target's wards have been removed!
                        }
                        break;

                    case TalismanRemoval.Wildfire:
                        // TODO
                        break;
                    }

                    m_Talisman.OnAfterUse(from);
                }
            }
Exemplo n.º 22
0
        public void OnTarget(object o)
        {
            Mobile target = o as Mobile;

            if (target == null)
            {
                return;
            }

            if (m_CurseTable.ContainsKey(Caster))
            {
                Caster.SendLocalizedMessage(1154212); //You may not use the Purge Magic spell while you are under its curse.
            }
            else if (m_ImmuneTable.ContainsKey(target) || m_CurseTable.ContainsKey(target))
            {
                Caster.SendLocalizedMessage(1080119); // Your Purge Magic has been resisted!
            }
            else if (CheckHSequence(target))
            {
                if (CheckResisted(target))
                {
                    target.SendLocalizedMessage(501783);  // You feel yourself resisting magical energy.
                    Caster.SendLocalizedMessage(1080119); //Your Purge Magic has been resisted!
                }
                else
                {
                    SpellHelper.CheckReflect(this, Caster, ref target);

                    Caster.PlaySound(0x655);
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0);

                    BuffType type = GetRandomBuff(target);

                    if (type != BuffType.None)
                    {
                        string arg = "";

                        switch (type)
                        {
                        case BuffType.MagicReflect:
                            MagicReflectSpell.EndReflect(target);
                            arg = "magic reflect";
                            break;

                        case BuffType.ReactiveArmor:
                            ReactiveArmorSpell.EndArmor(target);
                            arg = "reactive armor";
                            break;

                        case BuffType.Protection:
                            ProtectionSpell.EndProtection(target);
                            arg = "protection";
                            break;

                        case BuffType.Transformation:
                            TransformationSpellHelper.RemoveContext(target, true);
                            arg = "transformation spell";
                            break;

                        case BuffType.StrBonus:
                            arg = "strength bonus";
                            target.RemoveStatMod("[Magic] Str Buff");
                            BuffInfo.RemoveBuff(target, BuffIcon.Strength);
                            break;

                        case BuffType.DexBonus:
                            arg = "dexterity bonus";
                            target.RemoveStatMod("[Magic] Dex Buff");
                            BuffInfo.RemoveBuff(target, BuffIcon.Agility);
                            break;

                        case BuffType.IntBonus:
                            arg = "intelligence bonus";
                            target.RemoveStatMod("[Magic] Int Buff");
                            BuffInfo.RemoveBuff(target, BuffIcon.Cunning);
                            break;

                        case BuffType.BarrabHemolymph:
                            arg = "Barrab hemolymph";
                            EodonianPotion.RemoveEffects(target, PotionEffect.Barrab);
                            break;

                        case BuffType.UraliTrance:
                            arg = "Urali Trance";
                            EodonianPotion.RemoveEffects(target, PotionEffect.Urali);
                            break;

                        case BuffType.Bless:
                            arg = "bless";
                            target.RemoveStatMod("[Magic] Str Buff");
                            target.RemoveStatMod("[Magic] Dex Buff");
                            target.RemoveStatMod("[Magic] Int Buff");
                            BuffInfo.RemoveBuff(target, BuffIcon.Bless);
                            BlessSpell.RemoveBless(target);
                            break;
                        }

                        target.SendLocalizedMessage(1080117, arg); //Your ~1_ABILITY_NAME~ has been purged.
                        Caster.SendLocalizedMessage(1080118, arg); //Your target's ~1_ABILITY_NAME~ has been purged.

                        int duration = (int)((Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) / 15);

                        if (duration <= 0)
                        {
                            duration = 1;
                        }

                        m_ImmuneTable.Add(target, new ImmuneTimer(target, TimeSpan.FromSeconds(duration)));
                    }
                    else
                    {
                        Caster.SendLocalizedMessage(1080120); //Your target has no magic that can be purged.

                        int duration = (int)((Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) / 28);

                        if (duration <= 0)
                        {
                            duration = 1;
                        }

                        m_CurseTable.Add(target, new CurseTimer(target, Caster, TimeSpan.FromSeconds(duration)));
                    }
                }
            }

            FinishSequence();
        }
Exemplo n.º 23
0
        public override void OnCast()
        {
            if (Core.SE)
            {
                /* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances.
                 * Physical decrease = 25 - (Inscription/20).
                 * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription)
                 * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
                 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
                 */

                if (CheckSequence())
                {
                    Mobile targ = Caster;

                    ResistanceMod[] mods = (ResistanceMod[])m_Table[targ];

                    if (mods == null)
                    {
                        targ.PlaySound(0x1E9);
                        targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                        int physiMod = -25 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
                        int otherMod = 10;

                        mods = new ResistanceMod[5]
                        {
                            new ResistanceMod(ResistanceType.Physical, physiMod),
                            new ResistanceMod(ResistanceType.Fire, otherMod),
                            new ResistanceMod(ResistanceType.Cold, otherMod),
                            new ResistanceMod(ResistanceType.Poison, otherMod),
                            new ResistanceMod(ResistanceType.Energy, otherMod)
                        };

                        m_Table[targ] = mods;

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.AddResistanceMod(mods[i]);
                        }

                        string buffFormat = String.Format("{0}\t+{1}\t+{1}\t+{1}\t+{1}", physiMod, otherMod);

                        BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.MagicReflection, 1075817, buffFormat, true));
                    }
                    else
                    {
                        targ.PlaySound(0x1ED);
                        targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);

                        m_Table.Remove(targ);

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.RemoveResistanceMod(mods[i]);
                        }

                        BuffInfo.RemoveBuff(targ, BuffIcon.MagicReflection);
                    }
                }

                FinishSequence();
            }
            else
            {
                if (Caster.MagicDamageAbsorb > 0)
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
                else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
                {
                    Caster.SendLocalizedMessage(1005385);                       // The spell will not adhere to you at this time.
                }
                else if (CheckSequence())
                {
                    if (Caster.BeginAction(typeof(DefensiveSpell)))
                    {
                        int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Inscribe].Value);
                        value = (int)(8 + (value / 200) * 7.0);                        //absorb from 8 to 15 "circles"

                        Caster.MagicDamageAbsorb = value;

                        Caster.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);
                        Caster.PlaySound(0x1E9);
                    }
                    else
                    {
                        Caster.SendLocalizedMessage(1005385);                           // The spell will not adhere to you at this time.
                    }
                }

                FinishSequence();
            }
        }
Exemplo n.º 24
0
 public override void EndEffects()
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.Toughness);
 }
Exemplo n.º 25
0
 public override void OnExpire()
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.FocusedEye);
 }
Exemplo n.º 26
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628);                 // You can't do that while polymorphed.
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1063219);                 // You cannot mimic an animal while in that form.
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && AnimalForm.GetContext(Caster) == null))
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                AnimalFormContext context = AnimalForm.GetContext(Caster);
                int mana = ScaleMana(RequiredMana);

                Ninjitsu.AnimalForm.AddLastAnimalForm(Caster, 16);

                if (mana > Caster.Mana)
                {
                    Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                }
                else if (context != null)
                {
                    AnimalForm.RemoveContext(Caster, context, true);
                    Caster.Mana -= mana;

                    BuffInfo.RemoveBuff(Caster, BuffIcon.WhiteTigerForm);
                    return;
                }
                else
                {
                    double ninjitsu = Caster.Skills.Ninjitsu.Value;

                    if (ninjitsu < RequiredSkill + 37.5)
                    {
                        double chance = (ninjitsu - RequiredSkill) / 37.5;

                        if (chance < Utility.RandomDouble())
                        {
                            DoFizzle();
                            return;
                        }
                    }
                }

                Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist);
                Caster.Mana -= mana;

                Caster.CheckSkill(SkillName.Ninjitsu, 0.0, 90.0);

                BaseMount.Dismount(Caster);

                int bodyMod = Caster.Female ? 1255 : 1254;
                int hueMod  = 2500;

                Caster.BodyMod = bodyMod;
                Caster.HueMod  = hueMod;

                Caster.SendSpeedControl(SpeedControlType.MountSpeed);

                Timer timer = new AnimalFormTimer(Caster, bodyMod, hueMod);
                timer.Start();

                int skills = (int)((Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value + (GetMasteryLevel() * 40)) / 3);

                AnimalForm.AddContext(Caster, new AnimalFormContext(timer, null, true, typeof(WildWhiteTiger), null));
                Caster.CheckStatTimers();

                int bleedMod = (int)(((Caster.Skills[SkillName.Ninjitsu].Value + Caster.Skills[SkillName.Stealth].Value + (GetMasteryLevel() * 40)) / 3) / 10);
                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.WhiteTigerForm, 1155911, 1156060, String.Format("{0}\t{1}\t{2}\t{3}", "20", "5", "", bleedMod.ToString())));
                // +~1_ARG~ Defense Chance Increase.<br>+~2_ARG~ Max Defense Chance Increase Cap.<br> Chance to evade attacks.<br>Applies bleed to victim with a max damage of ~4_ARG~.

                Caster.Delta(MobileDelta.WeaponDamage);
            }

            FinishSequence();
        }
Exemplo n.º 27
0
 public override void EndEffects()
 {
     BuffInfo.RemoveBuff(Caster, BuffIcon.Thrust);
 }
Exemplo n.º 28
0
 public override void RemovePartyEffects(Mobile m)
 {
     BuffInfo.RemoveBuff(m, BuffIcon.Perseverance);
 }
Exemplo n.º 29
0
        public override void OnCast()
        {
            if (Core.AOS)
            {
                /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances.
                 * 15 + (Inscription/20) Physcial bonus
                 * -5 Elemental
                 * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
                 * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again.
                 * (+20 physical -5 elemental at 100 Inscription)
                 */
                if (this.CheckSequence())
                {
                    Mobile targ = this.Caster;

                    ResistanceMod[] mods = (ResistanceMod[])m_Table[targ];

                    if (mods == null)
                    {
                        targ.PlaySound(0x1E9);
                        targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                        mods = new ResistanceMod[5]
                        {
                            new ResistanceMod(ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)),
                            new ResistanceMod(ResistanceType.Fire, -5),
                            new ResistanceMod(ResistanceType.Cold, -5),
                            new ResistanceMod(ResistanceType.Poison, -5),
                            new ResistanceMod(ResistanceType.Energy, -5)
                        };

                        m_Table[targ] = mods;

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.AddResistanceMod(mods[i]);
                        }

                        int    physresist = 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
                        string args       = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", physresist, 5, 5, 5, 5);

                        BuffInfo.AddBuff(this.Caster, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, 1075813, args.ToString()));
                    }
                    else
                    {
                        targ.PlaySound(0x1ED);
                        targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);

                        m_Table.Remove(targ);

                        for (int i = 0; i < mods.Length; ++i)
                        {
                            targ.RemoveResistanceMod(mods[i]);
                        }

                        BuffInfo.RemoveBuff(this.Caster, BuffIcon.ReactiveArmor);
                    }
                }

                this.FinishSequence();
            }
            else
            {
                if (this.Caster.MeleeDamageAbsorb > 0)
                {
                    this.Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                }
                else if (!this.Caster.CanBeginAction(typeof(DefensiveSpell)))
                {
                    this.Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
                }
                else if (this.CheckSequence())
                {
                    if (this.Caster.BeginAction(typeof(DefensiveSpell)))
                    {
                        int value = (int)(this.Caster.Skills[SkillName.Magery].Value + this.Caster.Skills[SkillName.Meditation].Value + this.Caster.Skills[SkillName.Inscribe].Value);
                        value /= 3;

                        if (value < 0)
                        {
                            value = 1;
                        }
                        else if (value > 75)
                        {
                            value = 75;
                        }

                        this.Caster.MeleeDamageAbsorb = value;

                        this.Caster.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
                        this.Caster.PlaySound(0x1F2);
                    }
                    else
                    {
                        this.Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
                    }
                }

                this.FinishSequence();
            }
        }
Exemplo n.º 30
0
        public static void OnVirtueUsed(Mobile from)
        {
            if (!from.Alive)
            {
                return;
            }

            if (VirtueHelper.GetLevel(from, VirtueName.Spirituality) < VirtueLevel.Seeker)
            {
                from.SendLocalizedMessage(1155829);                 // You must be a Seeker of Spirituality to invoke this Virtue.
            }
            else
            {
                from.SendLocalizedMessage(1155827);                 // Target whom you wish to embrace with your Spirituality

                from.BeginTarget(
                    10,
                    false,
                    TargetFlags.None,
                    (mobile, targeted) =>
                {
                    if (targeted is Mobile)
                    {
                        var m = (Mobile)targeted;

                        if (VirtueHelper.GetLevel(from, VirtueName.Spirituality) < VirtueLevel.Seeker)
                        {
                            from.SendLocalizedMessage(1155812);                                     // You must be at least a Seeker of Humility to Invoke this ability.
                        }
                        else if (!m.Alive)
                        {
                            from.SendLocalizedMessage(1155828);                                     // Thy target must be among the living.
                        }
                        else if (m is BaseCreature && !((BaseCreature)m).Controlled && !((BaseCreature)m).Summoned)
                        {
                            from.SendLocalizedMessage(1155837);                                     // You can only embrace players and pets with Spirituality.
                        }
                        else if (IsEmbracee(m))
                        {
                            from.SendLocalizedMessage(1155836);                                     // They are already embraced by Spirituality.
                        }
                        else if (m.MeleeDamageAbsorb > 0)
                        {
                            from.SendLocalizedMessage(
                                1156039);                                         // You may not use the Spirituality Virtue while the Attunement spell is active.
                        }
                        else if (m is BaseCreature || m is PlayerMobile)
                        {
                            var context = new SpiritualityContext(from, m);

                            ActiveTable[from] = context;

                            m.SendLocalizedMessage(1155839);                                     // Your spirit has been embraced! You feel more powerful!
                            from.SendLocalizedMessage(1155835);                                  // You have lost some Spirituality.

                            BuffInfo.AddBuff(
                                m,
                                new BuffInfo(
                                    BuffIcon.Spirituality,
                                    1155824,
                                    1155825,
                                    String.Format(
                                        "{0}\t{1}",
                                        context.Reduction.ToString(),
                                        context.Pool.ToString())));                                                 // ~1_VAL~% Reduction to Incoming Damage<br>~2_VAL~ Shield HP Remaining

                            VirtueHelper.Atrophy(from, VirtueName.Spirituality, 3200);

                            Timer.DelayCall(
                                TimeSpan.FromMinutes(20),
                                () =>
                            {
                                if (ActiveTable != null && ActiveTable.ContainsKey(from))
                                {
                                    ActiveTable.Remove(from);

                                    m.SendLocalizedMessage(1155840);                                                     // Your spirit is no longer embraced. You feel less powerful.

                                    BuffInfo.RemoveBuff(m, BuffIcon.Spirituality);
                                }
                            });
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1155837);                                 // You can only embrace players and pets with Spirituality.
                    }
                });
            }
        }