summaryrefslogtreecommitdiff
path: root/npc/020-4/baktar.txt
blob: e18d47f5e3cf2a99b69d13bd11b1f0f96fe721ba (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// 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;
    if (.@q == 2)
        goto L_Braknar;
    goto L_Collector;

L_Start:
    mesn;
    if (rand(1,5) == 4) mesc l("*cough cough*");
    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;
            if (rand(1,5) == 4) mesc l("*cough cough*");
            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;
    if (rand(1,5) == 4) mesc l("*cough cough*");
    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;
        if (rand(1,5) == 4) mesc l("*cough cough*");
        mesq l("Thanks.");
    }

    close;

L_Braknar:
    mesn;
    if (rand(1,5) == 4)
        mesc l("*cough cough*");
    mesq l("Welcome back.");
    select
        l("I brought a souvenir for you."),
        l("Do you know someone called Braknar?"),
        l("Er, uhm, hi!");
    mes "";
    switch (@menu) {
        case 1: goto L_Collector;
        case 2: 
            mesn;
            if (rand(1,5) == 4) mesc l("*cough cough*");
            mesq l("Yeah, it was my grand-grand-grandfather.");
            next;
            mesn strcharinfo(0);
            mes l("'-' \"Could you give me his shield? Pretty please? I need it to survive and bring Tulimshar goodies!\"");
            next;
            mesn;
            if (rand(1,5) == 4) mesc l("*cough cough*");
            mesq l("No, it is a family heirloom. But I do have the shield blueprints. A skilled craftsman could forge one.");
            next;
            mesn strcharinfo(0);
            mes l("*-* \"Could you share those blueprints with me? Please?\"");
            next;
            mesn;
            if (rand(1,5) == 4) mesc l("*cough cough*");
            if (!.@q2) {
                mesq l("Why should I? Go away. %%n");
                close;
            }
            mesq l("Sure. Here, take it.");
            setq1 NivalisQuest_Baktar, 3;
            break;
        case 3: close;
    }
    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(Dagger), 4);
    end;
}