summaryrefslogblamecommitdiff
path: root/npc/001-1/qpid.txt
blob: afa5967e84dc5b01e414440886ce20e551e94865 (plain) (tree)
1
2
3
4
5
6
7
8







                                                            






































                                                                                         




                     
                            














                                                                               



                                                  




                                                                                             








                                             


                                                  





                                                                                                  
                 





                                         



                      







                                                                         
 














                                                                                  

                                             






                              


               











                                                                                                                                      














                                                           
             
                   


      

                                          
               
                                                                 
                                      


                                                             
                                     



                         
                            





                                         
                              

                      


                                      
                         


                                                                                                                                                              
                      
                   

                      
                            










                    
// Evol scripts.
// Authors:
//    Reid
// Description:
//    Potion seller, she is part of the Enora's noob quests.

001-1,65,116,0	script	Q'Pid#001-1	NPC_QPID,{

    function verify_riddle_answer {
        .@answer$ = getarg (0);
        .@good$ = getarg (1);
        .@good_translated$ = l(getarg(1));

        .@size_answer = getstrlen (.@answer$);
        .@size_good = getstrlen (.@good$);
        .@size_good_translated = getstrlen (.@good_translated$);

        if (.@size_answer > .@size_good)
        {
            .@max = (.@size_answer > .@size_good_translated)
                ? .@size_answer
                : .@size_good_translated;
        }
        else
        {
            .@max = (.@size_good > .@size_good_translated)
                ? .@size_good
                : .@size_good_translated;
        }

        for (.@j = 0; .@j < .@max; .@j++)
        {
            if (strtolower (charat (.@answer$, .@j)) == charat (.@good$, .@j))
            {
                .@k++;
            }
            if (strtolower (charat (.@answer$, .@j)) == charat (.@good_translated$, .@j))
            {
                .@k_translated++;
            }
        }
        .@k *= 10;
        .@k_translated *= 10;
        .@size_good *= 7;
        .@size_good_translated *= 7;
        if (.@k >= .@size_good  || .@k_translated >= .@size_good_translated)
        {
            return 1;
        }
        return 0;
    }

    function riddle_enigma {
        speech 5,
            l("Ok fine, you have up to 3 tries, here is the riddle:"),
            l("What is growing and shrinking in same time?");
        narrator 4,
            l("You need to type the answer of this riddle in the NPC window."),
            l("The answer is a single word, without conjugaison."),
            l("You can also answer in your native language or in English.");

        do
        {
            input .@answer$;
            .@i++;

            if (verify_riddle_answer (.@answer$, "life"))
            {
                if (getq (ArtisQuests_Enora) == 7)
                {
                    setq (ArtisQuests_Enora, 9);
                }
                speech 5,
                    l("Oh..."),
                    l("You seem more cultivated than what you look like."),
                    l("Fine, take these potion, I will replenish in the next hours anyway.");

                break;
            }
            else if (.@i < 3)
            {
                speech 5,
                    l("Too bad, try again.");
            }
            else
            {
                if (getq (ArtisQuests_Enora) == 7)
                {
                    setq (ArtisQuests_Enora, 8);
                    speech 5,
                        l("You failed!"),
                        l("Ivan is the one that you should look at now."),
                        l("He is on a small house in between the dock's warehouse and the dojo."),
                        l("Follow the river to the east-north and you will find it."),
                        l("And get out of here, I'm not a map!");
                }
                else
                {
                    speech 5,
                        l("You failed!");
                }

                break;
            }
        } while (1);

        return;
    }

    function enora_quest {
        speech 5,
            l("She wants? What if I don't want?"),
            l("I'm not a pawn of the Legion, I don't have to obey you!"),
            l("Oh and guess what, I'm soon out of potions anyway.");

        switch (select (l("And where can I find these potions?"),
                        l("You bored me, see you later.")))
        {
            case 1:
                break;
            case 2:
                return;
        }

        speech 5,
            l("You don't seem to be from the Legion, let's do a game."),
            l("If you find the correct answer, I will give you these potions..."),
            l("But if you fail, you will have to get them from the alchemist."),
            l("Deal?");

        switch (select (menuaction(l("Yes")),
                        menuaction(l("No"))))
        {
            case 1:
                riddle_enigma;
                break;
            case 2:
                break;
        }
        return;
    }

    function alchemist_information {
        speech 5,
            l("Do? I don't do them."),
            l("I'm sure that you already knew the answer, didn't you?"),
            l("You tried to embarrass me, am I right?!"),
            l("It's Ivan... I'm sure that he sent you to annoy me..."),
            l("I'm just a merchant, I trade and make deals, yes \"excuse\" me if I'm not as skilled as this stupid alchemist."),
            l("But rare are those that receive grants from the Legion itself. For anybody else only a hard work can pay your bills!");
        emotion 11;

        switch (select (l("Sorry I didn't mean to bother you."),
                        l("You are just sitting on the shadow of your store.")))
        {
            case 1:
                mes "";
                mesn;
                break;
            case 2:
                speech 5, l("You are honnest, I like it.");
                break;
        }
        mesq l("Is that all you had to say?");
        next;

        return;
    }

    speech 4,
        l("What?");

    do
    {
        .@enora = getq(ArtisQuests_Enora);

        menuint
            rif (.@enora == 7, l("Enora wants her potions.")), 0,
            menuaction(l("Trade")), 1,
            rif (.@enora > 7, l("What was your riddle?")), 2,
            l("How do you do your potions?"), 3,
            l("What are you reading?"), 4,
            menuaction(l("Quit")), 5;

        switch (@menuret)
        {
            case 0:
                enora_quest;
                break;
            case 1:
                closedialog;
                shop "Store#Potion001-1";
                close;
            case 2:
                riddle_enigma;
                break;
            case 3:
                alchemist_information;
                break;
            case 4:
                speech 5,
                    l("It's a poem, about poems... Why are you asking that?"),
                    l("Because I am an orc I can't read such things? That's rubbish."),
                    l("I borrowed it from the library, you should try to cultivate yourself more instead of insunuate such things to people you don't know!");
                break;
            case 5:
                break;
        }
    } while (@menuret != 5);

    closedialog;
    goodbye;
    close;

OnInit:
    .sex = G_FEMALE;
    .distance = 3;
    end;
}