Example #1
0
        public override void GetRewards(MLQuestInstance instance)
        {
            PlayerMobile pm = instance.Player;

            if (!pm.HasRecipe(32))
            {
                // The ability is awarded regardless of blacksmithy skill
                pm.AcquireRecipe(32);

                if (pm.Skills[SkillName.Blacksmith].Base < 45.0)            // TODO: Verify threshold
                {
                    pm.SendLocalizedMessage(1075005);                       // You observe carefully but you can't grasp the complexities of smithing a bone handled machete.
                }
                else
                {
                    pm.SendLocalizedMessage(1075006);                       // You have learned how to smith a bone handled machete!
                }
            }

            base.GetRewards(instance);
        }
Example #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                   // I can't reach that.
                return;
            }

            Recipe r = Recipe;

            if (r != null && from is PlayerMobile)
            {
                PlayerMobile pm = from as PlayerMobile;

                if (!pm.HasRecipe(r))
                {
                    bool   allRequiredSkills = true;
                    double chance            = r.CraftItem.GetSuccessChance(from, null, r.CraftSystem, false, ref allRequiredSkills);

                    if (allRequiredSkills && chance >= 0.0)
                    {
                        pm.SendLocalizedMessage(1073451, RecipeName); //r.TextDefinition.ToString()); // You have learned a new recipe: ~RecipeName~
                        //pm.SendLocalizedMessage( 1073451, r.TextDefinition.ToString() ); // You have learned a new recipe: ~1_RECIPE~
                        pm.AcquireRecipe(r);
                        Delete();
                    }
                    else
                    {
                        pm.SendLocalizedMessage(1044153);                           // You don't have the required skills to attempt this item.
                    }
                }
                else
                {
                    pm.SendLocalizedMessage(1073427);                       // You already know this recipe.
                }
            }
        }