예제 #1
0
        public override bool CheckCast()
        {
            int mana = ScaleMana(RequiredMana);

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

            if (IsInCooldown(Caster, this.GetType()))
            {
                return(false);
            }

            if (Caster.Player && Caster.Skills[CastSkill].Value < RequiredSkill)
            {
                Caster.SendLocalizedMessage(1115709); // Your skills are not high enough to invoke this mastery ability.
            }
            else if (Caster is PlayerMobile && Caster.Skills.CurrentMastery != CastSkill)
            {
                Caster.SendLocalizedMessage(1115664); // You are not on the correct path for using this mastery ability.
            }
            else if (Caster is PlayerMobile && !MasteryInfo.HasLearned(Caster, CastSkill))
            {
                Caster.SendLocalizedMessage(1115664); // You are not on the correct path for using this mastery ability.
            }
            else if (Caster.Mana < mana)
            {
                Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
            }
            else
            {
                if (CancelsWeaponAbility)
                {
                    WeaponAbility.ClearCurrentAbility(Caster);
                }

                if (CancelsSpecialMove)
                {
                    SpecialMove.ClearCurrentMove(Caster);
                }

                return(true);
            }

            return(false);
        }
예제 #2
0
        public ChooseTrainingGump(Mobile caster, BaseCreature target, CombatTrainingSpell spell) : base(100, 100)
        {
            Spell  = spell;
            Caster = caster;
            Target = target;

            AddBackground(0, 0, 260, 187, 3600);
            AddAlphaRegion(10, 10, 240, 167);

            AddImageTiled(220, 15, 30, 162, 10464);

            AddHtmlLocalized(20, 20, 150, 16, 1156113, Hue, false, false); // Select Training

            int y = 40;

            if (MasteryInfo.HasLearned(caster, SkillName.AnimalTaming, 1))
            {
                AddButton(20, y, 9762, 9763, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(43, y, 150, 16, 1156109, Hue, false, false); // Empowerment
                y += 20;
            }

            if (MasteryInfo.HasLearned(caster, SkillName.AnimalTaming, 2))
            {
                AddButton(20, y, 9762, 9763, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(43, y, 150, 16, 1153271, Hue, false, false); // Berserk
                y += 20;
            }

            if (MasteryInfo.HasLearned(caster, SkillName.AnimalTaming, 3))
            {
                AddButton(20, y, 9762, 9763, 3, GumpButtonType.Reply, 0);
                AddHtmlLocalized(43, y, 150, 16, 1156108, Hue, false, false); // Consume Damage
                y += 20;
            }

            if (MasteryInfo.HasLearned(caster, SkillName.AnimalTaming, 1))
            {
                AddButton(20, y, 9762, 9763, 4, GumpButtonType.Reply, 0);
                AddHtmlLocalized(43, y, 150, 16, 1157544, Hue, false, false); // As One
                y += 20;
            }
        }