summaryrefslogblamecommitdiff
path: root/npc/020-7-1/pyry.txt
blob: 6ff57039e448af2d7995e6cf496a63fa73deee95 (plain) (tree)































































































                                                                                                                                                                                                                                       
                                                       













                                                      
// TMW2 scripts.
// Authors:
//    Jesusalva
//    TMW Org.
// Description:
//    In charge to clear the mess
//    helperCleaning* + helperJanitor

// Quest: NivalisQuest_BlueSageSlimes
//  1: Acception state (0 - Not accepted, 1 - Accepted, 2 - Complete)
//  2: Killed Slimes Control
//  3: Killed Nests Control

020-7-1,50,63,6	script	Pyry	NPC_BLUESAGEWORKER_MB,{
    function askQuestion;
    .@qt=getq3(NivalisQuest_BlueSageSlimes);
    mesn;
    if (.@qt == BS_SNESTALL)
        mesq l("It seems all of the slimes are gone now. I'm so glad! Thanks for your help. I mentioned your assistance to Nikolai.");
    else if (.@qt > 0)
        mesq l("It's very brave of you to fight against those slimes deeper in the library. Remember that you have to kill the entire group to prevent them from breeding. And do it @@!", b(l("Alone")));
    else
        mesq l("Welcome to the library of Sage Nikolai. I'm very sorry, but as you see it's not in a good shape at the moment. Most of the books were eaten by the slimes or damaged and we're working hard on cleaning up the mess.");

    askQuestion();
    close;

function askQuestion {
    do {
        .@q=getq(NivalisQuest_BlueSage);
        .@q2=getq2(NivalisQuest_BlueSage);
        .@q3=getq3(NivalisQuest_BlueSage);
        .@qs=BSQuestion(getq(NivalisQuest_BlueSage));
        .@qo=getq(NivalisQuest_BlueSageSlimes);
        .@qt=getq3(NivalisQuest_BlueSageSlimes);
        next;
        mes "";
        select
            rif(.@qt < BS_SNESTALL, "What are you doing?"),
            rif(.@qs & BS_QVISITOR, l("Do you know anything about the strange visitor?")),
            rif(.@qs & BS_QHELPER, l("What's your opinion of Peetu and his work?")),
            any(l("I need to leave."), l("See you."), l("Bye."));
        mes "";
        switch (@menu) {
            case 1:
                mesn;
                mesq l("Resting. I've been slaying slime nests the whole day.");
                next;
                if (.@qo) {
                    mesn;
                    mesq l("There are some slimes around in the deeper parts of the library. Remember to kill them alone, and beware, if they kill themselves it won't count.");
                } else {
                    mesn;
                    mesq l("Do you want to help? I promise you no reward, so you will do it of your own will.");
                    next;
                    if (askyesno() == ASK_YES) {
                        mesn;
                        mesq l("Great! Now, listen carefully: This library is laid out in nine squares.");
                        next;
                        mesn;
                        mesq l("You have to kill, alone, and this means without the help of the slimes either, nine nests. One in each quadrant.");
                        next;
                        mesn;
                        mesq l("Be careful when walking, because you may change quadrands and then... It won't count. You'll need to start over again.");
                        next;
                        mesn;
                        mesq l("I wish you good luck!");
                        setq NivalisQuest_BlueSageSlimes, 1, 0, 0;
                    } else {
                        mesn;
                        mesq l("Alright. Then please don't go too deep on the library, it is dangerous.");
                    }
                }
                break;
            case 2:
                mesn;
                mesq l("Mh, yes. I remember him. He was very interested in the library and the research we do here. He had an unusual behaviour and appearance. But, well, that isn't a reason to refuse someone, right?");
                break;
            case 3:
                mesn;
                mesq l("Peetu? I have always been glad to have him on the team. He's really brought forward our work here.");
                next;
                mesn;
                mesq l("I was very surprised when I heard that he's responsible for the failed sealing. I'd never have expected that from him.");
                if (!(.@q3 & .bsId))
                    setq3 NivalisQuest_BlueSage, .@q3 | .bsId;
                break;
        }
    } while (@menu != 4);
    close;
}

OnSlimeDeath:
    if (playerattached()) {
        getmapxy(.@m$, .@x, .@y, 0);
        // Capped at ~10% drop chance of book pages
        if (rand(0,10000) <= 460+(readparam2(bLuck)*6))
            makeitem SpellBookPage, 1, .@m$, .@x, .@y;
        if (rand(0,10000) <= 100)
            makeitem Candy, 1, .@m$, .@x, .@y;
    }
    end;

OnInit:
    .bsId=BS_NPC06;
    .sex=G_MALE;
    .distance=5;
    npcsit;
    end;
}