diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-01-08 16:08:13 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-01-08 16:08:13 -0300 |
commit | 7f36d6d9f61b58db006e8ae8b5fbb87510d54977 (patch) | |
tree | 7fde269b5b803f0e52961712e47577bb59fbfcbb /npc | |
parent | 2e92487a835c2fdf0d499abdd31f2e74b342db02 (diff) | |
download | serverdata-7f36d6d9f61b58db006e8ae8b5fbb87510d54977.tar.gz serverdata-7f36d6d9f61b58db006e8ae8b5fbb87510d54977.tar.bz2 serverdata-7f36d6d9f61b58db006e8ae8b5fbb87510d54977.tar.xz serverdata-7f36d6d9f61b58db006e8ae8b5fbb87510d54977.zip |
Improve Salohcin code for *any* number of retries I fancy
Diffstat (limited to 'npc')
-rw-r--r-- | npc/025-1/salohcin.txt | 2 | ||||
-rw-r--r-- | npc/craft/tweak.txt | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/npc/025-1/salohcin.txt b/npc/025-1/salohcin.txt index 2a331aaf4..1c0bdc6ce 100644 --- a/npc/025-1/salohcin.txt +++ b/npc/025-1/salohcin.txt @@ -11,7 +11,7 @@ mesn; mesq l("You'll be charged even if you fail, be warned. You can re-roll the same item once, free of charge, but it may break and there will be no refunds!"); next; - if (!SmithTweakSystem(60000, true)) { + if (!SmithTweakSystem(60000, 2)) { mes ""; mesn; mesq l("You can always try again another day!"); diff --git a/npc/craft/tweak.txt b/npc/craft/tweak.txt index 9419e9462..bb9078a22 100644 --- a/npc/craft/tweak.txt +++ b/npc/craft/tweak.txt @@ -25,11 +25,11 @@ function script SmithTweakReset { return; } -// Usage: SmithTweakSystem ({price=600, retry=False}) +// Usage: SmithTweakSystem ({price=600, retries=1}) // Returns true on success, false on failure function script SmithTweakSystem { .@price=getarg(0, 600); - .@retry=getarg(1, false); + .@retry=getarg(1, 1); // Adjust price .@price=POL_AdjustPrice(.@price); @@ -100,11 +100,11 @@ function script SmithTweakSystem { // `continue` will only be cast if .@retry is set do { + .@retry-=1; // Check if you fail if (!csys_Check(.@id)) { mesc l("YOU FAIL! It is a simple item now."), 1; if (.@retry) { - .@retry=false; mesc l("...Automatically retrying..."); continue; } @@ -117,10 +117,9 @@ function script SmithTweakSystem { next; mesc l("Do you want to re-roll?"), 1; if (askyesno() == ASK_YES) { - .@retry=false; continue; } } return true; - } while (true); + } while (.@retry > 0); } |