summaryrefslogtreecommitdiff
path: root/npc/functions/lockpicking.txt
blob: da2da5dd6151549de3bcac78ba3ebc5503d75368 (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
function	script	LockPicking	{
    @lock_picking_success = 0;
    setarray @pins, rand(1,3), rand(1,3), rand(1,3);
    goto L_StartLockPicking;

L_NeedLockPickSet:
    menu
        "Unfortunately, I don't have these tools... Let's look around.", L_Return;

L_StartLockPicking:
    mes "You inspect the lock and notice it isn't sophisticated.";
    mes "With regular stuff, you should be able to lock pick it.";
    next;
    if (countitem ("LockPicks") < 1)
        goto L_NeedLockPickSet;
    menu
        "I can try with these lock picks I just found.", L_Next,
        "Maybe later.", L_Return;

L_Next:
    delitem "LockPicks", 1;
    mes "You insert the hook pick inside the lock, and, without applying any tension, you discover there are only 3 pins to set.";
    next;
    mes "You will need to set the 3 pins to align them and turn the lock's cylinder.";
    mes "A wrong move will make you start over. Remember how you had set the pins!";
    next;
    @pin = 0;
    goto L_HandlePin;

L_NextPinOrEnd:
    if (@pin >= 2)
        goto L_OpenDoor;
    @pin = @pin + 1;
    mes "Click! This pin is set!";
    next;
    goto L_HandlePin;

L_HandlePin:
    if (@pin == 0)
        mes "What to do with the first pin?";
    if (@pin == 1)
        mes "What to do with the second pin?";
    if (@pin == 2)
        mes "What to do with the last pin?";
    menu
        "Apply a soft pressure.", L_PinSoft,
        "Apply a normal pressure.", L_PinNormal,
        "Apply a strong pressure.", L_PinHard,
        "Give up. I'm in a rush!", L_GiveUp;

L_GiveUp:
    @lock_picking_success = 0;
    @pin = 0;
    cleararray @pins, 0, 3;
    @pin_pressure = 0;
    return;

L_PinSoft:
    @pin_pressure = 1;
    goto L_TestPin;

L_PinNormal:
    @pin_pressure = 2;
    goto L_TestPin;

L_PinHard:
    @pin_pressure = 3;
    goto L_TestPin;

L_TestPin:
    if (@pin_pressure == @pins[@pin])
        goto L_NextPinOrEnd;
    mes "Nope, that did not work. And the pins are unset now...";
    next;
    @pin = 0;
    goto L_HandlePin;

L_Return:
    return;

L_OpenDoor:
    @lock_picking_success = 1;
    mes "The two sets of pins separate. You can now turn the cylinder to open the door!";
    return;

}