summaryrefslogblamecommitdiff
path: root/world/map/npc/xmas/2011/santa.txt
blob: 028239a18979063e9543ba88902947539573291c (plain) (tree)




























                                                                                                         
                                                            
















                                                                             

                                           






























                                                                                 
                                                


























































                                                                                      
// This file is part of Christmas Event 2011
// author: Jenalya
// Santa's room is open after Christmas
// gives rewards depending on how much the player helped

030-2.gat,197,62,0|script|Santa|105,{

    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;

    if (xmas11 & $@xmas11_talkedToChief) goto L_Helping;

    mes "[Santa]";
    mes "\"Oh, how did you come in? I'm very sorry, but I have to ask you to leave my room.";
    mes "I'll have time for you after Christmas.\"";
    warp "030-2.gat", 78, 88;
    goto L_Close;

L_Helping:
    mes "[Santa]";
    mes "\"Hello. I see you're helping with the preparations for Christmas. That's very kind of you.";
    mes "But I have to ask you to leave my room, I'll have time for you after Christmas.\"";
    warp "030-2.gat", 78, 88;
    goto L_Close;

L_NoEvent:
    mes "[Santa]";
    mes "\"I'm sorry, no visitors this time of the year.\"";
    warp "030-1.gat", 99, 55;
    goto L_Close;

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

    mes "[Santa]";
    mes "\"Welcome to my house!\"";

    if (@helppoints == 0)
        goto L_NoHelp;
    getinventorylist;
    if (@inventorylist_count > 80)
        goto L_Full_Inv;
    mes "[Santa]";
    mes "\"I see you've been helping with the preparations for Christmas.\"";
    if (@sabotagepoints > 0)
        mes "A sad look crosses his face.";
    next;
    if (@helppoints < $@xmas2011_main_rewardcost)
        goto L_NoMainReward;
    getitem "ElfNightcap", 1;
    set @helppoints, @helppoints - $@xmas2011_main_rewardcost;
    mes "\"Things would've been a disaster without your help! Please have this.";
    mes "Something a helper of mine really needs after the work is done.\"";
    next;

L_NoMainReward:
    if (@helppoints < $@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 @helppoints, @helppoints - $@xmas2011_toy_rewardcost;
    if (@helppoints >= $@xmas2011_toy_rewardcost)
        goto L_ToyAgain;
    mes "\"I have some toys for you.\"";
    next;

L_NoToyReward:
    if (@helppoints < $@xmas2011_gloves_rewardcost)
        goto L_NoGlovesReward;
    set @gloves, $@xmas2011_glove_id + rand(10);
    getitem @gloves, 1;
    set @helppoints, @helppoints - $@xmas2011_gloves_rewardcost;
    mes "\"This will keep your hands warm.\"";
    next;

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

L_Done:
    mes "[Santa]";
    mes "\"Merry Christmas!\"";
    set xmas11, xmas11 | $@xmas11_SantaReward;
    goto L_Close;

L_Full_Inv:
    mes "[Santa]";
    mes "\"Ho, you carry a lot of things with you. Please come back later.\"";
    goto L_Close;

L_NoHelp:
    mes "[Santa]";
    if (@sabotagepoints > 0)
        mes "\"You weren't a good kid this year...\"";
    if (@sabotagepoints > 0)
        mes "He looks very disappointed.";
    if (@sabotagepoints == 0)
        mes "\"Please enjoy your time in my house! Merry Christmas!\"";
    goto L_Close;

L_Close:
    set @menu, 0;
    set @inventorylist_count, 0;
    set @toy_reward, 0;
    set @gloves, 0;
    set @candy_amount, 0;
    set @sabotagepoints, 0;
    set @helppoints, 0;
    close;
}