summaryrefslogblamecommitdiff
path: root/npc/022-1/gift_collector.txt
blob: 09dfb8c22961e1225bf337ed8501bc8086d4dd0b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                               
                    





























                                                                                                                        
                                                            



























                                                                                                                                      
// TMW2/LoF scripts.
// Authors:
//    TMW-LoF Team
//    Jesusalva
// Description:
//    Part Of Christmas Events
//    SQuest_XmasCollector
//      Status, Delivered Gifts, Current Year
//    Status:
//      0 - Quest is unknown
//      1 - Quest is known
//      2 - Rewards Collected

022-1,65,53,0	script	Gift Fanatic	NPC_GNOME_C,{
    // Last year
    if (getq3(SQuest_XmasCollector) == gettime(GETTIME_YEAR)-1)
        goto L_Reward;
    // Not on season
    if ($EVENT$ != "Christmas")
        goto L_OutOfSeason;
    // Start Event for the first time
    if (getq3(SQuest_XmasCollector) < gettime(GETTIME_YEAR))
        setq SQuest_XmasCollector, 1, 0, gettime(GETTIME_YEAR);
    // Main Loop
    goto L_Main;

L_OutOfSeason:
    mesn;
    mesq l("Hey, collect lots of @@ and give them to me on Christmas! Not now. On Christmas!", getitemlink(PresentBox));
    close;

// The reward is actually just an extra bonus, there is nothing WOW to see here...
L_Reward:
    .@q=getq2(SQuest_XmasCollector);
    .@q=max(0, .@q-BaseLevel);
    mesn;
    mesq l("Hey, huge THANKS for the help! I love gifts! Here's your due reward!");
    mesc l("Got @@ EXP, @@ JExp and @@ GP for helping out.", .@q*7, .@q, .@q*5);
    getexp .@q*7, .@q;
    Zeny=Zeny+(.@q*5);
    setq SQuest_XmasCollector, 2, 0, 0;
    close;

L_Main:
    .@q=getq2(SQuest_XmasCollector);
    mesn;
    mesq l("I want @@! I want @@!!", getitemlink(PresentBox), getitemlink(PresentBox));
    next;
    .@price=(getiteminfo(PresentBox, ITEMINFO_SELLPRICE)+2);
    mesn;
    mesq l("I am willing to pay @@ GP for each you bring me! Do you want to give me ALL your @@?!", .@price, getitemlink(PresentBox));
    next;
    select
        rif(countitem(PresentBox), l("Yes, of course!")),
        l("Not now...");
    mes "";
    if (@menu == 1) {
        .@qnt=countitem(PresentBox);
        .@q2+=.@qnt;
        delitem PresentBox, .@qnt;
        Zeny=Zeny+.@price*.@qnt;
        getexp .@qnt*.@price, .@qnt;
        setq2 SQuest_XmasCollector, .@q2;
        mesn;
        mesq l("Many, many thanks! Thus far, you delivered me @@ gift boxes!", .@q2);
        next;
    }
    mesn;
    mesq l("Come back and give me more gifts!");
    close;

OnInit:
    .sex=G_OTHER;
    .distance=5;
    end;
}