From a85c9e807da07c7e2b8f5f6586114556f5fcf124 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 27 May 2019 11:01:20 -0300 Subject: Experimental Option Setting --- npc/craft/tweak.txt | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 npc/craft/tweak.txt (limited to 'npc/craft') 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; +} -- cgit v1.2.3-60-g2f50