summaryrefslogtreecommitdiff
path: root/npc/000-1/chest.txt
blob: c11180f6a931d590fa1b7971cda7dd6241c8d5e7 (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
// Evol scripts.
// Authors:
//    4144
//    Hal9000
//    Reid
// Description:
//    A treasure chest, with... Treasures inside!
// Variable:
//    x   ShipQuests_TreasureChest
// Values:
//    0   Treasure Chest has not been opened yet.
//    1   Treasure Chest has been opened.

000-1,83,70,0	script	#chest	NPC_CHEST,{
    if (getnpcdir ("") != 4)
    {
        setnpcdir 2;
        initnpctimer;
        startnpctimer;
        close;
    }

    .@q = getq(ShipQuests_TreasureChest);
    if (.@q == 0)
    {
        inventoryplace 514, 1;
        setq ShipQuests_TreasureChest, 1;
        Zeny = Zeny + 100;
        getitem 514, 1;
        npctalk3 l("You open the treasure chest.");
    }

    setnpcdir 6;
    initnpctimer;
    startnpctimer;
    close;

OnTimer160:
    stopnpctimer;
    if (getnpcdir ("") == 2) setnpcdir 4;
    if (getnpcdir ("") == 6) setnpcdir 0;
    end;

OnInit:
    .distance = 2;
    end;
}