summaryrefslogtreecommitdiff
path: root/npc/craft
diff options
context:
space:
mode:
Diffstat (limited to 'npc/craft')
-rw-r--r--npc/craft/tweak.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/npc/craft/tweak.txt b/npc/craft/tweak.txt
new file mode 100644
index 000000000..cc8242275
--- /dev/null
+++ b/npc/craft/tweak.txt
@@ -0,0 +1,46 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Smith System (Player, Guild, NPC)
+// Notes:
+// It's like smithing, but it only change an item options
+
+// Usage: SmithTweakSystem ({scope})
+// Scopes: CRAFT_PLAYER, CRAFT_NPC
+// Returns true on success, false on failure
+function script SmithTweakSystem {
+ // Set .scope, .knowledge and .success
+ .scope=getarg(0, CRAFT_PLAYER);
+ copyarray(.knowledge,RECIPES_EQUIPMENT,getarraysize(RECIPES_EQUIPMENT));
+ .success=false;
+
+ mes l("Which item will you tweak?");
+ mesc l("WARNING, ITEM MAY BREAK"), 1;
+
+ .@id=requestitemindex();
+ mes "";
+
+ if (.@id < 0)
+ return false;
+
+ // Clear all five options
+ setitemoptionbyindex(.@id, 0, 0, 0);
+ setitemoptionbyindex(.@id, 1, 0, 0);
+ setitemoptionbyindex(.@id, 2, 0, 0);
+ setitemoptionbyindex(.@id, 3, 0, 0);
+ setitemoptionbyindex(.@id, 4, 0, 0);
+
+ // Check if you fail
+ if (rand(0,10000) < 200) {
+ mesc l("ITEM BREAKS, ALL OPTIONS LOST!"), 1;
+ return false;
+ }
+
+ // Eh, apply some stuff for testing
+ setitemoptionbyindex(.@id, 0, VAR_MAXHPAMOUNT, 200);
+ setitemoptionbyindex(.@id, 1, VAR_STRAMOUNT, 10);
+ setitemoptionbyindex(.@id, 2, VAR_VITAMOUNT, -5);
+ mesc l("SUCCESS!"), 3;
+ return true;
+}