diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-05-24 22:46:22 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-05-24 22:46:22 -0300 |
commit | f51cb024f2803b231f67eb0444becd4c16af01d1 (patch) | |
tree | 647378f113f4aa702efa3b1ba7ec2114fa33209d /npc | |
parent | 4e60c7df92fee12d784f18945bcf0745d6b8c7ee (diff) | |
download | serverdata-f51cb024f2803b231f67eb0444becd4c16af01d1.tar.gz serverdata-f51cb024f2803b231f67eb0444becd4c16af01d1.tar.bz2 serverdata-f51cb024f2803b231f67eb0444becd4c16af01d1.tar.xz serverdata-f51cb024f2803b231f67eb0444becd4c16af01d1.zip |
Prototype
Diffstat (limited to 'npc')
-rw-r--r-- | npc/craft/recipes.txt | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/npc/craft/recipes.txt b/npc/craft/recipes.txt new file mode 100644 index 000000000..b60b9830d --- /dev/null +++ b/npc/craft/recipes.txt @@ -0,0 +1,112 @@ +// 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 ""; + showRecipe(0, Iten, WarpedLog, 9999); + 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; |