summaryrefslogtreecommitdiff
path: root/npc/012-1/shops.txt
blob: aa411c975bbf3ba624eda3aa457d0c744d02c351 (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
012-1,36,99,0	script	#FlowerShop	NPC32767,{
    shop .name$;
    goodbye;
    close;

OnInit:
    tradertype(NST_ZENY);
    sellitem RedRose;
    sellitem PinkRose;
    sellitem YellowRose;
    sellitem WhiteRose;
    sellitem OrangeRose;
    sellitem DarkRedRose;
    sellitem RedTulip;
    sellitem PinkTulip;
    sellitem YellowTulip;
    sellitem WhiteTulip;
    sellitem OrangeTulip;
    .distance = 5;
    end;
}

012-1,36,99,0	script	Blossom	NPC163,{
    mes "[Blossom]";
    mes "\"Hello, would you like to buy some flowers?\"";
    menu
        "Sure.", L_Shop,
        "Not right now.", L_close,
        "Can I trade this Rose Hat for a differently colored one?", L_RoseHat;

L_Shop:
    close2;
    shop "#FlowerShop";

L_RoseHat:
    @base_id = 897;
    mes "[Blossom]";
    mes "\"Certainly, which color do you have?\"";
    menu
        "A red one.", L_MenuItems,
        "A white one.", L_MenuItems,
        "A pink one.", L_MenuItems,
        "A yellow one.", L_MenuItems,
        "An orange one.", L_MenuItems,
        "A blue one.", L_MenuItems;

L_MenuItems:
    @have_id = @base_id + @menu - 1;

    mes "[Blossom]";
    mes "\"And which color would you like?\"";
    menu
        "A red one.", L_MenuItems1,
        "A white one.", L_MenuItems1,
        "A pink one.", L_MenuItems1,
        "A yellow one.", L_MenuItems1,
        "An orange one.", L_MenuItems1,
        "A blue one.", L_MenuItems1;

L_MenuItems1:
    @receive_id = @base_id + @menu - 1;

    if (@have_id == @receive_id)
        goto L_SameColor;
    if (countitem(@have_id) < 1)
        goto L_NoItem;
    delitem @have_id, 1;
    getitem @receive_id, 1;
    mes "[Blossom]";
    mes "\"Here it is.\"";
    goto L_close;

L_NoItem:
    mes "[Blossom]";
    mes "\"Oh, you don't have a Rose Hat in that color.";
    mes "Did you mean a different color?\"";
    menu
        "Yes, I meant a different color.", L_RoseHat,
        "No, I changed my mind.", L_close;

L_SameColor:
    mes "[Blossom]";
    mes "\"Oh, you already have a hat in that color.";
    mes "Did you want something else?\"";
    menu
        "Yes, let me pick a different color.", L_RoseHat,
        "No, I changed my mind.", L_close;

L_close:
    @base_id = 0;
    @have_id = 0;
    @receive_id = 0;
    close;
}