summaryrefslogtreecommitdiff
path: root/npc/functions/lockpicks.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-09-06 14:13:52 -0300
committerJesusaves <cpntb1@ymail.com>2018-09-06 14:13:52 -0300
commit652b92c7050915d164cb4ec8576ded81ddc1257d (patch)
tree47f4795d144de6ba46710c6f0ff0c91d652d698c /npc/functions/lockpicks.txt
parent74812206e5fafeeaf5d873c0cd4a6735d918956f (diff)
downloadserverdata-652b92c7050915d164cb4ec8576ded81ddc1257d.tar.gz
serverdata-652b92c7050915d164cb4ec8576ded81ddc1257d.tar.bz2
serverdata-652b92c7050915d164cb4ec8576ded81ddc1257d.tar.xz
serverdata-652b92c7050915d164cb4ec8576ded81ddc1257d.zip
"Working" prototype. Incomplete.
This is for @Saulc see and understand what I'm doing, and ~~have a heart attack~~ give me a loving comment.
Diffstat (limited to 'npc/functions/lockpicks.txt')
-rw-r--r--npc/functions/lockpicks.txt14
1 files changed, 9 insertions, 5 deletions
diff --git a/npc/functions/lockpicks.txt b/npc/functions/lockpicks.txt
index df17d4c67..d3bb0d837 100644
--- a/npc/functions/lockpicks.txt
+++ b/npc/functions/lockpicks.txt
@@ -10,7 +10,7 @@
// THIEF_RANK
// Position on the Thief Tree
-// LockPicking(num_pins, max_pins, prize)
+// LockPicking(num_pins, max_pins)
// Returns 0 upon failure, 1 upon success
// Closes script if an error happen or if you give up / cannot try.
//
@@ -27,14 +27,13 @@ function script LockPicking {
.@d=getarg(0,1);
.@m=getarg(1,3);
- .@p=getarg(2,100);
// Invalid Argument (kill script)
if (.@d < 1 || .@m < 2 || .@m > 5)
end;
// You must be rank (number of locks - 1) to try
- if (THIEF_RANK < .@d) {
+ if (THIEF_RANK+1 < .@d) {
mesc l("This lock is beyond your current capacity."), 1;
close;
}
@@ -58,6 +57,7 @@ function script LockPicking {
// Each thief rank grants you an extra attempt.
// Each pin takes one attempt.
// 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++) {
mesc l("You are trying to open the @@th pin. What to do?", @pos+1);
@@ -77,12 +77,16 @@ function script LockPicking {
mesc l("*click*");
@pos+=1;
} else {
- mesc l("This didn't work.");
+ mesc l("This didn't work. All pins are now unset!");
+ @pos=0;
}
- if (@pos > .@d)
+ if (@pos > .@d) {
+ THIEF_EXP += .@d*.@m;
return 1;
+ }
}
+ THIEF_EXP += 1;
return 0;
}