summaryrefslogtreecommitdiff
path: root/npc/019-3/guards.txt
blob: 385426ec99e0567e9d8b1b7b7fd22f2a6bcec2dc (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
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Nivalis Liberation Day NPC

019-3,128,2,0	script	Guard#019-3.1	NPC_GUARD1,{
    mesn;
    mesq l("Are you done yet?");
    select
        rif(@QNL3, l("Yes")),
        l("No");
    if (@menu == 2)
        close;

    // Load quest env
    // Day, Score, Temporary Time;
    .@q1=getq(Q_NivalisLibday);
    .@q2=getq2(Q_NivalisLibday);
    .@q3=getq3(Q_NivalisLibday);

    // Calculate score (You have 3 minutes)
    .@score=0;
    .@time=gettimetick(2);
    .@score+=max(180-(.@time-.@q3), 0)/5;

    // Update Total Score
    setq2 Q_NivalisLibday, .@q2+.@score;
    .@q2=getq2(Q_NivalisLibday);
    // Update Highscores if needed
    if (.@q2 > $NLIB_HIGHTIME) {
        $NLIB_HIGHTIME=.@q2;
        $NLIB_HIGHNAME$=strcharinfo(0);
    }
    // Close quest
    setq1 Q_NivalisLibday, $NLIB_DAY;
    // Warp you back
    warp "019-2", 43, 55;
    closedialog;
    close;

OnBegin:
    npctalk l("Begin!");
    end;

OnInit:
    .sex = G_MALE;
    .distance = 5;

    if (!$NLIB_DAY)
        disablenpc .name$;
    end;

}