summaryrefslogblamecommitdiff
path: root/npc/002-1/chefgado.txt
blob: f0276111c663259c05df43ef6acb64c1b0b9b2aa (plain) (tree)
1
2
3
4
5
6
7
8
9
10



                                            
               

                      
                                            

                         
                      

                                                       
                                 
                                    
 
                                                 

                           



                                              
 
                         

          

         

                                                                                                                                                          
                        
                                                                                                                                        
                                                                                                                                                                                                           

          























                                                                                                         
                                                                                             









                                  
                                                                                                                                           

           
                                                                         





                                    
                         
                             
                                
                      
                 








                                                                                                            






                                                                                                          


                














































                                                                                                                                                                                             

                  
                  

        
// TMW-2 scripts.
// Original Authors: Hal9000 & Qwerty Dragon
// TMW-2 Authors:
//    Ayruss
//    Jesusalva
// Description:
//    La Johanne Chef.
//    The cook may need help with something.
// Variable:
//    ShipQuests_ChefGado
//    ShipQuests_Knife

002-1,27,28,0	script	Chef Gado	NPC_CHEF_GADO,{
    .@q = getq(ShipQuests_Knife);
    .@p = getq(ShipQuests_ChefGado);

    // Player should have the rusty knife already
    if (!.@q) goto L_Knife;

    // Piou quest
    if (.@q == 1 && .@p == 0) goto L_PiouLegs;
    if (.@p == 1) goto L_Continue;
    if (.@p == 2) goto L_Complete;

    // An error happened!
    close;

L_Knife:
    mesn;
    mesq l("I hate the sea, the salty air always lets my knives rust. I already have a stockpile of rusty knives, don't even know what to do with them.");
    if (TUTORIAL) mesc l("That indeed is true, you can see a pile of rusty knives on the nearby table.");
    if (TUTORIAL) dnext;
    tutmes l("Unlike talking, when trying to pick objects or read signs, you should be at an arms distance of them."), l("NOTE"), false;
    tutmes l("This is often 1, 2 or 3 tiles. For talking, usually 4 or 5 tiles. Shouting can be done from 12 up to 18 tiles; But as shouting is rude, most NPCs won't react to it."), l("TUTORIAL"), false;
    close;

L_PiouLegs:
    mesn;
    mesq l("I'm trying to make good food for all the sailors here, could you help me?");
    mes "";
    menu
        l("Yes."), L_Start,
        l("Is there a reward?"), L_Ask,
        l("No."), -;
    close;


L_Ask:
    mes "";
    mesn;
    mesq l("I have a spare pair of gloves laying somewhere, you can have those if you finish the task.");
    mes "";
    menu
        l("Sounds good."), L_Start,
        l("No thanks."), -;
    close;

L_Start:
    mes "";
    mesn;
    mesq l("Great, I need 11 @@. Only good food makes a good crew.",getitemlink("PiouLegs"));
    setq ShipQuests_ChefGado, 1;
    mes "";
    menu
        l("I'll get to work."), -;
    close;


L_Continue:
    setq ShipQuests_ChefGado, 1;
    mesn;
    mesq l("Do you have the @@/11 @@ I requested? The sailors are starving because of you!",countitem("PiouLegs"),getitemlink("PiouLegs"));
    mes "";
    menu
        rif(countitem("PiouLegs") >= 11, l("Yes, take them.")), L_Reward,
        l("Not yet."), -;
    close;


L_Reward:
    inventoryplace CreasedGloves, 1;
    delitem PiouLegs, 11;
    getitem CreasedGloves, 1;
    setq ShipQuests_ChefGado, 2;
    Zeny = Zeny + 100;
    getexp 25, 5;
    mes "";
    mesn;
    mesq l("Thanks. Take this spare pair of gloves and some change.");
    next;
    mesq l("I'm sure the crew will like to be spared from having to eat @@ again!", getitemlink(Piberries));
    close;
    end;

L_Complete:
    .@total = getq2(ShipQuests_ChefGado);
    if (getskilllv(TMW2_COOKING) > .@total) goto L_Cooking;
    switch (rand2(3)) {
    case 0: npctalk3 l("What are you doing in my kitchen?! Get out, it's not a place for kids!"); break;
    case 1: npctalk3 l("Where is the salt?! This is sugar! Proper sailors need salt, not sugar!"); break;
    case 2: npctalk3 l("Are you going to stand here all day long? Go wash the dishes or go away."); break;
    }
    closedialog;
    close;

L_Cooking:
    .@total = getq2(ShipQuests_ChefGado);
    mesn;
    mesq l("Wait. Stop there. You have the same smell as Ashley. Did you just receive some cooking lesson from her?");
    next;
    mesn;
    mesq l("I wish to gouge on you but I own her a great deal, so I'll teach you a recipe for free. I work mostly with sea food... This includes %s by the way.", getitemlink(PoisonedDish));
    next;

    // Prepare a list of recipes you still haven't learned
    if (!RECIPES_COOKING[CraftCarpSandwich])
        array_push(.@recipes, CraftCarpSandwich);
    if (!RECIPES_COOKING[CraftShellSandwich])
        array_push(.@recipes, CraftShellSandwich);
    if (!RECIPES_COOKING[CraftSushi])
        array_push(.@recipes, CraftSushi);
    if (!RECIPES_COOKING[CraftPoisonedDish])
        array_push(.@recipes, CraftPoisonedDish);

    // Check if there *are* recipes to be learned
    if (!getarraysize(.@recipes)) {
        mesn;
        mesq l("But you'll have to wait I figure out a new recipe. This may take years so shoo, shoo! Get out of my sight!");
        close;
    }

    // Decide on a random recipe that you'll now learn
    array_shuffle(.@recipes);
    .@new = array_pop(.@recipes);
    // FIXME: Actually broken but who cares
    .@const$ = data_to_string(.@new);
    .@item = string_to_data(substr(.@const$, 5, getstrlen(.@const$) - 1));

    // Actually teach you the recipe
    setq2 ShipQuests_ChefGado, .@total + 1;
    RECIPES_COOKING[.@new] = true;

    // Some text so you know what you learned
    mesn;
    mesq l("So, today I'll teach you the %s recipe.", getitemlink(.@item));
    next;
    mesc l("Some time later...");
    mes "";
    mesn;
    mesq l("Good. I also noted it down in your Recipe Book. The path of culinary is an arduous one but the fruits it yields are sweet!");
    close;

OnInit:
    .sex = G_MALE;
    .distance = 4;
    end;
}