summaryrefslogblamecommitdiff
path: root/npc/020-4/baktar.txt
blob: e812167e094db5e21f0b45d283dc3e7753b066b7 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                    
                                                           
























































































                                                                                                                                                                
                                    




























                                                       
// TMW2 Script.
// Author:
//    Jesusalva
// Description:
//    Baktar
// Quests:
//  NivalisQuest_Baktar
//    .@q1 = Controls Braknar Shield
//          (0= Not met, 1= Khafar, 2= Baktar, 3= Complete)
//    .@q2 = bitmask with Tulimshar items given

020-4,64,39,6	script	Baktar	NPC_RAIJIN,{
    .@q=getq(NivalisQuest_Baktar);
    .@q2=getq2(NivalisQuest_Baktar);
    if (!.@q)
        goto L_Start;
    goto L_Collector;

L_Start:
    mesn;
    mesq l("Hello, did you come from Tulimshar? Because you have a nice tan.");
    next;
    select
        l("Yes, I'm coming from Tulimshar."),
        l("Well, I just like sunbathing."),
        l("Good bye.");
    mes "";
    switch (@menu) {
        case 2:
            mesn;
            mesq l("Bah! Don't try to fool me! The sun can't burn in Nivalis.");
            // Don't stop now
        case 3:
            if (rand(1,5) == 4)
                mesc l("*cough cough*");
            close;
            break;
    }

    setq NivalisQuest_Baktar, 1, 0;
    mesn;
    mesq l("All my parents, grandparents, until the world was born, are from Tulimshar.");
    next;
    mesn;
    mesc l("*cough cough*");
    mesq l("Thus, I like to collect small memetos from Tulimshar.");
    next;
    mesn;
    mesq l("The doctor told me to move here after I got tuberculosis... But I like Tulimshar so much! Please bring me Tulimshar souvenirs, I'll pay you well!");
    close;


L_Collector:
    mesn;
    if (rand(1,5) == 4)
        mesc l("*cough cough*");
    mesq l("Did you brought me an souvenir from Tulimshar?");
    mes "";
    mes "##B" + l("Drag and drop an item from your inventory.") + "##b";

    .@id = requestitem();

    if (.@id < 1) close;
    if (countitem(.@id) < 1 || checkbound(.@id))
        close;

    // No item
    .@m = htget($@CONTRIBUTORS, str(.@id), 0);
    if (!.@m) {
        mesn;
        if (rand(1,5) == 4)
            mesc l("*cough cough*");
        mesq l("What crap is that?! This is not from Tulimshar!");
        next;
        mesn;
        if (rand(1,5) == 4)
            mesc l("*cough cough*");
        mesq l("I won't accept stuff from Halinarzo!");
        mesc l("Baktar can be picky with Tulimshar stuff, too.");
        close;
    }
    // Already given
    if (.@q2 & .@m) {
        mesn;
        if (rand(1,5) == 4)
            mesc l("*cough cough*");
        mesq l("I already have that...");
        close;
    }

    // Gives 2.5× more
    .@sp=getiteminfo(.@id, ITEMINFO_SELLPRICE);
    mesc l("Really give your @@ to Baktar?", getitemlink(.@id)), 1;
    mesc l("The item will be lost forever.");
    next;
    if (askyesno() == ASK_YES) {
        delitem .@id, 1;
        Zeny+=(.@sp*25/10);
        getexp BaseLevel*.@sp, .@sp;
        setq2 NivalisQuest_Baktar, .@q2|.@m;
        mesn;
        mesq l("Thanks.");
    }

    close;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, KnitHat);
    setunitdata(.@npcId, UDT_HEADMIDDLE, LeatherShirt);
    setunitdata(.@npcId, UDT_HEADBOTTOM, CottonShorts);
    setunitdata(.@npcId, UDT_WEAPON, LousyMoccasins);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 24);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 1);

    .sex = G_MALE;
    .distance = 5;
    npcsit;

    // Constants
    .TULIMITEM = htnew;
    htput(.TULIMITEM, str(DesertHat), 1);
    htput(.TULIMITEM, str(SerfHat), 2);
    htput(.TULIMITEM, str(BugLeg), 4);
    htput(.TULIMITEM, str(Dagger), 8);
    end;
}