diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-09 13:33:57 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-09 13:33:57 -0300 |
commit | cf18ce071c79ae37e14ea38943e0b1d88da70a7b (patch) | |
tree | f9159c9b60b3018300dd22ffba0d797bc5e828e5 /npc/functions/lockpicking.txt | |
parent | 8a4bf716002a017de77fe7df301ef8e4aaf00a2e (diff) | |
download | serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.gz serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.bz2 serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.xz serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.zip |
Override
Diffstat (limited to 'npc/functions/lockpicking.txt')
-rwxr-xr-x | npc/functions/lockpicking.txt | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/npc/functions/lockpicking.txt b/npc/functions/lockpicking.txt new file mode 100755 index 00000000..da2da5dd --- /dev/null +++ b/npc/functions/lockpicking.txt @@ -0,0 +1,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; + +} |