From cf525a4a26597c3bc3d69e2a7456205b598fdf0c Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 5 Mar 2019 22:47:40 +0000 Subject: Update the quest to address Micksha notes. Playtested locally. Besides, it is now possible to use Grass Carp for Carp Sandwich. The use of a Grass Carp won't have any special effects. WIP status can now be safely removed. --- npc/001-3-0/_mobs.txt | 4 +- npc/008-2-16/_import.txt | 2 + npc/008-2-16/stove.txt | 88 +++++++ npc/008-2-16/yannika.txt | 300 +++++++++++++++++++++- npc/commands/debug-quest.txt | 3 +- npc/functions/quest-debug/041-General_Cooking.txt | 51 ++++ npc/items/recipes.txt | 60 +++++ npc/scripts.conf | 2 + 8 files changed, 502 insertions(+), 8 deletions(-) create mode 100644 npc/008-2-16/stove.txt create mode 100644 npc/functions/quest-debug/041-General_Cooking.txt create mode 100644 npc/items/recipes.txt (limited to 'npc') diff --git a/npc/001-3-0/_mobs.txt b/npc/001-3-0/_mobs.txt index 88caa962..fff529b1 100644 --- a/npc/001-3-0/_mobs.txt +++ b/npc/001-3-0/_mobs.txt @@ -6,7 +6,7 @@ 001-3-0,101,111,8,3 monster Ratto 1005,4,30000,15000 001-3-0,145,68,2,2 monster Ratto 1005,2,60000,30000 001-3-0,146,28,2,1 monster Ratto 1005,2,60000,30000 -001-3-0,90,65,3,3 monster Ratto 1005,3,35000,15000 +001-3-0,89,66,2,4 monster Ratto 1005,3,35000,15000 001-3-0,56,50,8,4 monster Ratto 1005,4,35000,15000 001-3-0,42,102,3,3 monster Ratto 1005,3,40000,20000 001-3-0,157,80,2,2 monster Green Slime 1024,3,15000,80000 @@ -15,7 +15,7 @@ 001-3-0,175,50,0,4 monster Ratto 1005,2,60000,30000 001-3-0,175,64,3,2 monster Cave Maggot 1027,4,5000,15000 001-3-0,104,75,48,43 monster Cave Maggot 1027,25,500,2000 -001-3-0,90,67,2,5 monster Cave Maggot 1027,3,500,2000 +001-3-0,90,68,1,6 monster Cave Maggot 1027,3,500,2000 001-3-0,128,86,3,5 monster Green Slime 1024,3,500,2000 001-3-0,42,103,3,5 monster Green Slime 1024,3,500,2000 001-3-0,120,85,7,2 monster Little Green Slime 1025,2,500,2000 diff --git a/npc/008-2-16/_import.txt b/npc/008-2-16/_import.txt index 90da3caf..5f5ea192 100644 --- a/npc/008-2-16/_import.txt +++ b/npc/008-2-16/_import.txt @@ -1,3 +1,5 @@ // Map 008-2-16: Hurnscald Cottage // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/008-2-16/_warps.txt", +"npc/008-2-16/stove.txt", +"npc/008-2-16/yannika.txt", diff --git a/npc/008-2-16/stove.txt b/npc/008-2-16/stove.txt new file mode 100644 index 00000000..91036c44 --- /dev/null +++ b/npc/008-2-16/stove.txt @@ -0,0 +1,88 @@ +// Evol scripts. +// Author: +// Jesusalva +// Description: +// Stove to make sandwiches + +008-2-16,32,29,0 script Stove NPC_NO_SPRITE,{ + // If player haven't finished Hinnak quest yet, they can't use the stove + .@q=getq(HurnscaldQuests_Hinnak); + if (.@q < 3) + { + setcamnpc "Yannika"; + mesn l("Yannika"); + mesq l("Please don't touch my stove without my authorization."); + close; + } + + // Cooking loop + do + { + mesc lg("It is time to make some sandwiches myself!"); + mes "##B" + l("Drag and drop the items from your inventory in the frames.") + "##b"; + + // Crafting skin with 4 columns + setskin "craft4"; + .@var$ = requestcraft(4); // Limit: 4 items + .@craft = initcraft(.@var$); + .@entry = findcraftentry(.@craft, CRAFT_SANDWICH); + setskin ""; + + // Does the recipe exist and is a sandwich? + if (.@entry < 0) + { + narrator + l("You don't know how to make a sandwich with that."), + l("Do you want to try again?"); + if (askyesno() == ASK_YES) + .@tryAgain=true; + else + .@tryAgain=false; + } + else + { + // Did player cheat? If not, proceed with the craft + if (!validatecraft(.@craft)) + { + narrator + l("Where are the ingredients?"); + .@tryAgain=true; + } + else + { + // Even if the recipe is right, if you don't have it on your + // recipe book, it should be deemed invalid. + if (COOKING_RECIPES[.@entry]) + { + usecraft .@craft; + narrator + l("Done!"), + l("Do you want to try again?"); + } + else + { + narrator + l("You don't know how to make a sandwich with that."), + l("Do you want to try again?"); + } + + if (askyesno() == ASK_YES) + .@tryAgain=true; + else + .@tryAgain=false; + } + } + + // Clear unused variables and clear the screen. + deletecraft .@craft; + clear; + } while (.@tryAgain); + + closeclientdialog; + close; + +OnInit: + .sex = G_OTHER; + .distance = 2; + end; +} diff --git a/npc/008-2-16/yannika.txt b/npc/008-2-16/yannika.txt index 0e311eee..7223b70c 100644 --- a/npc/008-2-16/yannika.txt +++ b/npc/008-2-16/yannika.txt @@ -1,20 +1,310 @@ // Evol scripts. // Author: // Micksha +// Jesusalva // Description: // Yannika, Hinnaks Wife. -// THIS IS A PLACEHOLDER! +// Makes delicious sandwiches for the player +// Variables: +// General_Cooking +// 0: Doesn't knows the quest +// 1: Received the quest for the Cookbook +// 2: Completed the quest for the Cookbook +// COOKING_RECIPES +// Controls which recipes you know and doesn't. +// It is an array with Craft Constants. 008-2-16,28,29,0 script Yannika NPC_YANNIKA,{ - speech - l("Hi Sir."), - l("Sandwiches? Lets wait for Jesusalva to add something here."), - lg("Come back later."); + // Quest state 0 + function yannika_intro + { + speech + lg(l("Hello madam."), l("Hi Sir.")), + l("Thanks for helping my husband Hinnak."), + l("Could you please bring me 2 new knives?"), + l("Hinnak wasted all my good kitchen knives trying to get rid of his accursed Pinkies."); + + select + l("Yes, sure thing."), + lg("Not my problem."); + + if (@menu == 1) + { + speech + l("I'll be waiting for you, then!"); + setq .quest, 1; + next; + } + } + + // Quest state 1 + function yannika_knives + { + speech + lg(l("Hello madam."), l("Hi Sir.")), + l("Thanks for helping my husband Hinnak."), + l("Did you brought me 2 new knives?"); + + select + rif(countitem(Knife) >= 2, l("Yes, here they are.")), + lg("Not yet, I'll be back."); + + if (@menu == 1) + { + // No need to countitem() because it is already at the menu + // Technically, a hacked client could bypass earlier check though + // Jesusalva doesn't likes hacks, so he puts delitem first. + // delitem halts the script if it cannot delete all items. + inventoryplace RecipeBook, 1; + delitem Knife, 2; + getitem RecipeBook, 1; + setq .quest, 2; + + speech + l("Many thanks. I can now do sandwiches again!"), + l("Well, of course. First of all, you need a @@. You can have mine, if you want.", getitemlink(RecipeBook)), + l("The recipes, of course, you must collect yourself. Even sandwiches are not so simple as to simply put ingredients and hope for the best."), + l("Cooking is an art. You need to know how to cook something. You can use my stove to prepare."), + lg("Or, you can just forget all that, and let me prepare sandwiches for you, too! %%H"), // %%H - Smile Emote + l("Oh, but I'll still need the book. Even if all pages are white."); + next; + } + } + + // Learn a new Sandwich Recipe + // yannika_recipe ( Craft ID, Ammo 1, Item 1, Ammo 2, Item 2, Sandwich ID ) + function yannika_recipe + { + .@craft=getarg(0); + .@ammo1=getarg(1); + .@item1=getarg(2); + .@ammo2=getarg(3); + .@item2=getarg(4); + .@sanid=getarg(5); + speech + l("I do know a recipe with this!"), + l("You'll need to bring me @@ @@ and @@ @@ for the recipe.", .@ammo1, getitemlink(.@item1), .@ammo2, getitemlink(.@item2)); + + select + l("Yes, in fact, you can take them now."), + l("Maybe later."); + + if (@menu == 1) + { + if (countitem(.@item1) < .@ammo1 || + countitem(.@item2) < .@ammo2) + { + speech + l("You don't have everything I have asked for."); + close; + } + delitem .@item1, .@ammo1; + delitem .@item2, .@ammo2; + COOKING_RECIPES[.@craft]=true; + speech + l("This is how you do it! HAAH!"); + next; + mesc l("You learned how to cook @@.", getitemlink(.@sanid)); + next; + } + return; + } + + // Yannika can make sandwiches for players + function sudo_make_sandwich + { + speech + l("When cooking, the order of ingredients matter."), + l("Even a simple sandwich will be ruined if you place lettuce above the cheese!"), + l("Anyway, to make a sandwich, you'll need to place, in this order:"), + l("1x @@, 3x @@, 2x @@, and the ingredient of your choice.", getitemlink(Bread), getitemlink(LettuceLeaf), getitemlink(Cheese)); + + do + { + mes "##B" + l("Drag and drop the items from your inventory in the frames.") + "##b"; + + // Crafting skin with 4 columns + setskin "craft4"; + .@var$ = requestcraft(4); // Limit: 4 items + .@craft = initcraft(.@var$); + .@entry = findcraftentry(.@craft, CRAFT_SANDWICH); + setskin ""; + + // Does the recipe exist and is a sandwich? + if (.@entry < 0) + { + speech + l("Sorry. I can't make a sandwich with that."), + l("Do you want to try again?"); + if (askyesno() == ASK_YES) + .@tryAgain=true; + else + .@tryAgain=false; + } + else + { + // Did player cheat? If not, proceed with the craft + if (!validatecraft(.@craft)) + { + speech + l("Sorry, my eyesight is a bit poor nowadays. Where are the ingredients?"); + .@tryAgain=true; + } + else + { + usecraft .@craft; + speech + l("@@ skillfully cuts the bread in half, throws the ingredients in air, and they land in the sandwich!", .name$), + l("There you go. Please enjoy yourself! ^.^"); + + .@tryAgain=false; + } + } + + // Clear unused variables and clear the screen. Then print recipe again. + deletecraft .@craft; + if (.@tryAgain) { + clear; + mesc l("1x @@, 3x @@, 2x @@, and the ingredient of your choice.", getitemlink(Bread), getitemlink(LettuceLeaf), getitemlink(Cheese)); + } + } while (.@tryAgain); + return; + } + + // Teach player how to cook, providing a recipe book if they don't have one + function teach_cooking + { + // Check if your stats aren't enough (bonuses aren't counted) + if (readparam(bInt) < 10 || + readparam(bDex) < 20) + { + speech + l("Well, cooking is an art, and thus, you need intelligence and dexterity to learn."), + l("Please come again with at least 10 INT and 20 DEX. Stat Bonuses aren't counted."); + close; + } + + speech + l("Well, of course, I can show you how to cook sandwiches. But you'll need to bring ingredients for practice."), + l("Why don't you show me a main ingredient, and I'll tell you what can be done?"); + + do + { + mes "##B" + l("Drag and drop an item from your inventory.") + "##b"; + .@id = requestitem(); + + // If ID is invalid + if (.@id < 1) { + speech + l("Out of creativity already? Don't worry, I don't judge! Hehe."); + close; + } + // If you are cheating ManaPlus interface + if (countitem(.@id) < 1) { + mesc l("You do not have the item!"); + close; + } + + // Now we will switch your result and check recipe on the meanwhile + switch (.@id) + { + case CommonCarp: + case GrassCarp: + if (COOKING_RECIPES[CraftCarpSandwich]) + { + speech + lg("Haha, silly you! You already know the recipe! Read the @@ if you forgot!", getitemlink(RecipeBook)); + } + else + { + yannika_recipe(CraftCarpSandwich, 2, GrassCarp, 10, CommonCarp, CarpSandwich); + } + break; + + case Manana: + if (COOKING_RECIPES[CraftMananaSandwich]) + { + speech + lg("Haha, silly you! You already know the recipe! Read the @@ if you forgot!", getitemlink(RecipeBook)); + } + else + { + yannika_recipe(CraftMananaSandwich, 3, Carrot, 30, Manana, MananaSandwich); + } + break; + + case PiouLegs: + if (COOKING_RECIPES[CraftPioulegSandwich]) + { + speech + lg("Haha, silly you! You already know the recipe! Read the @@ if you forgot!", getitemlink(RecipeBook)); + } + else + { + yannika_recipe(CraftPioulegSandwich, 10, Croconut, 20, PiouLegs, PioulegSandwich); + } + break; + + default: + speech + l("Sorry, I don't know any recipe with this."), + l("Maybe you have more luck with something else?"); + next; + break; + } + } while (true); + + return; + } + + // If player haven't finished Hinnak quest yet, Yannika says so + .@q=getq(HurnscaldQuests_Hinnak); + if (.@q < 3) + { + speech + lg(l("Hello madam."), l("Hi Sir.")), + l("Isn't my husband Hinnak so hardworking?"), + lg("Come back later."); + close; + } + + // Player completed Hinnak quest, we can continue in making Sandwiches + switch (getq(.quest)) + { + case 0: + yannika_intro(); + break; + case 1: + yannika_knives(); + break; + case 2: + speech + lg(l("Hello madam."), l("Hi Sir.")), + l("Thanks for helping my husband Hinnak."), + l("He likes to eat sandwiches. A good thing they are so easy to make!"); + + select + l("Easy to make? Could you make one for me?"), + l("Easy to make? Could you teach me how to make them?"), + l("Good to know, thanks."); + + if (@menu == 1) + sudo_make_sandwich(); + else if (@menu == 2) + teach_cooking(); + + next; + break; + } + closeclientdialog; + goodbye; close; OnInit: .sex = G_FEMALE; .distance = 2; + .quest=General_Cooking; + end; } diff --git a/npc/commands/debug-quest.txt b/npc/commands/debug-quest.txt index 468e5af2..1c3e0b5c 100644 --- a/npc/commands/debug-quest.txt +++ b/npc/commands/debug-quest.txt @@ -129,7 +129,8 @@ function script GlobalQuestDebug { l("Cookies"), General_Cookies, "Rumly", General_Rumly, l("Narrator"), General_Narrator, - "Janus", General_Janus; + "Janus", General_Janus, + l("Cooking"), General_Cooking; switch (@menuret) { diff --git a/npc/functions/quest-debug/041-General_Cooking.txt b/npc/functions/quest-debug/041-General_Cooking.txt new file mode 100644 index 00000000..592df547 --- /dev/null +++ b/npc/functions/quest-debug/041-General_Cooking.txt @@ -0,0 +1,51 @@ +// Cooking quest debug +// Author: +// Jesusalva + +function script QuestDebug41 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "General_Cooking"; + mes "---"; + mes l("Quest state: @@", getq(General_Cooking)); + mes l("Known Recipes: @@", array_entries(COOKING_RECIPES)); + next; + + select + l("Return"), + l("Reset Quest"), + l("Complete Quest"), + l("Get a Recipe Book"), + l("Learn all recipes"), + l("Reset all recipes"); + + switch (@menu) + { + case 2: + setq General_Cooking, 0; + break; + case 3: + setq General_Cooking, 2; + break; + case 4: + getitem RecipeBook, 1; + break; + case 5: + COOKING_RECIPES[CraftCarpSandwich]=true; + COOKING_RECIPES[CraftMananaSandwich]=true; + COOKING_RECIPES[CraftPioulegSandwich]=true; + break; + case 6: + COOKING_RECIPES[CraftCarpSandwich]=false; + COOKING_RECIPES[CraftMananaSandwich]=false; + COOKING_RECIPES[CraftPioulegSandwich]=false; + break; + + } + + return; + + } while (@menu != 1); +} diff --git a/npc/items/recipes.txt b/npc/items/recipes.txt new file mode 100644 index 00000000..3fb3309c --- /dev/null +++ b/npc/items/recipes.txt @@ -0,0 +1,60 @@ +// Evol script. +// Author: +// Jesusalva +// Micksha +// Description: +// Contains recipe books for Evol Online + +- script #RecipeBook NPC_HIDDEN,{ + + function read_book { + + setnpcdialogtitle l(.book_name$); + + mesc l("Eating is a necessity, but cooking is an art."); + mesc l("(All items must be placed exactly in this order for cooking work.)"); + next; + mesc l("List of known cooking recipes:"); + mes ""; + mes ".:: " + l("Sandwiches") + " ::."; + mes ""; + if (COOKING_RECIPES[CraftCarpSandwich]) { + mes l("@@", getitemlink(CarpSandwich)); + mesc l("* @@ @@", 1, getitemlink(Bread)); + mesc l("* @@ @@", 3, getitemlink(LettuceLeaf)); + mesc l("* @@ @@", 2, getitemlink(Cheese)); + mesc l("* @@ @@", 1, getitemlink(CommonCarp)); + mes ""; + } + if (COOKING_RECIPES[CraftPioulegSandwich]) { + mes l("@@", getitemlink(PioulegSandwich)); + mesc l("* @@ @@", 1, getitemlink(Bread)); + mesc l("* @@ @@", 3, getitemlink(LettuceLeaf)); + mesc l("* @@ @@", 2, getitemlink(Cheese)); + mesc l("* @@ @@", 1, getitemlink(PiouLegs)); + mes ""; + } + if (COOKING_RECIPES[CraftMananaSandwich]) { + mes l("@@", getitemlink(MananaSandwich)); + mesc l("* @@ @@", 1, getitemlink(Bread)); + mesc l("* @@ @@", 3, getitemlink(LettuceLeaf)); + mesc l("* @@ @@", 2, getitemlink(Cheese)); + mesc l("* @@ @@", 1, getitemlink(Manana)); + mes ""; + } + + close; + } + +OnUse: + if (openbook()) + read_book; + closeclientdialog(); + close; + +OnInit: + .book_name$ = getitemname(RecipeBook); + .sex = G_OTHER; + .distance = 1; + end; +} diff --git a/npc/scripts.conf b/npc/scripts.conf index fd8f6ea9..ba1a5196 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -93,11 +93,13 @@ "npc/functions/quest-debug/038-HurnscaldQuests_Inspector.txt", "npc/functions/quest-debug/039-HurnscaldQuests_ForestBow.txt", "npc/functions/quest-debug/040-HurnscaldQuests_WoodenShield.txt", +"npc/functions/quest-debug/041-General_Cooking.txt", // Item functions "npc/items/croconut.txt", "npc/items/shovel.txt", "npc/items/rand_sc_heal.txt", +"npc/items/recipes.txt", // custom atcommands "npc/commands/music.txt", -- cgit v1.2.3-70-g09d2