summaryrefslogtreecommitdiff
path: root/npc/020-4/baktar.txt
blob: 342c720107dac547fe66010ec413136f4d02cb40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// TMW2 Script.
// Author:
//    Jesusalva
// Description:
//    Baktar
// Quests:
//  NivalisQuest_Baktar
//    .@q1 = Controls Braknar Shield
//    .@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;
}