summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-09-18 11:06:21 -0300
committerJesusaves <cpntb1@ymail.com>2019-09-18 11:06:21 -0300
commitd9dc1eb686e50845300cf42484fe0b1ee0b368e3 (patch)
tree2e021e97d84c748d7e4fe0046eb39301c6925e8c /npc
parentb23330259ecc6162fc3b778722e890cda5b5d11d (diff)
downloadserverdata-d9dc1eb686e50845300cf42484fe0b1ee0b368e3.tar.gz
serverdata-d9dc1eb686e50845300cf42484fe0b1ee0b368e3.tar.bz2
serverdata-d9dc1eb686e50845300cf42484fe0b1ee0b368e3.tar.xz
serverdata-d9dc1eb686e50845300cf42484fe0b1ee0b368e3.zip
Rewrite lockpicks minigame failsafe system.
Max Fail is now based on Thief Rank + Number of Pins. You may be informed about running out of time (need rework). NOTE: Max Fail is capped, it will NEVER give you 100% success rate!
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/lockpicks.txt12
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;
}