From f1938da01073e781336d4796f63bfac72fbb64d0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 2 Mar 2019 01:13:35 -0300 Subject: When aborting or completing the lockpick challenge, there's 10% chance to save the pick. --- npc/functions/lockpicks.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'npc/functions') 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; } -- cgit v1.2.3-60-g2f50