summaryrefslogblamecommitdiff
path: root/world/map/npc/xmas/2011/deliverPresentsHelper.txt
blob: 5e9ed56df8c4c419ec001bc26d6991646808387b (plain) (tree)























































































































































































                                                                                                         

                                           


                                                                                                         
                                
                                             


                                                                                                            

                               


                                                                                    

                             












                                                                                       
                                                     



















































                                                         
// author: Jenalya
// Aaron collects the finished toys
// good way: give toy + open box + wrapping
// bad way: give closed box prepared at the bad guy + wrapping

030-2.gat,127,41,0|script|Aaron|328,{

    if (!(gettime(7) == $@xmas2011_year && gettime(6) == 12 && gettime(5) >= $@xmas2011_start_day))
        goto L_NoEvent;
    if ((gettime(7) == $@xmas2011_year && gettime(6) == 12 && gettime(5) >= $@xmas2011_reward_start_day))
        goto L_RewardTime;

    set @plushmouboo, (xmas11 & $@xmas11_PlushMoubooMask) >> $@xmas11_PlushMoubooShift;
    set @stickreinboo, (xmas11 & $@xmas11_StickReinbooMask) >> $@xmas11_StickReinbooShift;
    set @ball, (xmas11 & $@xmas11_BallMask) >> $@xmas11_BallShift;
    set @doll, (xmas11 & $@xmas11_DollMask) >> $@xmas11_DollShift;

    if (xmas11 & $@xmas11_talkedToChief) goto L_Helping;

    mes "[Busy Helper]";
    mes "\"This is a disaster!\"";
    goto L_Close;

L_Helping:
    mes "[Aaron]";
    mes "\"Hello there! Do you have any finished toys ready for being packed and wrapped?";
    mes "We also need an empty box and wrapping paper.\"";

    cleararray @choice_idx, 0, 9;
    cleararray @choice$, "", 9;

    set @C_plushmouboo, 1;
    set @C_plushmouboobox, 2;
    set @C_stickreinboo, 3;
    set @C_stickreinboobox, 4;
    set @C_ball, 5;
    set @C_ballbox, 6;
    set @C_doll, 7;
    set @C_dollbox, 8;
    set @C_nevermind, 9;

    // counter of available answers
    set @choices_nr, 0;

    if (@plushmouboo != 3)
        goto L_NoPlushMouboo;
    set @choice_idx[@choices_nr], @C_plushmouboo;
    set @choice$[@choices_nr], "This Plush Mouboo needs to be packed.";
    set @choices_nr, @choices_nr + 1;

L_NoPlushMouboo:
    if (@plushmouboo != 4)
        goto L_NoPlushMoubooBox;
    set @choice_idx[@choices_nr], @C_plushmouboobox;
    set @choice$[@choices_nr], "I already packed this Plush Mouboo...";
    set @choices_nr, @choices_nr + 1;

L_NoPlushMoubooBox:
    if (@stickreinboo != 3)
        goto L_NoStickReinboo;
    set @choice_idx[@choices_nr], @C_stickreinboo;
    set @choice$[@choices_nr], "This Stick Reinboo needs to be packed.";
    set @choices_nr, @choices_nr + 1;

L_NoStickReinboo:
    if (@stickreinboo != 4)
        goto L_NoStickReinbooBox;
    set @choice_idx[@choices_nr], @C_stickreinboobox;
    set @choice$[@choices_nr], "I already packed this Stick Reinboo...";
    set @choices_nr, @choices_nr + 1;

L_NoStickReinbooBox:
    if (@ball != 3)
        goto L_NoBall;
    set @choice_idx[@choices_nr], @C_ball;
    set @choice$[@choices_nr], "This Leather Ball needs to be packed.";
    set @choices_nr, @choices_nr + 1;

L_NoBall:
    if (@stickreinboo != 4)
        goto L_NoBallBox;
    set @choice_idx[@choices_nr], @C_ballbox;
    set @choice$[@choices_nr], "I already packed this Leather Ball...";
    set @choices_nr, @choices_nr + 1;

L_NoBallBox:
    if (@doll != 3)
        goto L_NoDoll;
    set @choice_idx[@choices_nr], @C_doll;
    set @choice$[@choices_nr], "This Doll needs to be packed.";
    set @choices_nr, @choices_nr + 1;

L_NoDoll:
    if (@doll != 4)
        goto L_NoDollBox;
    set @choice_idx[@choices_nr], @C_dollbox;
    set @choice$[@choices_nr], "I already packed this Doll...";
    set @choices_nr, @choices_nr + 1;

L_NoDollBox:
    set @choice_idx[@choices_nr], @C_nevermind;
    set @choice$[@choices_nr], "I'll be back later.";

    menu
        @choice$[0],-,
        @choice$[1],-,
        @choice$[2],-,
        @choice$[3],-,
        @choice$[4],-,
        @choice$[5],-,
        @choice$[6],-,
        @choice$[7],-,
        @choice$[8],-;

    set @menu, @menu - 1;
    if (@choice_idx[@menu] == 0)
        goto L_Close;

    if ((@choice_idx[@menu] == @C_plushmouboo)|| (@choice_idx[@menu] == @C_plushmouboobox))
        set @toy$, "PlushMouboo";
    if (@choice_idx[@menu] == @C_plushmouboo)
        goto L_Pack;
    if (@choice_idx[@menu] == @C_plushmouboobox)
        goto L_Wrap;

    if ((@choice_idx[@menu] == @C_stickreinboo) || (@choice_idx[@menu] == @C_stickreinboobox))
        set @toy$, "StickReinboo";
    if (@choice_idx[@menu] == @C_stickreinboo)
        goto L_Pack;
    if (@choice_idx[@menu] == @C_stickreinboobox)
        goto L_Wrap;

    if ((@choice_idx[@menu] == @C_ball) || (@choice_idx[@menu] == @C_ballbox))
        set @toy$, "LeatherBall";
    if (@choice_idx[@menu] == @C_ball)
        goto L_Pack;
    if (@choice_idx[@menu] == @C_ballbox)
        goto L_Wrap;

    if ((@choice_idx[@menu] == @C_doll) || (@choice_idx[@menu] == @C_dollbox))
        set @toy$, "Doll";
    if (@choice_idx[@menu] == @C_doll)
        goto L_Pack;
    if (@choice_idx[@menu] == @C_dollbox)
        goto L_Wrap;

    if ((@choice_idx[@menu] == @C_nevermind))
        goto L_Close;
     goto L_Close;

L_Pack:
    mes "[Aaron]";
    mes "\"Very well, do you also have a box and wrapping paper?\"";

    callsub S_WrappingColor;

    if ((countitem("OpenPresentBox") < 1) || (countitem(@wrappingColor$) < 1) || (countitem(@toy$) < 1))
        goto L_NoItems;
    delitem "OpenPresentBox", 1;
    delitem @wrappingColor$, 1;
    delitem @toy$, 1;
    mes "[Aaron]";
    mes "\"Excellent! Give it to me!\"";
    mes "He takes the box, puts the toy into it and wraps it skillfully with the paper you gave him.";
    mes "Then he writes something on a paper next to him.";
    goto L_Deliver;

L_Wrap:
    mes "[Aaron]";
    mes "\"Ah, even better! Do you also have some wrapping paper?\"";

    callsub S_WrappingColor;

    if ((countitem("ClosedChristmasBox") < 1) || (countitem(@wrappingColor$) < 1))
        goto L_NoItems;
    delitem "ClosedChristmasBox", 1;
    delitem @wrappingColor$, 1;
    mes "[Aaron]";
    mes "\"Alright. Give it to me.\"";
    mes "He takes the box and wraps it elaborately with the paper you gave him.";
    mes "Then he writes something on a paper next to him.";
    goto L_Deliver;

L_Deliver:
    if (@toy$ == "PlushMouboo")
        set @plushmouboo, @plushmouboo + 2;
    if (@toy$ == "PlushMouboo")
        set xmas11, (xmas11 & ~($@xmas11_PlushMoubooMask) | (@plushmouboo << $@xmas11_PlushMoubooShift));

    if (@toy$ == "StickReinboo")
        set @stickreinboo, @stickreinboo + 2;
    if (@toy$ == "StickReinboo")
        set xmas11, (xmas11 & ~($@xmas11_StickReinbooMask) | (@stickreinboo << $@xmas11_StickReinbooShift));

    if (@toy$ == "LeatherBall")
        set @ball, @ball + 2;
    if (@toy$ == "LeatherBall")
        set xmas11, (xmas11 & ~($@xmas11_BallMask) | (@ball << $@xmas11_BallShift));

    if (@toy$ == "Doll")
        set @doll, @doll + 2;
    if (@toy$ == "Doll")
        set xmas11, (xmas11 & ~($@xmas11_DollMask) | (@doll << $@xmas11_DollShift));

    goto L_Close;

L_NoEvent:
    mes "[Aaron]";
    mes "\"How did you come in? At this time of the year the door should be locked!\"";
    warp "030-1.gat", 99, 55;
    goto L_Close;

L_RewardTime:
    mes "[Aaron]";
    mes "\"That was a lot of hard work this year.\"";
    goto L_Close;

L_NoItems:
    mes "[Aaron]";
    mes "\"Don't be silly. Where are the items?\"";
    goto L_Close;

L_Close:
    set @plushmouboo, 0;
    set @stickreinboo, 0;
    set @ball, 0;
    set @doll, 0;
    set @C_plushmouboo, 0;
    set @C_plushmouboobox, 0;
    set @C_stickreinboo, 0;
    set @C_stickreinboobox, 0;
    set @C_ball, 0;
    set @C_ballbox, 0;
    set @C_doll, 0;
    set @C_dollbox, 0;
    set @C_nevermind, 0;
    set @choices_nr, 0;
    cleararray @choice_idx, 0, 9;
    cleararray @choice$, "", 9;
    set @menu, 0;
    set @toy$, "";
    set @wrappingColor$, "";
    close;

S_WrappingColor:
    menu
        "Yeah, I have this red dotted.",-,
        "Sure, see this yellow dotted.",-,
        "Yes, what about this blue dotted?",-,
        "Here, I have this purple striped.",-,
        "Isn't this red golden striped one wonderful?",-,
        "Here is this green red striped.",-,
        "No, I'll get it.",L_Close;
    if (@menu == 1)
        set @wrappingColor$, "RedDottedWrap";
    if (@menu == 2)
        set @wrappingColor$, "YellowDottedWrap";
    if (@menu == 3)
        set @wrappingColor$, "BlueDottedWrap";
    if (@menu == 4)
        set @wrappingColor$, "PurpleStripedWrap";
    if (@menu == 5)
        set @wrappingColor$, "RedGoldenStripedWrap";
    if (@menu == 6)
        set @wrappingColor$, "GreenRedStripedWrap";
    return;
}