From e8d53b9eecd171acf1461795dd589af16a506a4a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 27 May 2019 16:51:27 -0300 Subject: Testing options craft system... Far from ready or usable --- npc/craft/tweak.txt | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'npc/craft/tweak.txt') diff --git a/npc/craft/tweak.txt b/npc/craft/tweak.txt index c6d966f4e..d46a80db6 100644 --- a/npc/craft/tweak.txt +++ b/npc/craft/tweak.txt @@ -21,32 +21,22 @@ function script SmithTweakSystem { .@id=requestitemindex(); mes ""; - if (.@id < 0) + // Ask player to confirm + if (!csys_Confirm(.@id)) return false; - // *getequipisenableopt() → cannot use here - // Not an equipment - if (!getiteminfo(.@id, ITEMINFO_LOC)) - 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) { + if (!csys_Check(.@id)) { mesc l("ITEM BREAKS, ALL OPTIONS LOST!"), 1; return false; } // Eh, apply some stuff for testing - setitemoptionbyindex(.@id, 0, VAR_MAXHPAMOUNT, 2000); - setitemoptionbyindex(.@id, 1, VAR_STRAMOUNT, 10); - setitemoptionbyindex(.@id, 2, VAR_VITAMOUNT, -5); + if (is_gm() && !CRAFTSYS_CURRENT) { + CRAFTSYS_CURRENT=CRGROUP_BASE; + CRAFTSYS[CRGROUP_BASE]=10; + } + csys_Apply(.@id); mesc l("SUCCESS!"), 3; return true; } -- cgit v1.2.3-70-g09d2