Exemple #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                if (MasteryInfo.HasLearned(from, Skill, Volume))
                {
                    from.SendLocalizedMessage(1155884, $"#{MasteryInfo.GetLocalization(Skill)}"); // You are already proficient in this level of ~1_MasterySkill~
                }
                else if (MasteryInfo.LearnMastery(from, Skill, Volume))
                {
                    from.SendLocalizedMessage(1155885, $"#{MasteryInfo.GetLocalization(Skill)}"); // You have increased your proficiency in ~1_SkillMastery~!

                    Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0);
                    Effects.PlaySound(from.Location, from.Map, 0x243);

                    Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0xAA8, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
                    Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0xAA8, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
                    Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0xAA8, 0, 9502, 1, 0, (EffectLayer)255, 0x100);

                    Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100);

                    Delete();

                    if (from.Skills.CurrentMastery == Skill)
                    {
                        MasteryInfo.OnMasteryChanged(from, from.Skills.CurrentMastery);
                    }
                }
            }
        }
        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                return;
            }

            SkillName n       = (SkillName)info.ButtonID - 1;
            SkillName current = User.Skills.CurrentMastery;

            if (n == current)
            {
                User.Skills.CurrentMastery = SkillName.Alchemy;
                MasteryInfo.OnMasteryChanged(User, current);
            }
            else if (User.Skills[n].Base >= MasteryInfo.MinSkillRequirement)
            {
                User.SendLocalizedMessage(1155886, User.Skills[n].Info.Name); // Your active skill mastery is now set to ~1_MasterySkill~!
                User.Skills.CurrentMastery = n;

                MasteryInfo.OnMasteryChanged(User, current);

                BookOfMasteries.AddToCooldown(User);
            }
            else
            {
                User.SendLocalizedMessage(1156236, string.Format("{0}\t{1}", MasteryInfo.MinSkillRequirement.ToString(), User.Skills[n].Info.Name)); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that mastery.
            }
        }