summaryrefslogblamecommitdiff
path: root/world/map/npc/xmas/2011/badguy.txt
blob: 3827e04348d9ea40d7fb13b16e4bc798da2ba9c7 (plain) (tree)
1
2
3
4
5
6
7
8
9






                                                                                     

                                                                                                                
                       

                                                                                                               
                          
                                                                                                                    

























                                                                                          
                                                                                           





                                                                                                                                                       
                                                                         




                                                 

                                                                    









                                                                                                 
                                                                                            



















                                                  
                                                                           












                                                                              
                                                                                 





                                                                      
                                                                                                         































                                                                    
                                            














































                                                                                        
                                                     






                                                                                                        

                                                                                             







                                                   
                                                                                    




























                                                                                                            
                                                                                                            

                              
                                                       


                                                                                                              


                                    










                                                                                                     
                                                                                                       


                                                                                                                                                
                                                                                                                                                                   

                              
                                                       


                                                                                                          


                                    

















                                                                                                        
                                                       


                                                                                                       


                                    











                                                                                
                                                                                                                            





                                                                                                                
                                                       


                                                                                                          


                                    










                                                                                     
                                                                                  


















                                                                      
                                                                                                                      

















                                                                     
                                                                          




                                                       
                                                








































                                                                                              
                                                                        

































                                                                           
                                

          
// This file is part of Christmas Event 2011
// author: Jenalya
// Balthasar is sent by Santa's antagonist to sabotage the preparations for Christmas
// gives rewards depending on how much the player helped to sabotage

