summaryrefslogtreecommitdiff
path: root/npc/008-2-16/yannika.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/008-2-16/yannika.txt')
-rw-r--r--npc/008-2-16/yannika.txt469
1 files changed, 469 insertions, 0 deletions
diff --git a/npc/008-2-16/yannika.txt b/npc/008-2-16/yannika.txt
new file mode 100644
index 00000000..05c8a41e
--- /dev/null
+++ b/npc/008-2-16/yannika.txt
@@ -0,0 +1,469 @@
+// The Mana World scripts.
+// Author:
+// Micksha
+// Jesusalva
+// Description:
+// Yannika, Hinnaks Wife.
+// 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
+// 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,{
+ function yannika_intro;
+ function yannika_knives;
+ function yannika_recipe;
+ function sudo_make_sandwich;
+ function teach_cooking;
+
+ // If player haven't finished Hinnak quest yet, Yannika says so
+ .@q=getq(HurnscaldQuests_Hinnak);
+ if (.@q < 3)
+ {
+ speech
+ l("Hello."),
+ l("Isn't my husband Hinnak so hardworking?"),
+ l("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;
+ default:
+ speech
+ l("Hello."),
+ 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.");
+ mes "";
+
+ if (@menu == 1)
+ sudo_make_sandwich();
+ else if (@menu == 2)
+ teach_cooking();
+
+ next;
+ break;
+ }
+ closeclientdialog;
+ goodbye;
+ close;
+
+
+
+ ////////////////////////////////////////////////////
+ // Quest state 0
+ function yannika_intro
+ {
+ speech
+ l("Hello."),
+ 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."),
+ l("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
+ l("Hello."),
+ 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.")),
+ l("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;
+ getitembound RecipeBook, 1, IBT_ACCOUNT;
+ 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."),
+ l("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, Sandwich ID, Ammo 1, Item 1, Ammo 2, Item 2, Ammo 3, Item 3, {alt1, alt2} )
+ function yannika_recipe
+ {
+ .@craft=getarg(0);
+ .@sanid=getarg(1);
+ .@ammo1=getarg(2);
+ .@item1=getarg(3);
+ .@ammo2=getarg(4);
+ .@item2=getarg(5);
+ .@ammo3=getarg(6);
+ .@item3=getarg(7);
+ .@alt1=getarg(8);
+ .@alt2=getarg(9);
+ mesn;
+ mes l("For this recipe, you'll need to bring me:");
+ mesf("%d/%d %s", countitem(.@item1), .@ammo1, getitemlink(.@item1));
+ mesf("%d/%d %s", countitem(.@item2), .@ammo2, getitemlink(.@item2));
+ mesf("%d/%d %s", countitem(.@item3), .@ammo3, getitemlink(.@item3));
+ mesf("%s or %s", getitemlink(.@alt1), getitemlink(.@alt2));
+
+ select
+ rif(countitem(.@alt1), l("(%s) Yes, in fact, you can take them now.", getitemname(.@alt1))),
+ rif(countitem(.@alt2), l("(%s) Yes, in fact, you can take them now.", getitemname(.@alt2))),
+ l("Maybe later.");
+
+ if (@menu < 3)
+ {
+ if (countitem(.@item1) < .@ammo1 ||
+ countitem(.@item2) < .@ammo2 ||
+ countitem(.@item3) < .@ammo3)
+ {
+ speech
+ l("You don't have everything I have asked for.");
+ close;
+ }
+ delitem .@item1, .@ammo1;
+ delitem .@item2, .@ammo2;
+ delitem .@item3, .@ammo3;
+ if (@menu == 1)
+ delitem .@alt1, 1;
+ if (@menu == 2)
+ delitem .@alt2, 1;
+
+ // Learn recipe
+ RECIPES[.@craft]=true;
+ mesn;
+ mesq l("Look and learn.");
+ next;
+ mesn;
+ mesq l("This is how you do it! HAAH!");
+ next;
+ mesc l("You learned how to cook @@.", getitemlink(.@sanid));
+ next;
+ mesn;
+ mesq l("Please come back later and I may have something else to show you.");
+ }
+ return;
+ }
+
+ // Yannika can make sandwiches for players
+ // FIXME: Actually, Yannika will cook anything 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_COOKING);
+ 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;
+ }
+
+ // First part: Carp Sandwich
+ if (!RECIPES[CraftCarpSandwich]) {
+ mesn;
+ mesq l("Well, of course, I can show you how to cook sandwiches. But you'll need to bring ingredients for practice.");
+ next;
+ mesn;
+ mesq l("Should we start with something simple? Hmmm... Do you have a %s? It is hard to find one around these parts, but you don't seem to be from here.", getitemlink(FishingRod));
+ next;
+ // pre-req
+ if (!countitem(FishingRod)) {
+ mesn;
+ mesq l("Please try getting one. You'll need some carps for the recipe I'm going to teach you.");
+ if (countitem(CommonCarp) || countitem(GrassCarp))
+ mesq l("Cooking begins with collecting your own ingredients. That is what makes it so tasty. So, bring me a fishing rod!");
+ return;
+ }
+ // warn about main req
+ if (!countitem(CommonCarp) && !countitem(GrassCarp)) {
+ mesn;
+ mesq l("Ah, good, you've brought one!");
+ next;
+ mesn;
+ mesq l("Now you'll need to fish a carp. It can be a %s or a single %s, for the sandwhich.", getitemlink(CommonCarp), getitemlink(GrassCarp));
+ next;
+ }
+ mesn;
+ mesq l("I'll also be needing the usual sandwich stuff: Bread, Lettuce and Cheese.");
+ next;
+ yannika_recipe(CraftCarpSandwich, CarpSandwich, 1, Bread, 3, LettuceLeaf, 2, Cheese, CommonCarp, GrassCarp);
+ return;
+ }
+
+ // Main quest (TODO)
+ .@q=getq(.quest);
+ .@q2=getq2(.quest);
+ .@s=getq(General_SmearedHands);
+
+ // Snarfles/Crane dependency
+ if (!.@s) {
+ mesn;
+ mesq l("No, not at the moment.");
+ next;
+ return;
+ }
+
+ // Backup SmearedHands to cooking for ease of access
+ setq2 General_Cooking, getq2(General_SmearedHands);
+
+ // Switch General_Cooking quest
+ switch (.@q) {
+ case 2:
+ setq1 General_Cooking, 3;
+ // FALLTHROUGH
+ case 3:
+ case 4:
+ case 5:
+ case 9:
+ case 10:
+ case 12:
+ case 13:
+ case 14:
+ case 17:
+ mesn;
+ mesq l("Could you do a favor for me, first?");
+ next;
+ mesn;
+ mesq l("Could you bring a couple fresh fish to %s? Carps should do.", b(l("the Chef in Dimond's Cove")));
+ next;
+ mesn;
+ mesq l("He promised to make me some %s if I could provide him the fish.", getitemlink(SeafoodPlate));
+ next;
+ mesn;
+ mesq l("Sandwiches are handy, but they won't beat a full meal, which we hadn't in a while.");
+ next;
+ mesn;
+ mesq l("I'll be waiting your return!");
+ next;
+ break;
+ case 6:
+ select
+ l("What did you want, again?"),
+ l("I need some %s.", getitemname(.@q2 == VEGAN ? MananaSandwich : PioulegSandwich));
+ mes "";
+ if (@menu == 1) {
+ mesn;
+ mesq l("A %s pretty please.", getitemlink(SeafoodPlate));
+ break;
+ }
+ mesn;
+ mesq l("Ehh, I usually only make %s... You know cooking is not just throwing ingredients and vói-la, right?", getitemlink(CarpSandwich));
+ next;
+ mesn;
+ mesq l("But actually... Perhaps the chef in Candor?");
+ next;
+ mesn;
+ mesq l("I forgot their name, but they are not very normal. Err.");
+ next;
+ mesn;
+ mesq l("You probably can find them by the shorelines.");
+ setq1 General_Cooking, 7;
+ break;
+ case 7:
+ mesn;
+ mesq l("Candor's Chef is not very normal, so be careful when asking him about the sandwiches you want to make.");
+ break;
+ case 8:
+ mesn;
+ mesq l("How things went with Candor's Chef?");
+ next;
+ select
+ l("Great!"),
+ l("Not so great!");
+ mes "";
+ if (@menu == 1) {
+ mesn;
+ mesq l("That's good to hear!");
+ } else {
+ mesn;
+ mesq l("Oh no... Did he asked you to help you with something crazy? I feared he would do that...");
+ next;
+ mesn;
+ mesq l("But that's how I learned the carp sandwich recipe, you know?");
+ next;
+ mesn;
+ mesq l("Was trying to eat fried carp, but it always smeared my hands. Never thought he would come up with a sandwich recipe when I gave him that!");
+ next;
+ mesn;
+ mesq l("But he is still crazy, in my opinion...");
+ }
+ break;
+ case 11:
+ select
+ l("What did you want, again?"),
+ l("Do you know where Tulimshar bakery is?");
+ mes "";
+ if (@menu == 1) {
+ mesn;
+ mesq l("A %s pretty please.", getitemlink(SeafoodPlate));
+ break;
+ }
+ mesn;
+ mesq l("What, don't tell me you never have been at Tulimshar! Nearly everyone of your age already has been there at least once.");
+ next;
+ mesn;
+ mesq l("Tulimshar used to have a great Inn, but after the war, their business started to decline.");
+ next;
+ mesn;
+ mesq l("However, they had a bakery which has since flourished!");
+ next;
+ mesn;
+ mesq l("So if you fail finding the bakery, look for the Inn - it is on the same building.");
+ break;
+ case 15:
+ case 16:
+ select
+ l("What did you want, again?"),
+ l("Where can I find salad?");
+ mes "";
+ if (@menu == 1) {
+ mesn;
+ mesq l("A %s pretty please.", getitemlink(SeafoodPlate));
+ break;
+ }
+ mesn;
+ mesq l("This is a strange question. But I might be able to answer.");
+ next;
+ mesn;
+ mesq l("Hubby exports a lot of crops to Tulimshar. The purchaser is the Magic Academy of Tulimshar.");
+ next;
+ mesn;
+ mesq l("I'm not sure if this is of any help to you, though? I forgot who is the responsible for the Academy, so good luck!");
+ break;
+ case 18:
+ mesn;
+ mesq l("So? Did you got me a %s? I'm hungry...", getitemlink(SeafoodPlate));
+ next;
+ if (countitem(SeafoodPlate) < 1)
+ break;
+ if (askyesno() == ASK_NO)
+ break;
+ delitem SeafoodPlate, 1;
+ getitem EmptyPlate, 1;
+ quest_xp(.maxLevel, 10000);
+ quest_jxp(.maxLevel, 1000);
+ setq1 General_Cooking, 19;
+ mesn;
+ mesq l("Ah - Many thanks. Here, I'll return you a plate.");
+ next;
+ mesc l("Food Questline Complete!");
+ mesc l("Stay tuned for more updates!");
+ mes "";
+ mesc l("- The Mana World Development Team");
+ break;
+ default:
+ mesn;
+ mesq l("No, not at the moment.");
+ }
+
+ return;
+ }
+
+OnInit:
+ .maxLevel = 40;
+ .distance = 4;
+ .quest=General_Cooking;
+
+ end;
+}