summaryrefslogtreecommitdiff
path: root/npc/014-3/rauk.txt
blob: cabb9cbe4d0597f851721b81d52384b98a3ed99b (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
// TMW2 Script
// Author:
//     Povo
// Description:
//    Will craft green dye for the player but not without having some fun first

014-3,204,110,0	script	Rauk	NPC_PLAYER,{

    function check_items {
        if (countitem(BottleOfWoodlandWater) < 1 ||
             countitem(MaggotSlime) < 1 ||
             countitem(ArtichokeHerb) < 1 ||
             Zeny < 100) {
           mesq l("Sorry, you don't have everything needed to play.");
           next;
           goto L_Quit;
        }
    }
    
    speech S_LAST_NEXT,
        l("Huh? Can't you see that I am busy?");
        l("What do you want?");

L_Menu:
     .@q = getq(HurnscaldQuest_Rauk);
    select
        l("What are you doing?"),
        l("Umm...nevermind.");
    mes "";

    switch (@menu)
    {
        case 1:
            goto L_LevelCheck;
        case 2:
            goto L_Quit;
    }

L_LevelCheck:
    mesn;
    mesq l("I am practicing a form of advanced alchemy using some items found by killing monsters in the forest and caves nearby."); 
    mesq l("I could always use more supplies.");
    next;
    if (BaseLevel < 30) {
        mesn;
        mesq l("I would hire you if your level was higher. Low level adventurers usually take too long.");
        mesq l("Maybe you should come back later.");
        next;
        goto L_Quit;
    } else {
        mesn;
        mesq l("You want to help?");
        next;
        mesn;
        mesq l("Heh, I don't know, I usually deal with stronger adventurers...");
        mesq l("Look, I know it is not easy out there when you are trying to make something of yourself.");
        next;
        mesn;
        mesq l("Instead of bringing me a large number of items, I will play a game to give you a chance to win a %s for a low price.", getitemlink(GreenDye));
        mesq l("To start the game, first give me %d %s. After that, each entry costs %d %s, %d %s, and %d GP.", 
                        1, getitemlink(BottleOfWoodlandWater), 5, getitemlink(MaggotSlime), 3, getitemlink(ArtichokeHerb), 100);
        mesq l("You can play as many entries as you want but if you run out of items or give up, there are no refunds");
        mesq l("What do you say?");
        if (.@q < 1)
            setq(HurnscaldQuest_Rauk, 1);
        next;
        goto L_GameMenu;
    }
 
 L_GameMenu:
     select
        l("Yeah, I will play!"),
        l("No thanks.");
    mes "";

    switch (@menu)
    {
        case 1:
            goto L_GameStart;
        case 2:
            goto L_Quit;
    }

L_GameStart:
    .@n = rand(1000);
    mesn;
    mesq l("I have picked a number between 0 and 1000.");
    mesq l("The number will not change, and you can keep guessing until you either give up or get it right.");
    mesn;
    check_items();
    mesq l("Alright, let's play!");
    next;
    delitem BottleOfWoodlandWater, 1;
    inventoryplace EmptyBottle, 1;
    getitem(EmptyBottle, 1);
    mesn;
    
    L_TryAgain:
        mesq l("You have %d %s,  %d %s, and %s GP.", countitem(ArtichokeHerb), getitemlink(ArtichokeHerb),
                        countitem(MaggotSlime), getitemlink(MaggotSlime), fnum(Zeny));
        mesq l("Each guess costs %d %s, %d %s, and %d GP.", 1, getitemlink(ArtichokeHerb), 1, getitemlink(MaggotSlime), 100);
        check_items();
        mesq l("Take a guess?");
        next;
        
        select
            l("Yes."),
            l("No. I will come back later.");
        mes "";
    
         switch (@menu)
         {
            case 1:
                delitem ArtichokeHerb, 3;
                delitem MaggotSlime, 5;
                Zeny = Zeny - 100;
                mesn;
                mesq l("Pick a number between 0 and 1000.");
                input .@amount;
                if (.@amount == .@n) {
                    mesq l("You Win!");
                    inventoryplace GreenDye, 1;
                    if (.@q < 2) {
                        setq(HurnscaldQuest_Rauk, 2);
                        getexp 800, 0;
                    }
                    getitem(GreenDye, 1);
                    mesq l("That was fun! Enjoy the prize and come back anytime if you want to play again.");
                    next;
                    goto L_Quit;
                }
                if (.@amount < .@n) {
                    mesn;
                    mesq l("Wrong! My number is higher.");
                    next;
                    goto L_TryAgain;
                }
                if (.@amount > .@n) {
                   mesn;
                   mesq l("Wrong! My number is lower.");
                   next;
                   goto L_TryAgain;
                }
            case 2:
                goto L_Quit;
        }

L_Quit:
    closedialog;
    goodbye;
    close;
    
OnInit:
    .@npcId = getnpcid(.name$);
    .sex = G_MALE;
    .distance = 4;
    end;
}