summaryrefslogtreecommitdiff
path: root/npc/022-1/gift_collector.txt
blob: dc3f38e46545be482cee369d4f308105dbf11fb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// 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,{
    // Start Event for the first time
    if (gettime(GETTIME_MONTH) != JANUARY && getq3(SQuest_XmasCollector) < gettime(GETTIME_YEAR)) {
        setq SQuest_XmasCollector, 1, 0, gettime(GETTIME_YEAR);
    }
    if (gettime(GETTIME_MONTH) == JANUARY && getq3(SQuest_XmasCollector) != gettime(GETTIME_YEAR)-1) {
        setq SQuest_XmasCollector, 1, 0, gettime(GETTIME_YEAR)-1;
    }
    // Main Loop
    if ($EVENT$ == "Christmas")
        goto L_Main;

    // Last year
    if (getq3(SQuest_XmasCollector) == gettime(GETTIME_YEAR)-1)
        goto L_Reward;

    // Not on season
    goto L_OutOfSeason;

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...
// Unless you reach the milestones: 200, 400, 800, 1600, 3200, 6400, 12800... gifts
// The maximum is 10 christmas boxes, or 102.400 gifts.
// There's a floor, though: Your Base Level. That determines the minimum amount
// before it starts counting. So in reality, you need 200~300 gifts to get prize.
L_Reward:
    inventoryplace XmasGift, 10;
    .@q=getq2(SQuest_XmasCollector);
    .@q=max(0, .@q-BaseLevel);
    .@gifts=min(10, log2(.@q/200))+1;
    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);
    getitem XmasGift, .@gifts;
    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;
}