summaryrefslogblamecommitdiff
path: root/npc/012-1/shops.txt
blob: aa411c975bbf3ba624eda3aa457d0c744d02c351 (plain) (tree)
1
 




















                                                  








































































                                                                              
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;
}