summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-02 01:13:35 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-02 01:13:35 -0300
commitf1938da01073e781336d4796f63bfac72fbb64d0 (patch)
tree2c7d2aa1f5f41e9e3de70c8f7327e44152001cd2 /npc
parent25cf84b884dde761356e3e488d9224bbfe4fdf40 (diff)
downloadserverdata-f1938da01073e781336d4796f63bfac72fbb64d0.tar.gz
serverdata-f1938da01073e781336d4796f63bfac72fbb64d0.tar.bz2
serverdata-f1938da01073e781336d4796f63bfac72fbb64d0.tar.xz
serverdata-f1938da01073e781336d4796f63bfac72fbb64d0.zip
When aborting or completing the lockpick challenge, there's 10% chance to save the pick.
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/lockpicks.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/npc/functions/lockpicks.txt b/npc/functions/lockpicks.txt
index 72811d7f9..88171c3dd 100644
--- a/npc/functions/lockpicks.txt
+++ b/npc/functions/lockpicks.txt
@@ -70,8 +70,14 @@ function script LockPicking {
rif(.@m >= 5, l("Apply very strong pressure")), 5,
l("Give up!"), 0;
- if (!@menuret)
+ if (!@menuret) {
+ // 10% chance to save the lockpick
+ if (rand(1,10) == 7)
+ getitem Lockpicks, 1;
+ else
+ dispbottom l("The lockpick broke.");
close;
+ }
// Is your guess correct?
if (@pins[@pos] == @menuret) {
@@ -86,6 +92,13 @@ function script LockPicking {
}
if (@pos >= .@d) {
+ // 10% chance to save the lockpick
+ if (rand(1,10) == 7)
+ getitem Lockpicks, 1;
+ else
+ dispbottom l("The lockpick broke.");
+
+ // Get EXP and inform the success
THIEF_EXP += .@d*.@m-THIEF_RANK;
return 1;
}