public void UseDiscord()
        {
            Mobile target = this.m_Mobile.Combatant as Mobile;

            if (target == null)
            {
                return;
            }

            if (!this.m_Mobile.UseSkill(SkillName.Discordance))
            {
                return;
            }

            if (this.m_Mobile.Debug)
            {
                this.m_Mobile.Say(1162, "Discording");
            }

            // Discord's target flag is harmful so the AI already targets it's combatant.
            // However players are immune to Discord hence the following.
            if (target is PlayerMobile)
            {
                double   effect   = -(this.m_Mobile.Skills[SkillName.Discordance].Value / 5.0);
                TimeSpan duration = TimeSpan.FromSeconds(this.m_Mobile.Skills[SkillName.Discordance].Value * 2);

                ResistanceMod[] mods =
                {
                    new ResistanceMod(ResistanceType.Physical, (int)(effect * 0.01)),
                    new ResistanceMod(ResistanceType.Fire,     (int)(effect * 0.01)),
                    new ResistanceMod(ResistanceType.Cold,     (int)(effect * 0.01)),
                    new ResistanceMod(ResistanceType.Poison,   (int)(effect * 0.01)),
                    new ResistanceMod(ResistanceType.Energy,   (int)(effect * 0.01))
                };

                TimedResistanceMod.AddMod(target, "Discordance", mods, duration);
                target.AddStatMod(new StatMod(StatType.Str, "DiscordanceStr", (int)(target.RawStr * effect), duration));
                target.AddStatMod(new StatMod(StatType.Int, "DiscordanceInt", (int)(target.RawInt * effect), duration));
                target.AddStatMod(new StatMod(StatType.Dex, "DiscordanceDex", (int)(target.RawDex * effect), duration));
                new DiscordEffectTimer(target, duration).Start();
            }
        }
Exemple #2
0
        public static void MustardBomb(Mobile from, Mobile to)
        {
            if (!Ability.CanUse(to, from, true))
            {
                return;
            }

            Point3D point = to.Location;

            for (int i = -3; i < 4; i++)
            {
                for (int j = -3; j < 4; j++)
                {
                    point = new Point3D(to.X + i, to.Y + j, to.Z);

                    if (BlueSpell.GetDist(point, to.Location) < 3.1)
                    {
                        Effects.SendLocationEffect(point, to.Map, 0x3728, 13, 1283 /*Hue*/, 4);
                    }
                }
            }

            ResistanceMod[] mods = new ResistanceMod[] { new ResistanceMod(ResistanceType.Fire, -300),
                                                         new ResistanceMod(ResistanceType.Cold, -300) };

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

            TimedResistanceMod.AddMod(
                to,
                "Mustard Bomb",
                mods,
                TimeSpan.FromSeconds(60)
                );

            to.AddSkillMod(new TimedSkillMod(SkillName.MagicResist, true, -120.0, TimeSpan.FromSeconds(60)));

            to.SendMessage("The intense heat scalds your elemental resistance.");
        }
Exemple #3
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if (attacker != null && defender != null)
            {
                ResistanceMod[] mods = new ResistanceMod[] { new ResistanceMod(ResistanceType.Fire, -15) };

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

                TimedResistanceMod.AddMod(
                    defender,
                    "BistroFork",
                    mods,
                    TimeSpan.FromSeconds(10)
                    );
            }
        }
