summaryrefslogblamecommitdiff
path: root/npc/craft/recipes.txt
blob: c3afa572d6f17d1c4c4024d4144f9848e094f027 (plain) (tree)





















































































                                                                                                    

























































                                                              
























                                                                
// TMW-2 script.
// Author:
//    Jesusalva
// Description:
//    Recipe Books in TMW2

-	script	#RecipeBook	NPC_HIDDEN,{
    function showRecipe;
    function readCooking;
    function readAlchemy;
    function readCrafting;

OnUse:
    setnpcdialogtitle l("Recipe Book");

    mesc l("You open the Recipe Book. Each recipe you get can be put here.");
    next;
    do {
        mesc l("Which recipes do you want to read?");
        select
            l("Nothing."),
            l("Cooking Recipes."),
            l("Alchemy Recipes."),
            l("Crafting Recipes.");
        mes "";
        switch (@menu) {
            case 2:
                readCooking(); break;
            case 3:
                readAlchemy(); break;
            case 4:
                readCrafting(); break;
        }
    } while (@menu != 1);
    closeclientdialog;
    close;

// Expects: @scope$
// showRecipe( Craft, Bonus, {item 1, amount 1}, {item 2, amount 2}... )
function showRecipe {
    if (getargcount() < 3 || getargcount() % 2 != 0 || @scope$ == "")
        return Exception("Faulty recipe skill command invoked - error");

    // getd("$RECIPES_ALCHEMY_"+getcharid(2)+"["+getarg(0)+"]")
    if (getd("RECIPES_"+@scope$+"["+getarg(0)+"]") {
        if (getarg(1)) {
            mesn l(".:: @@ Recipe ::.", getitemlink(getarg(1)));

            for (.@i=2;.@i < getargcount(); .@i++) {
                mesc l("@@/@@ @@", countitem(getarg(.@i)), getarg(.@i+1), getitemlink(getarg(.@i)));
                .@i++;
            }
            mes "";
        }
        return 1;
    }
    //debugmes "Nope, nothing here";
    return 0;
}

// =============================== Cooking Functions
function readCooking {
    setnpcdialogtitle l("Cooking Recipes");
    @scope$="COOKING";

    mesc l("Eating is a necessity, but cooking is an art.");
    mesc l("(All items must be placed exactly in this order.)");
    next;
    mesc l("List of known cooking recipes:");
    mes "";
    showRecipe(0, Iten, WarpedLog, 9999);
    next;
    @scope$="";
    return;
}

// =============================== Cooking Functions
function readCooking {
    setnpcdialogtitle l("Alchemy Recipes");
    @scope$="ALCHEMY";

    mesc l("Burn burn!");
    mesc l("(All items must be placed exactly in this order.)");
    next;
    mesc l("List of known alchemy recipes:");
    mes "";
    // Healing
    mesc "----------"+l("Healing Recipes")+"----------", 2;
    showRecipe(CraftPiberriesInfusion, PiberriesInfusion,
                    5, Piberries, 1, Curshroom);
    next;

    // General Boosts
    mesc "----------"+l("General Recipes")+"----------", 2;
    showRecipe(CraftHastePotion, HastePotion,
                    15, Plushroom);
    showRecipe(CraftStrengthPotion, StrengthPotion,
                    15, Chagashroom);
    showRecipe(CraftResetPotion, StatusResetPotion,
                    90, ManaPiouFeathers, 10, Curshroom);
    showRecipe(CraftSpeedPotion, MoveSpeedPotion,
                    1, GemPowder, 5, FluoPowder);
    showRecipe(CraftPrecisionPotion, PrecisionPotion,
                    3, Piberries, 1, MountainSnakeEgg);
    showRecipe(CraftDodgePotion, DodgePotion,
                    3, Piberries, 1, SnakeEgg);
    next;

    // Stats Boosts
    mesc "----------"+l("Stat Boost Recipes")+"----------", 2;
    showRecipe(CraftLukPotionA, LukPotionA,
                    1, EmeraldPower, 1, HerbalTea);
    showRecipe(CraftLukPotionB, LukPotionB,
                    1, Emerald, 2, HerbalTea);
    showRecipe(CraftLukPotionC, LukPotionC,
                    1, PolishedEmerald, 3, HerbalTea);

    showRecipe(CraftDexPotionA, DexPotionA,
                    1, AmethystPower, 1, HerbalTea);
    showRecipe(CraftDexPotionB, DexPotionB,
                    1, Amethyst, 2, HerbalTea);
    showRecipe(CraftDexPotionC, DexPotionC,
                    1, PolishedAmethyst, 3, HerbalTea);

    showRecipe(CraftIntPotionA, IntPotionA,
                    1, SapphirePower, 1, HerbalTea);
    showRecipe(CraftIntPotionB, IntPotionB,
                    1, Sapphire, 2, HerbalTea);
    showRecipe(CraftIntPotionC, IntPotionC,
                    1, PolishedSapphire, 3, HerbalTea);

    showRecipe(CraftVitPotionA, VitPotionA,
                    1, DiamondPower, 1, HerbalTea);
    showRecipe(CraftVitPotionB, VitPotionB,
                    1, Diamond, 2, HerbalTea);
    showRecipe(CraftVitPotionC, VitPotionC,
                    1, PolishedDiamond, 3, HerbalTea);

    showRecipe(CraftAgiPotionA, AgiPotionA,
                    1, TopazPower, 1, HerbalTea);
    showRecipe(CraftAgiPotionB, AgiPotionB,
                    1, Topaz, 2, HerbalTea);
    showRecipe(CraftAgiPotionC, AgiPotionC,
                    1, PolishedTopaz, 3, HerbalTea);
    next;
    @scope$="";
    return;
}

// =============================== Crafting Functions
function readCrafting {
    setnpcdialogtitle l("Crafting Recipes");
    @scope$="EQUIPMENT";

    mesc l("Smith smith!");
    mesc l("(All items must be placed exactly in this order.)");
    next;
    mesc l("List of known crafting recipes:");
    mes "";
    showRecipe(0, Iten, WarpedLog, 9999);
    next;
    @scope$="";
    return;
}

OnInit:
    .sex = G_OTHER;
    .distance = 1;
    end;