summaryrefslogtreecommitdiff
path: root/npc/011-4/chest.txt
blob: 2a89c5b986583b7312bc2b2e6ee956508798f997 (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
// TMW2 Scripts
// SQuest_ElliChest, which gives equipments but cannot be open before MK is down.
// TODO

011-4,265,68,0	script	Elli's Chest	NPC_CHEST_BIG,{
    mesn;
    if ($GAME_STORYLINE < 5) {
        mesc l("This chest belongs to Elli and is sealed by a great power. At this point in time, it is impossible to open it.");
        close;
    }
    // Bitwise storing which seasons were open
    .@season = 2 ** season();
    mesc l("This is Elli's chest.");
    if (getq(SQuest_ElliChest) & .@season) {
        mesc l("You already opened it recently. Please wait a few months before Elli replenishes it.");
        close;
    }
    mesc l("Elli prepared a prize for you... If you manage to open it.");
    switch (season())
    {
    case SUMMER: .@item=any(CherryCocktail, CactusCocktail, AppleCocktail); .@prize=0; break;
    case WINTER: .@item=any(Snowflake, CaramelCandy, SmallChocolateBar); .@prize=0; break;
    case SPRING: .@item=any(Rose, Tulip, Blueberries); .@prize=0; break;
    case AUTUMN: .@item=any(Lawncandy, Saulcandy, Poocandy); .@prize=Zambacutou; break;
    }
    mesc l("Maybe %s %s will do it.", fnum(1000), .@item);
    if (!.@prize) {
        next;
        mesn l("Elli");
        mesq l("Not today, I still haven't decided the prize!");
        close;
    }
    if (countitem(.@item) < 1000) close;
    mesc l("Deliver the items to the Chest?"), 1;
    if (askyesno() == ASK_NO) close;
    delitem .@item, 1000;
    getitem .@prize, 1;
    setq SQuest_ElliChest, (getq(SQuest_ElliChest) | .@season);
    mes "";
    mesc l("You found a(n) %s inside.", getitemlink(.@prize));
    close;

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