Exemple #4
0
        public override void SpellEffect(Mobile target)
        {
            if (target == Caster)
            {
                return;
            }

            target.SendMessage("You breath in a noxious gas");

            // Done primarly to draw aggro.
            SpellHelper.Damage(this, target, GetDamage(Caster, target, DamageSkill, 0.5), 0, 0, 100, 0, 0);

            if (target == null)
            {
                return;
            }

            int dc     = 10 + (int)ScaleBySkill(Caster, DamageSkill);
            int debuff = (int)(ScaleBySkill(Caster, DamageSkill) / 2);

            debuff = -debuff;
            bool totalfail = true;

            StringBuilder sb = new StringBuilder();

            sb.Append("You see ");
            sb.Append(target.Name);
            sb.Append(" suffer penalties to:");

            if (FullPower())
            {
                dc += 120;
            }

            if (!SavingThrow(target, DDSave.Will, dc))
            {
                Slow.SlowWalk(target, dc * 2);
                target.SendMessage("You have been slowed");
                sb.Append(" Speed");
                totalfail = false;
            }

            if (!SavingThrow(target, DDSave.Fort, dc))
            {
                target.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, debuff, TimeSpan.FromSeconds(dc * 2)));
                target.AddStatMod(new StatMod(StatType.Str, "Bad Breath Str", debuff, TimeSpan.FromSeconds(dc * 2)));
                target.AddStatMod(new StatMod(StatType.Dex, "Bad Breath Dex", debuff, TimeSpan.FromSeconds(dc * 2)));
                target.AddStatMod(new StatMod(StatType.Int, "Bad Breath Int", debuff, TimeSpan.FromSeconds(dc * 2)));
                sb.Append(" Tactics");
                totalfail = false;

                if (dc > 120)
                {
                    target.AddSkillMod(new TimedSkillMod(SkillName.MagicResist, true, debuff, TimeSpan.FromSeconds(dc * 2)));
                }
            }

            if (!SavingThrow(target, DDSave.Refl, dc))
            {
                ResistanceMod[] mods =
                {
                    new ResistanceMod(ResistanceType.Physical, debuff),
                    new ResistanceMod(ResistanceType.Fire,     debuff),
                    new ResistanceMod(ResistanceType.Cold,     debuff),
                    new ResistanceMod(ResistanceType.Poison,   debuff),
                    new ResistanceMod(ResistanceType.Energy,   debuff)
                };

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

                TimedResistanceMod.AddMod(target, "Bad Breath", mods, TimeSpan.FromSeconds(Caster.Skills[DamageSkill].Value));
                sb.Append(" Resistance");
                totalfail = false;
            }

            if (dc > 120)
            {
                target.ApplyPoison(Caster, Poison.Greater);
            }

            if (totalfail)
            {
                Caster.SendMessage(target.Name + " saved against your spell.");
            }
            else
            {
                Caster.SendMessage(sb.ToString());
            }
        }
        public override void OnTarget(Mobile target)
        {
            /* Effects.SendMovingEffect(
             *      IEntity from,
             *      IEntity to,
             *      int itemID, int speed, int duration, bool fixedDirection, bool explodes, int hue, int renderMode );  */

            // West
            Effects.SendMovingEffect(
                new Entity(Serial.Zero, new Point3D(target.X - 1, target.Y, target.Z - 20), target.Map),
                new Entity(Serial.Zero, new Point3D(target.X - 1, target.Y, target.Z + 20), target.Map),
                14678, 5, 1, false, false, 1, 4);

            // North
            Effects.SendMovingEffect(
                new Entity(Serial.Zero, new Point3D(target.X, target.Y - 1, target.Z - 20), target.Map),
                new Entity(Serial.Zero, new Point3D(target.X, target.Y - 1, target.Z + 20), target.Map),
                14662, 5, 1, false, false, 1, 4);

            // East
            Effects.SendMovingEffect(
                new Entity(Serial.Zero, new Point3D(target.X + 1, target.Y, target.Z - 20), target.Map),
                new Entity(Serial.Zero, new Point3D(target.X + 1, target.Y, target.Z + 20), target.Map),
                14678, 5, 1, false, false, 1, 4);

            // South
            Effects.SendMovingEffect(
                new Entity(Serial.Zero, new Point3D(target.X, target.Y + 1, target.Z - 20), target.Map),
                new Entity(Serial.Zero, new Point3D(target.X, target.Y + 1, target.Z + 20), target.Map),
                14662, 5, 1, false, false, 1, 4);

            target.SendMessage("You are under the effects of Mightyguard");

            if (Status.Enabled)
            {
                ShellSpell.BeginShell(target, (int)(ScaleBySkill(Caster, DamageSkill) * 8));
                ProtectSpell.BeginProtect(target, (int)(ScaleBySkill(Caster, DamageSkill) * 8));
            }
            else
            {
                int bonus = (int)(ScaleBySkill(Caster, DamageSkill));
                int buff  = 0;
                List <ResistanceMod> mods = new List <ResistanceMod>();

                // Physical
                buff = target.GetMinResistance(ResistanceType.Physical) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Physical, buff));
                }

                // Fire
                buff = target.GetMinResistance(ResistanceType.Fire) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Fire, buff));
                }

                // Cold
                buff = target.GetMinResistance(ResistanceType.Cold) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Cold, buff));
                }

                // Poison
                buff = target.GetMinResistance(ResistanceType.Poison) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Poison, buff));
                }

                // Energy
                buff = target.GetMinResistance(ResistanceType.Energy) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Energy, buff));
                }

                ResistanceMod[] modarray = mods.ToArray();

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

                TimedResistanceMod.AddMod(target, "Mighty Guard", modarray, TimeSpan.FromSeconds((ScaleBySkill(Caster, DamageSkill) * 12)));
            }

            BlueMageControl.CheckKnown(target, this, CanTeach(target));
        }