diff options
-rw-r--r-- | npc/functions/lockpicks.txt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/npc/functions/lockpicks.txt b/npc/functions/lockpicks.txt index c8271ba3a..3394dc7f8 100644 --- a/npc/functions/lockpicks.txt +++ b/npc/functions/lockpicks.txt @@ -51,6 +51,7 @@ function script LockPicking { // Setup your attempt delitem Lockpicks, 1; @pos=0; + @chance=min(.@d*.@m-1, THIEF_RANK+.@d); mesc l("You insert the hook pick inside the lock, and, without applying any tension, you discover there are only @@ pins to set.", .@d); // You have as many attempts as pins and appliable strenghts. @@ -59,7 +60,7 @@ function script LockPicking { // It's not multiplied, so 3 pins with 3 positions: 6 chances, 9 possibilities. // There's no penalty, but the attempt is counted working or not! // Remember if you fail, all previous pins will be cleared (@pos) - for (.@i=0; .@i < (.@d+.@m+THIEF_RANK) ; .@i++) { + do { mesc l("You are trying to open the @@th pin. What will to do?", @pos+1); menuint @@ -86,11 +87,17 @@ function script LockPicking { } else { mesc l("This didn't work. All pins are now unset!"); @pos=0; + @chance-=1; // We don't need to clear console, each successful attempt IS counted. // Therefore, unsetting 3 pins means you must do 3 new attempts!! // The biggie is that you're running against time, here!!! + if (@chance < THIEF_RANK) + mesc l("Your thief instincts suggest you to hurry."), 1; } + if (@chance <= 0) + break; + if (@pos >= .@d) { // 20% chance to save the lockpick if (rand2(1,5) == 3) @@ -102,8 +109,9 @@ function script LockPicking { THIEF_EXP += .@d*.@m-THIEF_RANK; return 1; } - } + } while (true); + // Failed THIEF_EXP += 1; return 0; } |