030-2.gat,100,31,0|script|Balthasar|336,{

    if (!(gettime(7) == $@xmas2011_year && gettime(6) == 12 && gettime(5) >= $@xmas2011_start_day)
        && !(gettime(7) == ($@xmas2011_year + 1) && gettime(6) == 1 && gettime(5) <= $@xmas2011_reward_end_day))
        goto L_NoEvent;
    if ((gettime(7) == $@xmas2011_year && gettime(6) == 12 && gettime(5) >= $@xmas2011_reward_start_day)
        || (gettime(7) == ($@xmas2011_year + 1) && gettime(6) == 1 && gettime(5) <= $@xmas2011_reward_end_day))
        goto L_RewardTime;
    if ((BaseLevel < 30) || (gettimetick(2)-TUT_var < 3*7*86400)) // player must be created at least three weeks ago
        goto L_NoHelp;

    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;

    set @input_amount, 1;
    set @output_amount, 3;

    if (xmas11 & $@xmas11_talkedToBadGuy) goto L_Helping;

    mes "[Sneaky person]";
    mes "\"Hey there! Yes, you! Are you here to see the great Santa?";
    mes "But he's hiding in his room, isn't he? Too busy for us normal people, right?\"";
    next;
    mes "\"Tell me... would you like to help me with some... trick?";
    mes "Don't worry, nothing mean... just a joke. A joke, yes.\"";
    menu
        "Ahm, sure.",L_Agree,
        "You're scary. I don't want to help you.",L_Disagree;

L_Agree:
    mes "He smiles.";
    mes "[Sneaky person]";
    mes "\"Very nice, yes, very nice. You will see, it is fun.";
    mes "We'll just play some tricks on all these busy busy helpers of the great Santa.\"";
    next;
    mes "\"They're a bit mixed up.\"";
    mes "He giggles in a very creepy way.";
    next;
    mes "[Sneaky person]";
    mes "\"So, go to see if you can... help them. Talk to the Chief Helper, he should be somewhere upstairs. And when they ask you to do something...";
    mes "You can come to ask old Balthasar how we can trick them, eh?\"";
    set xmas11, xmas11 | $@xmas11_talkedToBadGuy;
    goto L_Close;

L_Disagree:
    mes "[Sneaky person]";
    mes "\"Oh, com'on. Do you really think old Balthasar is scary?";
    mes "No, no, no, I'm harmless. Like a baby.\"";
    mes "He grins in a very creepy way.";
    next;
    mes "[Balthasar]";
    mes "\"If you change your mind, just come back...\"";
    set xmas11, xmas11 | $@xmas11_talkedToBadGuy;
    goto L_Close;

L_Helping:
    mes "[Balthasar]";
    mes "\"Welcome back my dear friend. Did you get any tasks to do? Did they ask you for help?";
    mes "Maybe I can give you some advice on how to... trick them. Yes, harmless tricks.\"";

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

    set @C_reinboo, 1;
    set @C_bedding, 2;
    set @C_glitter, 3;
    set @C_potion, 4;
    set @C_plushmouboo, 5;
    set @C_stickreinboo, 6;
    set @C_ball, 7;
    set @C_doll, 8;
    set @C_nevermind, 9;

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

    if (!(xmas11 & $@xmas11_startedReinbooSearch))
        goto L_NoReinboo;
    set @choice_idx[@choices_nr], @C_reinboo;
    set @choice$[@choices_nr], "I have to search for some lost mouboos...";
    set @choices_nr, @choices_nr + 1;

L_NoReinboo:
    if (!(xmas11 & $@xmas11_Bedding) || (xmas11 & $@xmas11_BeddingDone))
        goto L_NoBedding;
    set @choice_idx[@choices_nr], @C_bedding;
    set @choice$[@choices_nr], "I shall get some White Fur as bedding.";
    set @choices_nr, @choices_nr + 1;

L_NoBedding:
    if (!(xmas11 & $@xmas11_Decoration) || (xmas11 & $@xmas11_DecorationDone))
        goto L_NoGlitter;
    set @choice_idx[@choices_nr], @C_glitter;
    set @choice$[@choices_nr], "They want Topaz and Ruby Powder for decoration.";
    set @choices_nr, @choices_nr + 1;

L_NoGlitter:
    if (!(xmas11 & $@xmas11_Potion) || (xmas11 & $@xmas11_PotionDone))
        goto L_NoPotion;
    set @choice_idx[@choices_nr], @C_potion;
    set @choice$[@choices_nr], "There is some helper who's not feeling well. He wants a Healing Potion.";
    set @choices_nr, @choices_nr + 1;

L_NoPotion:
    if (@plushmouboo != 3)
        goto L_NoPlushMouboo;
    set @choice_idx[@choices_nr], @C_plushmouboo;
    set @choice$[@choices_nr], "I have to pack this Plush Mouboo.";
    set @choices_nr, @choices_nr + 1;

L_NoPlushMouboo:
    if (@stickreinboo != 3)
        goto L_NoStickReinboo;
    set @choice_idx[@choices_nr], @C_stickreinboo;
    set @choice$[@choices_nr], "I have to pack this Stick Reinboo.";
    set @choices_nr, @choices_nr + 1;

L_NoStickReinboo:
    if (@ball != 3)
        goto L_NoBall;
    set @choice_idx[@choices_nr], @C_ball;
    set @choice$[@choices_nr], "I have to pack this Leather Ball.";
    set @choices_nr, @choices_nr + 1;

L_NoBall:
    if (@doll != 3)
        goto L_NoDoll;
    set @choice_idx[@choices_nr], @C_doll;
    set @choice$[@choices_nr], "I have to pack this Doll.";
    set @choices_nr, @choices_nr + 1;

L_NoDoll:
    set @choice_idx[@choices_nr], @C_nevermind;
    set @choice$[@choices_nr], "Nevermind.";

    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_reinboo)
        goto L_ReinbooAdvice;
    if (@choice_idx[@menu] == @C_bedding)
        goto L_BeddingAdvice;
    if (@choice_idx[@menu] == @C_glitter)
        goto L_GlitterAdvice;
    if (@choice_idx[@menu] == @C_potion)
        goto L_PotionAdvice;
    if (@choice_idx[@menu] == @C_plushmouboo)
        goto L_PlushMoubooWrapping;
    if (@choice_idx[@menu] == @C_stickreinboo)
        goto L_StickReinbooWrapping;
    if (@choice_idx[@menu] == @C_ball)
        goto L_BallWrapping;
    if (@choice_idx[@menu] == @C_doll)
        goto L_DollWrapping;
    if ((@choice_idx[@menu] == @C_nevermind))
        goto L_Close;
     goto L_Close;

