Example #1
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                SkillMasterySpell spell = GetSpell(Caster, this.GetType());

                if (spell != null)
                {
                    spell.Expire();
                }

                double skill = ((Caster.Skills[CastSkill].Value + ArcanistSpell.GetFocusLevel(Caster) * 20) / 2) + (GetMasteryLevel() * 20) + 20;
                Chance = (skill / 13.0) / 100.0;

                Expires = DateTime.UtcNow + TimeSpan.FromSeconds(600);
                BeginTimer();

                Caster.PlaySound(0x20C);
                Caster.FixedParticles(0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist);

                IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map);
                IEntity to   = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map);
                Effects.SendMovingParticles(from, to, 5494, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ManaShield, 1155902, 1156056, TimeSpan.FromSeconds(600), Caster, String.Format("{0}\t{1}\t{1}", ((int)(Chance * 100)).ToString(), "50"))); // ~1_CHANCE~% chance to reduce incoming damage by ~2_DAMAGE~%. Costs ~2_DAMAGE~% of original damage in mana.
            }

            FinishSequence();
        }
Example #2
0
        public override bool CheckCast()
        {
            SkillMasterySpell spell = GetSpell(Caster, GetType());

            if (spell != null)
            {
                spell.Expire();
                BuffInfo.RemoveBuff(Caster, BuffIcon.Shadow);
                return(false);
            }

            return(base.CheckCast());
        }
Example #3
0
        public override bool CheckCast()
        {
            if (Caster is PlayerMobile && !((PlayerMobile)Caster).Spellweaving)
            {
                Caster.SendLocalizedMessage(1073220); // You must have completed the epic arcanist quest to use this ability.
                return(false);
            }

            SkillMasterySpell spell = GetSpell(Caster, this.GetType());

            if (spell != null)
            {
                spell.Expire();
                return(false);
            }

            return(base.CheckCast());
        }
Example #4
0
        public override bool CheckCast()
        {
            SkillMasterySpell spell = GetSpell(Caster, GetType());

            if (spell != null)
            {
                spell.Expire();
                return(false);
            }

            if (!CheckWeapon())
            {
                Caster.SendLocalizedMessage(1156006); // You must have a swordsmanship weapon equipped to use this ability.
                return(false);
            }

            return(base.CheckCast());
        }
Example #5
0
        protected override void OnTarget(object o)
        {
            Mobile m = o as Mobile;

            if (m != null)
            {
                if (CheckHSequence(m))
                {
                    if (CheckResisted(m))
                    {
                        m.SendLocalizedMessage(1156101);      // You resist the effects of death ray.
                        Caster.SendLocalizedMessage(1156102); // Your target resists the effects of death ray.
                    }
                    else
                    {
                        SpellHelper.CheckReflect(0, Caster, ref m);
                        SkillMasterySpell spell = GetSpell(Caster, this.GetType());

                        if (spell != null && spell.Target == m)
                        {
                            spell.Expire();
                        }

                        _Location = Caster.Location;

                        m.FixedParticles(0x374A, 1, 15, 5054, 0x7A2, 7, EffectLayer.Head);
                        Caster.FixedParticles(0x0000, 10, 5, 2054, EffectLayer.Head);

                        double damage = (Caster.Skills[CastSkill].Base + Caster.Skills[DamageSkill].Base) * ((double)GetMasteryLevel() * .8);
                        damage /= Target is PlayerMobile ? 5.15 : 2.5;

                        int mod = (int)Caster.Skills[DamageSkill].Value / 12;
                        _Mod = new ResistanceMod(ResistanceType.Energy, -mod);
                        m.AddResistanceMod(_Mod);

                        BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.DeathRay, 1155896, 1156085, String.Format("{0}\t{1}", ((int)damage).ToString(), m.Name))); // Deals ~2_DAMAGE~ to ~1_NAME~ every 3 seconds while in range. Preforming any action will end spell.
                        BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.DeathRayDebuff, 1155896, 1156086, mod.ToString()));                                             // Energy Resist Debuff: ~1_VAL~%

                        Target = m;
                        BeginTimer();
                    }
                }
            }
        }