diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-04-24 13:57:44 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-04-24 13:57:44 -0300 |
commit | 397e3665c12267f18a130a2b8a2bdb751ad8d4bc (patch) | |
tree | 40c6879ce18c2c88b74fb4a98ae72955d4d30c3a /npc/functions | |
parent | 4776d4f4438fb68261465c6fb157c4000dc00144 (diff) | |
download | serverdata-397e3665c12267f18a130a2b8a2bdb751ad8d4bc.tar.gz serverdata-397e3665c12267f18a130a2b8a2bdb751ad8d4bc.tar.bz2 serverdata-397e3665c12267f18a130a2b8a2bdb751ad8d4bc.tar.xz serverdata-397e3665c12267f18a130a2b8a2bdb751ad8d4bc.zip |
Rewrite vault lockpicking to be centralized
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/lockpicks.txt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/npc/functions/lockpicks.txt b/npc/functions/lockpicks.txt index 9e7ef4981..33ee1ea4f 100644 --- a/npc/functions/lockpicks.txt +++ b/npc/functions/lockpicks.txt @@ -127,3 +127,38 @@ function script ArrestedChances { return true; } +// Main script +// LootableVault(tier, level, variable) +function script LootableVault { + .@tier=getarg(0)+1; + .@level=getarg(1); + .@var$=getarg(2); + mesn; + mesq l("There's a shiny safe here. How much money is inside? Nobody is looking at you, great!"); + // 2*3 = 6 possibilities, 5 attempts + if (LockPicking(.@tier, .@level)) { + Zeny=Zeny+getd("$VAULT_"+.@var$); + setd("$VAULT_"+.@var$, 40); + mesn; + mesq l("Booty!"); + } else { + mesn; + .@inch=(Zeny/100); + Zeny-=.@inch; + setd("$VAULT_"+.@var$, getd("$VAULT_"+.@var$)+.@inch); + 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; + } + } + return; +} + + |