L_ReinbooAdvice:
    mes "Balthasar giggles spitefully.";
    mes "[Balthasar]";
    mes "\"Oh, right, the poor lost Reinboos. So far far away from home.\"";
    next;
    mes "\"They really really like candy and sweets.";
    mes "It would be mean not to give them candy, wouldn't it?\"";
    goto L_Close;

L_BeddingAdvice:
    mes "[Balthasar]";
    mes "\"White Fur? Don't you think it's cruel to use fur for that? Real cruel, yes.";
    mes "Why not use simple Cotton Cloth instead?\"";
    goto L_Close;

L_GlitterAdvice:
    mes "[Balthasar]";
    mes "\"Gem powder is expensive, isn't it? Too expensive to use it for glitter, don't you think so?";
    mes "I can make you some replacement powder easily.\"";
    next;
    mes "Just bring me some powder from those fuzzy ball things, how are they called again?";
    mes "Ah, Spectres and Wisps. That was it.\"";
    menu
        "Here is some Spectre Powder.",L_RedPowder,
        "I have some Wisp Powder.",L_YellowPowder,
        "I'll go and get it.",L_Close;
    goto L_Close;

L_PotionAdvice:
    mes "[Balthasar]";
    mes "\"Oh, not feeling well? What a poor guy! But drinking a healing potion...";
    mes "It's much healthier to let the body recover itself, don't you think so?\"";
    next;
    mes "\"Too much medication is bad, yes, bad. Why don't you give him something nice to drink instead?\"";
    goto L_Close;

L_RedPowder:
    if (countitem("SpectrePowder") < @input_amount)
        goto L_NoItem;
    delitem "SpectrePowder", @input_amount;
    getitem "RedPowder", @output_amount;
    mes "[Balthasar]";
    mes "\"Here, here it is.\"";
    goto L_Close;

L_YellowPowder:
    if (countitem("WispPowder") < @input_amount)
        goto L_NoItem;
    delitem "WispPowder", @input_amount;
    getitem "YellowPowder", @output_amount;
    mes "[Balthasar]";
    mes "\"Here, here it is.\"";
    goto L_Close;

L_PlushMoubooWrapping:
    mes "[Balthasar]";
    mes "\"Oh, a Plush Mouboo - what a silly thing, really silly thing.";
    mes "Don't you think we should put something more useful, expedient in that box?\"";
    next;
    mes "\"What about ... a nice Cotton Shirt? A decent Cotton Shirt would be nice, don't you think so?";
    mes "Give me an Empty Present Box, a Cotton Shirt and that Plush Mouboo. I'll pack that box for you.\"";
    menu
        "Sure, here it is.",-,
        "One moment, I need to get the stuff.",L_Close,
        "I don't think this is a good idea.",L_Close;
    if ((countitem("CottonShirt") < 1) || (countitem("OpenPresentBox") < 1) || (countitem("PlushMouboo") < 1))
        goto L_NoItem;
    getinventorylist;
    if (@inventorylist_count == 100)
        goto L_Full_Inv;
    delitem "CottonShirt", 1;
    delitem "OpenPresentBox", 1;
    delitem "PlushMouboo", 1;
    getitem "ClosedChristmasBox", 1;
    set @plushmouboo, 4;
    set xmas11, (xmas11 & ~($@xmas11_PlushMoubooMask) | (@plushmouboo << $@xmas11_PlushMoubooShift));
    mes "He bags the Plush Mouboo you gave him and puts the cotton shirt into the box.";
    goto L_Close;

L_StickReinbooWrapping:
    mes "[Balthasar]";
    mes "\"Ooh, a stick reinboo! Don't you think this is an obnoxious thing? Really really mean, yes.";
    mes "Do you know, reinboos are clever, they can even speak. And this is a toy reinboo! Very very disrespectful, right?\"";
    next;
    mes "\"Do you think... do you think we should punish the brat that wished for this disrespectful toy? I think so, yes, disrespectful brat.";
    mes "Let's put... let's put a Raw Log in there instead, yes. Give me an Empty Present Box, a Raw Log and that Stick Reinboo. I'll prepare that box for you.\"";
    menu
        "Sure, here it is.",-,
        "One moment, I need to get the stuff.",L_Close,
        "I think the Stick Reinboo is nice!",L_Close;
    if ((countitem("RawLog") < 1) || (countitem("OpenPresentBox") < 1) || (countitem("StickReinboo") < 1))
        goto L_NoItem;
    getinventorylist;
    if (@inventorylist_count == 100)
        goto L_Full_Inv;
    delitem "RawLog", 1;
    delitem "OpenPresentBox", 1;
    delitem "StickReinboo", 1;
    getitem "ClosedChristmasBox", 1;
    set @stickreinboo, 4;
    set xmas11, (xmas11 & ~($@xmas11_StickReinbooMask) | (@stickreinboo << $@xmas11_StickReinbooShift));
    mes "He puts away the Stick Reinboo and packs the Raw Log in the box.";
    goto L_Close;

