summaryrefslogblamecommitdiff
path: root/world/map/npc/012-1/shops.txt
blob: c7c01ee229fe36f6e5483302fb61b42f381efc5a (plain) (tree)
1
2
3
4
5
6
7

  
                                                                                                                                                                                        
                                                                                                                                                                                                          
 
                                
 







                                                                                                                                                                                                              




                                                         

                                                                              

       
                                                                                                    
           

                       










                                                                                                                                                                
                                                                                                                                                       













                                                                                                       


                                                                                                                                                   

                 




                                                  







                                      
                                       



                                              







                                       
                                          













                                                         
                                            





                                                     

                                                      
        
                                                         



                                          

                       

          
//

012-1,36,99,0|shop|#FlowerShop|32767,RedRose:*1,PinkRose:*1,YellowRose:*1,WhiteRose:*1,OrangeRose:*1,DarkRedRose:*1,RedTulip:*1,PinkTulip:*1,YellowTulip:*1,WhiteTulip:*1,OrangeTulip:*1
012-1,36,99,0|shop|#FlowerPetalShop|32767,PinkPetal:*1,RedRose:*1,PinkRose:*1,YellowRose:*1,WhiteRose:*1,OrangeRose:*1,DarkRedRose:*1,RedTulip:*1,PinkTulip:*1,YellowTulip:*1,WhiteTulip:*1,OrangeTulip:*1

012-1,36,99,0|script|Blossom|163
{
    goto L_Start;

L_Start:
    set @shopopt$, "";
    if ( (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_ASKED_FOR_PETALS ) set @shopopt$, "Do you sell Pink Petals?";
    if ( (HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_ASKED_FOR_PETALS && (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) set @shopopt$, "How many Pink Flower Seeds do I need again?";
    if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) set @shopopt$, "I want to deliver the Pink Flower Seeds.";

    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,
        @shopopt$, L_Petals;

L_Shop:
    if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS ) goto L_ShopPetals;
    close2;
    shop "#FlowerShop";

L_ShopPetals:
    close2;
    shop "#FlowerPetalShop";

L_Petals:
    if ( (HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_ASKED_FOR_PETALS && (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) goto L_HowMany;
    if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) goto L_Deliver;

    set HURNS1_STATE, (HURNS1_STATE & ~BYTE_0_MASK) | PINK_PETAL_SHOP_ASKED_FOR_PETALS;

    mes "[Blossom]";
    mes "\"Not at the moment, but I could grow some if you bring me " + PINK_FLOWER_SEEDS_NEEDED + " [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@].\"";
    goto L_Close;

L_HowMany:
    mes "[Blossom]";
    mes "\"You need " + PINK_FLOWER_SEEDS_NEEDED + " [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@].\"";
    goto L_Close;

L_Deliver:
    if ( countitem(PinkFlowerSeed) < PINK_FLOWER_SEEDS_NEEDED ) goto L_HowMany;

    set HURNS1_STATE, (HURNS1_STATE & ~BYTE_0_MASK) | PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS;
    delitem PinkFlowerSeed, PINK_FLOWER_SEEDS_NEEDED;

    mes "[Blossom]";
    mes "\"Wonderful! You found all the [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@].";
    mes "I found some myself while you where away, so I already have [@@" + PinkPetal +"|Pink Petals@@] in stock. These flowers grow really fast.";
    mes "With all your seeds, I can now establish a lifetime supply for you.\"";
    goto L_Close;

L_RoseHat:
    set @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:
    set @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:
    set @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:
    set @base_id, 0;
    set @have_id, 0;
    set @receive_id, 0;
    close;
}