summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/017-3/vault.txt13
-rw-r--r--npc/018-2-4/vault.txt13
-rw-r--r--npc/functions/lockpicks.txt12
3 files changed, 34 insertions, 4 deletions
diff --git a/npc/017-3/vault.txt b/npc/017-3/vault.txt
index 9f48bc3be..35434eae9 100644
--- a/npc/017-3/vault.txt
+++ b/npc/017-3/vault.txt
@@ -15,11 +15,20 @@
mesq l("Booty!");
} else {
mesn;
- mesq l("Arrested!");
.@inch=(Zeny/100);
Zeny-=.@inch;
$VAULT_01738039+=.@inch;
- atcommand("@jailfor 5mn "+strcharinfo(0));
+ if (ArrestedChances()) {
+ mesc l("Arrested!");
+ atcommand("@jailfor 5mn "+strcharinfo(0));
+ } else {
+ if (is_night())
+ .@p$=l("The darkness of night gives you cover.");
+ else
+ .@p$=l("Your agile legs and sheer luck allows you to outrun the cops.");
+ mesc l("You run as far as you could. %s", .@p$);
+ warp "000-1", 22, 22;
+ }
}
close;
diff --git a/npc/018-2-4/vault.txt b/npc/018-2-4/vault.txt
index 541a53645..043504829 100644
--- a/npc/018-2-4/vault.txt
+++ b/npc/018-2-4/vault.txt
@@ -15,11 +15,20 @@
mesq l("Booty!");
} else {
mesn;
- mesq l("Arrested!");
.@inch=(Zeny/100);
Zeny-=.@inch;
$VAULT_01824+=.@inch;
- atcommand("@jailfor 5mn "+strcharinfo(0));
+ if (ArrestedChances()) {
+ mesc l("Arrested!");
+ atcommand("@jailfor 5mn "+strcharinfo(0));
+ } else {
+ if (is_night())
+ .@p$=l("The darkness of night gives you cover.");
+ else
+ .@p$=l("Your agile legs and sheer luck allows you to outrun the cops.");
+ mesc l("You run as far as you could. %s", .@p$);
+ warp "000-1", 22, 22;
+ }
}
close;
diff --git a/npc/functions/lockpicks.txt b/npc/functions/lockpicks.txt
index 879c3b334..78878eaf6 100644
--- a/npc/functions/lockpicks.txt
+++ b/npc/functions/lockpicks.txt
@@ -115,3 +115,15 @@ function script LockPicking {
THIEF_EXP += 1;
return 0;
}
+
+// Script helper to say if you were arrested or not
+function script ArrestedChances {
+ .@runaway=limit(0, readbattleparam(bLuk)+readbattleparam(bAgi), 200); // 20%
+ .@runaway+=is_night()*125; // 12.5%
+ .@runaway+=limit(0, THIEF_RANK*15, 100); // real max 7.5%
+ // Max runaway chance: 40%
+ if (rand2(1000) < .@runaway)
+ return false
+ return true
+}
+