L_BallWrapping:
    mes "[Balthasar]";
    mes "\"A ball? Eh, ah, a ball... ah -";
    mes "but what if the kid that gets it rather needs something to get warm?\"";
    next;
    mes "\"Let's put a piece of Coal in there instead! Yes, piece of Coal, that's good.";
    mes "Empty Present Box, a piece of Coal and the Ball. I'll pack the box for you.\"";
    menu
        "Sure, here it is.",-,
        "One moment, I need to get the stuff.",L_Close,
        "Come on, now you're getting really implausible.",L_Close;
    if ((countitem("Coal") < 1) || (countitem("OpenPresentBox") < 1) || (countitem("LeatherBall") < 1))
        goto L_NoItem;
    getinventorylist;
    if (@inventorylist_count == 100)
        goto L_Full_Inv;
    delitem "Coal", 1;
    delitem "OpenPresentBox", 1;
    delitem "LeatherBall", 1;
    getitem "ClosedChristmasBox", 1;
    set @ball, 4;
    set xmas11, (xmas11 & ~($@xmas11_BallMask) | (@ball << $@xmas11_BallShift));
    mes "He takes the ball, puts the coal into the box and closes it.";
    goto L_Close;


L_DollWrapping:
    mes "[Balthasar]";
    mes "\"Let me see, have a look... Oh, they made that kind of doll already last year. This is not very creative, is it?";
    mes "The child will be disappointed, yes, deeply disappointed to get such an ... uncool present, yes.\"";
    next;
    mes "\"We should fix that, yes, fix it. We can put some of these nice Mouboo Figurines in the box instead.";
    mes "Bring me an Empty Present Box, a Mouboo Figurine and the Doll. I'll pack the box for you.\"";
    menu
        "Sure, here it is.",-,
        "One moment, I need to get the stuff.",L_Close,
        "A Mouboo Figurine is lame.",L_Close;
    if ((countitem("MoubooFigurine") < 1) || (countitem("OpenPresentBox") < 1) || (countitem("Doll") < 1))
        goto L_NoItem;
    getinventorylist;
    if (@inventorylist_count == 100)
        goto L_Full_Inv;
    delitem "MoubooFigurine", 1;
    delitem "OpenPresentBox", 1;
    delitem "Doll", 1;
    getitem "ClosedChristmasBox", 1;
    set @doll, 4;
    set xmas11, (xmas11 & ~($@xmas11_DollMask) | (@doll << $@xmas11_DollShift));
    mes "He puts the doll in his pocket and packs the Mouboo Figurine into the box.";
    goto L_Close;

L_NoEvent:
    mes "[Balthasar]";
    mes "\"How did you come in at this time of the year? As sneaky as I am, hey?";
    mes "But you should leave anyway.\"";
    warp "030-1.gat", 99, 55;
    goto L_Close;

L_RewardTime:
    callfunc "xmas2011points";
    if (xmas11 & $@xmas11_BadGuyReward) goto L_Done;

    if (@sabotagepoints == 0)
        goto L_NoHelp;
    getinventorylist;
    if (@inventorylist_count > 80)
        goto L_Full_Inv;
    mes "[Balthasar]";

    if (@sabotagepoints < $@xmas2011_main_rewardcost)
        goto L_NoMainReward;
    getitem "Sunglasses", 1;
    set @sabotagepoints, @sabotagepoints - $@xmas2011_main_rewardcost;
    mes "\"You've shown great skill in the art of infiltration and sabotage. I'm so proud of you, very proud, yes.\"";
    next;

