Example #1
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            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);
        }