summaryrefslogtreecommitdiff
path: root/npc/002-2/bleacher.txt
blob: daea556d383b22685150c5ed0baa7b5d6f1a3d3a (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
002-2,72,92,0	script	Candide	NPC156,{
    mes "[Candide]";
    mes "\"Greetings! I am Candide the Bleacher.";
    mes "Tulimshar is my homeland, where I learned the ancient art of bleaching.\"";
    next;
    mes "\"Bleaching was originally done by the sun, but now we use ash combined with special ingredients to remove color from fabric.\"";
    next;
    menu
        "What is needed for the bleaching process?", L_Materials,
        "I'd like to bleach something.", L_bleach_menu,
        "So long.", L_close;

L_Materials:
    mes "[Candide]";
    mes "\"For each item, I will need 3 piles of ash and 5,000 GP for the special ingredients.\"";
    next;
    menu
        "I'd like to bleach something.", L_bleach_menu,
        "So long.", L_close;

L_bleach_menu:
    if (countitem("PileOfAsh") < 3) goto L_No_Ash;
    if (Zeny < 5000) goto L_No_Money;
    cleararray @CANDIDE_items,0,getarraysize(@CANDIDE_items);
    cleararray @CANDIDE_color,0,getarraysize(@CANDIDE_color);
    cleararray @CANDIDE_menu$,"",getarraysize(@CANDIDE_menu$);
    @w = 0;
    freeloop 1; // do not check for infinity loop
    callsub S_LoopArray;
    freeloop 0; // re-enable infinity loop check
    @w = 0;
    @c = 0;
    @p = 0;
    if(@CANDIDE_menu$[0] == "") goto L_Nothing;
    mes "[Candide]";
    mes "\"Yes?\"";
    next;
    menu
        "Nevermind.", L_close,
        @CANDIDE_menu$[0], L_MenuItems, // base array was too big for a dynamic menu so we can't use it
        @CANDIDE_menu$[1], L_MenuItems,
        @CANDIDE_menu$[2], L_MenuItems,
        @CANDIDE_menu$[3], L_MenuItems,
        @CANDIDE_menu$[4], L_MenuItems,
        @CANDIDE_menu$[5], L_MenuItems,
        @CANDIDE_menu$[6], L_MenuItems,
        @CANDIDE_menu$[7], L_MenuItems,
        @CANDIDE_menu$[8], L_MenuItems,
        @CANDIDE_menu$[9], L_MenuItems,
        @CANDIDE_menu$[10], L_MenuItems,
        @CANDIDE_menu$[11], L_MenuItems,
        @CANDIDE_menu$[12], L_MenuItems,
        @CANDIDE_menu$[13], L_MenuItems,
        @CANDIDE_menu$[14], L_MenuItems,
        @CANDIDE_menu$[15], L_MenuItems,
        @CANDIDE_menu$[16], L_MenuItems,
        @CANDIDE_menu$[17], L_MenuItems;

S_LoopArray:
    @c = 0;
    callsub S_LoopColor;
    @w = @w + 1;
    if(@w < getarraysize($@DYE_items$)) goto S_LoopArray;
    return;

S_LoopColor:
    if(countitem($@DYE_colors$[@c] + $@DYE_items$[@w]) > 0)
        goto L_AddToMenu;
    goto L_LoopColor2;

L_AddToMenu:
    @CANDIDE_items[@p] = @w;
    @CANDIDE_color[@p] = @c;
    @CANDIDE_menu$[@p] = $@DYE_color_names$[@c]+" "+$@DYE_item_names$[@w];
    @p = @p + 1;
    goto L_LoopColor2;

L_LoopColor2:
    @c = @c + 1;
    if(@c < getarraysize($@DYE_colors$)) goto S_LoopColor;
    return;

L_Nothing:
    mes "[Candide]";
    mes "\"Sorry, you have nothing to bleach.\"";
    next;
    goto L_close;

L_MenuItems:
    if (countitem("PileOfAsh") < 3) goto L_No_Ash;
    if (Zeny < 5000) goto L_No_Money;
    @m = @menu - 2;
    @it$ = $@DYE_colors$[@CANDIDE_color[@m]] + $@DYE_items$[@CANDIDE_items[@m]];
    if(getitemlink(@it$) == "Unknown Item") mapexit;
    delitem @it$, 1;
    delitem "PileOfAsh", 3;
    Zeny = Zeny - 5000;
    getitem $@DYE_items$[@CANDIDE_items[@m]], 1;
    goto L_Again;

L_Again:
    mes "[Candide]";
    mes "\"Would you like to bleach something else?\"";
    next;
    menu
        "Yes.", L_bleach_menu,
        "No.", L_close;

L_No_Ash:
    mes "[Candide]";
    mes "\"You don't have enough ash for me to bleach anything.";
    mes "I need three piles.\"";
    next;
    goto L_close;

L_No_Money:
    mes "[Candide]";
    mes "\"You don't have enough gold for me to bleach anything.";
    mes "I need 5,000 GP for supplies.\"";
    next;
    goto L_close;

L_close:
    mes "[Candide]";
    mes "\"Come again.\"";
    close2;
    emotion EMOTE_GRIN, strcharinfo(0);
    end;
}