L_NoMainReward:
    if (@sabotagepoints < $@xmas2011_toy_rewardcost)
        goto L_NoToyReward;
L_ToyAgain:
    set @toy_reward, rand(4);
    if (@toy_reward == 0)
        getitem "PlushMouboo", 1;
    if (@toy_reward == 1)
        getitem "StickReinboo", 1;
    if (@toy_reward == 2)
        getitem "Doll", 1;
    if (@toy_reward == 3)
        getitem "LeatherBall", 1;
    set @sabotagepoints, @sabotagepoints - $@xmas2011_toy_rewardcost;
    if (@sabotagepoints >= $@xmas2011_toy_rewardcost)
        goto L_ToyAgain;
    mes "\"I think you earned yourself some fun with these toy things.\"";
    next;

L_NoToyReward:
    if (@sabotagepoints < $@xmas2011_gloves_rewardcost)
        goto L_NoGlovesReward;
    set @gloves, $@xmas2011_glove_id + rand(10);
    getitem @gloves, 1;
    set @sabotagepoints, @sabotagepoints - $@xmas2011_gloves_rewardcost;
    mes "\"This will help to keep your hands warm when operating in such cold areas.\"";
    next;

L_NoGlovesReward:
    if (@sabotagepoints == 0)
        goto L_Done;
    mes "\"Have some candy.\"";
    next;
    if (@sabotagepoints < $@xmas2011_gingerbreadman_rewardcost)
        goto L_NoGBMReward;
    set @candy_amount, @sabotagepoints/$@xmas2011_gingerbreadman_rewardcost;
    getitem "GingerBreadMan", @candy_amount;
    set @sabotagepoints, @sabotagepoints - @candy_amount*$@xmas2011_gingerbreadman_rewardcost;
L_NoGBMReward:
    if (@sabotagepoints < $@xmas2011_xmascake_rewardcost)
        goto L_NoXmasCakeReward;
    set @candy_amount, @sabotagepoints/$@xmas2011_xmascake_rewardcost;
    getitem "XmasCake", @candy_amount;
    set @sabotagepoints, @sabotagepoints - @candy_amount*$@xmas2011_xmascake_rewardcost;
L_NoXmasCakeReward:
    if (@sabotagepoints < $@xmas2011_candy_rewardcost)
        goto L_Done;
    set @candy_amount, @sabotagepoints/$@xmas2011_candy_rewardcost;
    getitem "Candy", @candy_amount;
    set @sabotagepoints, @sabotagepoints - @candy_amount*$@xmas2011_candy_rewardcost;

L_Done:
    mes "[Balthasar]";
    mes "\"It was so much fun, wasn't it?\"";
    set xmas11, xmas11 | $@xmas11_BadGuyReward;
    goto L_Close;

L_NoItem:
    mes "[Balthasar]";
    mes "\"Eh? Where is it? Go and get it!\"";
    goto L_Close;

L_Full_Inv:
    mes "[Balthasar]";
    mes "\"Oh, you have a lot of stuff with you, yes many many things.";
    mes "Come back with less things in your backpack.\"";
    goto L_Close;

L_NoHelp:
    mes "[Balthasar]";
    mes "\"Eh? Are you having fun with the cheesy Christmas stuff? Pah.\"";
    goto L_Close;

L_Close:
    set @input_amount, 0;
    set @output_amount, 0;
    set @plushmouboo, 0;
    set @stickreinboo, 0;
    set @ball, 0;
    set @doll, 0;
    set @C_reinboo, 0;
    set @C_bedding, 0;
    set @C_glitter, 0;
    set @C_potion, 0;
    set @C_plushmouboo, 0;
    set @C_stickreinboo, 0;
    set @C_ball, 0;
    set @C_doll, 0;
    set @C_nervermind, 0;
    set @choices_nr, 0;
    cleararray @choice_idx, 0, 9;
    cleararray @choice$, "", 9;
    set @menu, 0;
    set @inventorylist_count, 0;
    set @toy_reward, 0;
    set @gloves, 0;
    set @candy_amount, 0;
    set @sabotagepoints, 0;
    set @helppoints, 0;
    set @inventorylist_count, 0;
    close;
}