Ejemplo n.º 1
0
        public override bool CheckCast()
        {
            int mana = ScaleMana(RequiredMana);

            if (!base.CheckCast())
            {
                return(false);
            }

            if (!CheckExpansion(Caster))
            {
                Caster.SendLocalizedMessage(1063456);                   // You must upgrade to Samurai Empire in order to use that ability.
                return(false);
            }

            if (Caster.Skills[CastSkill].Value < RequiredSkill)
            {
                string args = String.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), CastSkill.ToString());
                Caster.SendLocalizedMessage(1063013, args);                   // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }
            else if (Caster.Mana < mana)
            {
                Caster.SendLocalizedMessage(1060174, mana.ToString());                   // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (Caster.Skills[SkillName.Chivalry].Value < RequiredSkill)
            {
                Caster.SendLocalizedMessage(1060172, RequiredSkill.ToString("F1")); // You must have at least ~1_SKILL_REQUIREMENT~ Chivalry to use this ability,
                return(false);
            }
            else if (Caster.TithingPoints < RequiredTithing)
            {
                Caster.SendLocalizedMessage(1060173, RequiredTithing.ToString()); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
                return(false);
            }
            else if (Caster.Mana < ScaleMana(RequiredMana))
            {
                Caster.SendLocalizedMessage(1060174, RequiredMana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public override bool CheckFizzle()
        {
            int mana = ScaleMana(RequiredMana);

            if (Caster.Skills[CastSkill].Value < RequiredSkill)
            {
                Caster.SendLocalizedMessage(1070768,
                                            RequiredSkill.ToString("F1")); // You need ~1_SKILL_REQUIREMENT~ Bushido skill to perform that attack!
                return(false);
            }

            if (Caster.Mana < mana)
            {
                Caster.SendLocalizedMessage(1060174,
                                            mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            if (!base.CheckFizzle())
            {
                return(false);
            }

            Caster.Mana -= mana;

            return(true);
        }
Ejemplo n.º 4
0
        public override bool CanAugment(Mobile from, object target)
        {
            if (from == null)
            {
                return(false);
            }

            if (target is BaseDoor || target is LockableContainer)
            {
                Item d = target as Item;

                if (RequiredSkillLevel > 0 && from.Skills[RequiredSkill].Value < RequiredSkillLevel)
                {
                    from.SendMessage("You lack the {0} skill to use this", RequiredSkill.ToString());
                    return(false);
                }

                if ((d is BaseDoor && ((BaseDoor)d).KeyValue == KeyValue) || (d is LockableContainer && ((LockableContainer)d).KeyValue == KeyValue))
                {
                    return(true);
                }
            }

            return(false);
        }
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (!CheckExpansion(Caster))
            {
                Caster.SendLocalizedMessage(1072176);                   // You must upgrade to the Mondain's Legacy Expansion Pack before using that ability
                return(false);
            }

            //TODO: Spellweaving quest completion

            int mana = ScaleMana(RequiredMana);

            if (Caster.Mana < mana)
            {
                Caster.SendLocalizedMessage(1060174, mana.ToString());                   // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }
            else if (Caster.Skills[CastSkill].Value < RequiredSkill)
            {
                Caster.SendLocalizedMessage(1063013, String.Format("{0}\t{1}", RequiredSkill.ToString("F1"), "#1044114"));                       // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }

            return(true);
        }
Ejemplo n.º 6
0
        public virtual bool CheckSkills(Mobile m)
        {
            if (m.Skills[MoveSkill].Value < RequiredSkill)
            {
                string args = String.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), MoveSkill.ToString());
                m.SendLocalizedMessage(1063013, args);                   // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }

            return(true);
        }
Ejemplo n.º 7
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (!CheckExpansion(Caster))
            {
                Caster.SendLocalizedMessage(1072176);
                // You must upgrade to the Mondain's Legacy Expansion Pack before using that ability
                return(false);
            }

            if (!MondainsLegacy.Spellweaving)
            {
                Caster.SendLocalizedMessage(1042753, "Spellweaving");                 // ~1_SOMETHING~ has been temporarily disabled.
                return(false);
            }

            if (Caster is PlayerMobile && !((PlayerMobile)Caster).Spellweaving)
            {
                Caster.SendLocalizedMessage(1073220);                 // You must have completed the epic arcanist quest to use this ability.
                return(false);
            }

            int mana = ScaleMana(RequiredMana);

            if (Caster.Mana < mana)
            {
                Caster.SendLocalizedMessage(1060174, mana.ToString(CultureInfo.InvariantCulture));
                // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            if (Caster.Skills[CastSkill].Value < RequiredSkill)
            {
                Caster.SendLocalizedMessage(1063013, String.Format("{0}\t{1}", RequiredSkill.ToString("F1"), "#1044114"));
                // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }

            return(true);
        }
Ejemplo n.º 8
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            Mobile caster = Caster;

            if (!CheckExpansion(caster))
            {
                caster.SendLocalizedMessage(1072176);                 // You must upgrade to the Mondain's Legacy Expansion Pack before using that ability
                return(false);
            }

            if (caster is PlayerMobile)
            {
                MLQuestContext context = MLQuestSystem.GetContext((PlayerMobile)caster);

                if (context == null || !context.Spellweaving)
                {
                    caster.SendLocalizedMessage(1073220);                     // You must have completed the epic arcanist quest to use this ability.
                    return(false);
                }
            }

            int mana = ScaleMana(RequiredMana);

            if (caster.Mana < mana)
            {
                caster.SendLocalizedMessage(1060174, mana.ToString());                 // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }
            else if (caster.Skills[CastSkill].Value < RequiredSkill)
            {
                caster.SendLocalizedMessage(1063013, string.Format("{0}\t{1}", RequiredSkill.ToString("F1"), "#1044114"));                 // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }

            return(true);
        }
Ejemplo n.º 9
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (Caster.Skills[SkillName.Bushido].Value < RequiredSkill)
            {
                string args = String.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), CastSkill.ToString());
                Caster.SendLocalizedMessage(1063013, args);                   // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }
            else if (Caster.Mana < ScaleMana(RequiredMana))
            {
                Caster.SendLocalizedMessage(1060174, RequiredMana.ToString());                   // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            return(true);
        }
Ejemplo n.º 10
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (Caster is PlayerMobile)
            {
                if (!CheckExpansion(Caster))
                {
                    Caster.SendLocalizedMessage(1072176);                       // You must upgrade to the Mondain's Legacy Expansion Pack before using that ability
                    return(false);
                }

                PlayerMobile pm = Caster as PlayerMobile;

                if (!pm.Arcanist)
                {
                    pm.SendLocalizedMessage(1073220);                       // You must have completed the epic arcanist quest to use this ability.
                    return(false);
                }
            }

            int mana = ScaleMana(RequiredMana);

            if (Caster.Mana < mana)
            {
                Caster.SendLocalizedMessage(1060174, mana.ToString());                   // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            if (Caster.Skills[CastSkill].Value < RequiredSkill)
            {
                Caster.SendLocalizedMessage(1063013, String.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), CastSkill.ToString()));                       // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }

            return(true);
        }
Ejemplo n.º 11
0
        public override bool CheckFizzle()
        {
            int requiredTithing = this.RequiredTithing;

            if (AosAttributes.GetValue(Caster, AosAttribute.LowerRegCost) > Utility.Random(100))
            {
                requiredTithing = 0;
            }

            int mana = ScaleMana(RequiredMana);

            if (Caster.Skills[SkillName.Chivalry].Value < RequiredSkill)
            {
                Caster.SendLocalizedMessage(1060172, RequiredSkill.ToString("F1")); // You must have at least ~1_SKILL_REQUIREMENT~ Chivalry to use this ability,
                return(false);
            }
            else if (Caster.TithingPoints < requiredTithing)
            {
                Caster.SendLocalizedMessage(1060173, RequiredTithing.ToString()); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
                return(false);
            }
            else if (Caster.Mana < mana)
            {
                Caster.SendLocalizedMessage(1060174, RequiredMana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            Caster.TithingPoints -= requiredTithing;

            if (!base.CheckFizzle())
            {
                return(false);
            }

            Caster.Mana -= mana;

            return(true);
        }
Ejemplo n.º 12
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (!CheckExpansion(Caster))
            {
                Caster.SendLocalizedMessage(1063456);                   // You must upgrade to Samurai Empire in order to use that ability.

                return(false);
            }

            if (Caster.Skills[SkillName.Bushido].Value < RequiredSkill)
            {
                string args = String.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), CastSkill.ToString());
                Caster.SendLocalizedMessage(1063013, args);                   // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }
            else if (Caster.Mana < ScaleMana(RequiredMana))
            {
                Caster.SendLocalizedMessage(1060174, RequiredMana.ToString());                   // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            if (HonorableExecution.UnderEffect(Caster) || LightningStrike.UnderEffect(Caster) || MomentumStrike.UnderEffect(Caster))
            {
                return(true);
            }

            WeaponAbility ability = WeaponAbility.GetCurrentAbility(Caster);

            if (ability != null)
            {
                WeaponAbility.ClearCurrentAbility(Caster);
            }

            if (AnimalForm.UnderEffect(Caster))
            {
                if (this is HonorableExecution || this is LightningStrike || this is MomentumStrike)
                {
                    Caster.SendLocalizedMessage(1063024);                       // You cannot perform this special move right now.

                    return(false);
                }
            }

            if (FocusAttack.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0xF5, 0));

                FocusAttack.m_Table.Remove(Caster);

                BaseWeapon weapon = Caster.Weapon as BaseWeapon;

                if (weapon != null)
                {
                    FocusAttack.RemoveBonus(weapon);
                }
            }

            if (DeathStrike.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0xF6, 0));

                DeathStrike.m_Table.Remove(Caster);
            }

            if (KiAttack.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0xF8, 0));

                KiAttack.m_Table.Remove(Caster);
            }

            if (SurpriseAttack.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0xF9, 0));

                SurpriseAttack.m_Table.Remove(Caster);
            }

            if (Backstab.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0xFA, 0));

                Backstab.m_Table.Remove(Caster);
            }

            return(true);
        }
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (!SamuraiSpell.CheckExpansion(Caster))
            {
                Caster.SendLocalizedMessage(1063456);                   // You must upgrade to Samurai Empire in order to use that ability.

                return(false);
            }

            if (Caster.Skills[SkillName.Ninjitsu].Value < RequiredSkill)
            {
                string args = String.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), CastSkill.ToString());
                Caster.SendLocalizedMessage(1063013, args);                   // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
                return(false);
            }
            else if (Caster.Mana < ScaleMana(RequiredMana))
            {
                Caster.SendLocalizedMessage(1060174, RequiredMana.ToString());                   // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                return(false);
            }

            if (FocusAttack.UnderEffect(Caster) || DeathStrike.UnderEffect(Caster) || SurpriseAttack.UnderEffect(Caster) || Backstab.UnderEffect(Caster) || KiAttack.UnderEffect(Caster))
            {
                return(true);
            }

            if (AnimalForm.UnderEffect(Caster))
            {
                if (this is FocusAttack || this is DeathStrike || this is KiAttack || this is SurpriseAttack || this is Backstab)
                {
                    Caster.SendLocalizedMessage(1063024);                       // You cannot perform this special move right now.

                    return(false);
                }
            }

            WeaponAbility ability = WeaponAbility.GetCurrentAbility(Caster);

            if (ability != null)
            {
                WeaponAbility.ClearCurrentAbility(Caster);
            }

            if (HonorableExecution.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x91, 0));

                HonorableExecution.m_Table.Remove(Caster);
            }

            if (LightningStrike.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x95, 0));

                LightningStrike.m_Table.Remove(Caster);
            }

            if (MomentumStrike.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x96, 0));

                MomentumStrike.m_Table.Remove(Caster);
            }

            return(true);
        }