summaryrefslogtreecommitdiff
path: root/npc/craft/tweak.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-01-08 16:05:54 -0300
committerJesusaves <cpntb1@ymail.com>2021-01-08 16:05:54 -0300
commit2e92487a835c2fdf0d499abdd31f2e74b342db02 (patch)
treebdc6487ec7c5d0af404044db2cefbc9bf2479b73 /npc/craft/tweak.txt
parentf0e8cd98e77072038d3923dc25f086b2f95d9d10 (diff)
downloadserverdata-2e92487a835c2fdf0d499abdd31f2e74b342db02.tar.gz
serverdata-2e92487a835c2fdf0d499abdd31f2e74b342db02.tar.bz2
serverdata-2e92487a835c2fdf0d499abdd31f2e74b342db02.tar.xz
serverdata-2e92487a835c2fdf0d499abdd31f2e74b342db02.zip
Salohcin initial version
Diffstat (limited to 'npc/craft/tweak.txt')
-rw-r--r--npc/craft/tweak.txt39
1 files changed, 29 insertions, 10 deletions
diff --git a/npc/craft/tweak.txt b/npc/craft/tweak.txt
index 56f0874e8..9419e9462 100644
--- a/npc/craft/tweak.txt
+++ b/npc/craft/tweak.txt
@@ -25,10 +25,11 @@ function script SmithTweakReset {
return;
}
-// Usage: SmithTweakSystem ({price})
+// Usage: SmithTweakSystem ({price=600, retry=False})
// Returns true on success, false on failure
function script SmithTweakSystem {
.@price=getarg(0, 600);
+ .@retry=getarg(1, false);
// Adjust price
.@price=POL_AdjustPrice(.@price);
@@ -95,13 +96,31 @@ function script SmithTweakSystem {
POL_PlayerMoney(.@price);
SMITH_TWEAKS+=1;
- // Check if you fail
- if (!csys_Check(.@id)) {
- mesc l("YOU FAIL! It is a simple item now."), 1;
- return false;
- }
-
- csys_Apply(.@id);
- mesc l("SUCCESS! Congratulations, the item was improved!"), 3;
- return true;
+ // Apply the bonuses. This will only loop if `continue;` is cast.
+ // `continue` will only be cast if .@retry is set
+ do
+ {
+ // 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;
+ }
+ return false;
+ }
+
+ csys_Apply(.@id);
+ mesc l("SUCCESS! Congratulations, the item was improved!"), 3;
+ if (.@retry) {
+ next;
+ mesc l("Do you want to re-roll?"), 1;
+ if (askyesno() == ASK_YES) {
+ .@retry=false;
+ continue;
+ }
+ }
+ return true;
+ } while (true);
}