diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-05-27 16:51:27 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-05-27 16:51:27 -0300 |
commit | e8d53b9eecd171acf1461795dd589af16a506a4a (patch) | |
tree | 53367c3bda4346c32ead647dbe6d5c4982a9f8be /npc/craft/options.txt | |
parent | f9b53e1fd26eea3a895d8712813f3daab70986b8 (diff) | |
download | serverdata-e8d53b9eecd171acf1461795dd589af16a506a4a.tar.gz serverdata-e8d53b9eecd171acf1461795dd589af16a506a4a.tar.bz2 serverdata-e8d53b9eecd171acf1461795dd589af16a506a4a.tar.xz serverdata-e8d53b9eecd171acf1461795dd589af16a506a4a.zip |
Testing options craft system... Far from ready or usable
Diffstat (limited to 'npc/craft/options.txt')
-rw-r--r-- | npc/craft/options.txt | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/npc/craft/options.txt b/npc/craft/options.txt index e9d7f87ec..0466b7d05 100644 --- a/npc/craft/options.txt +++ b/npc/craft/options.txt @@ -117,6 +117,29 @@ function script csys_Generate { //return Exception("Invalid ID"); } +// Confirms if player really wants to tweak a craft. +// Do not cast after new crafts. Returns false to stop script. +// csys_Confirm( invindex ) +function script csys_Confirm { + .@id=getarg(0); + + // Sanitize input + if (.@id < 0) + return false; + + // *getequipisenableopt(<equipment slot>) → cannot use here + // Not an equipment + if (!getiteminfo(.@id, ITEMINFO_LOC)) + return false; + + mesc l("Really try to tweak this item? All current options will be deleted."); + next; + if (askyesno() == ASK_NO) + return false; + + return true; +} + // Check if you'll have success in applying options or not // Returns true if you was successful, and also cleans previous options // If you only want cleaning, just disregard the output. @@ -140,18 +163,15 @@ function script csys_Check { // Attribute item options // Does NOT performs success chance check, and can be used by NPC -// csys_Apply( invindex{, lvl} ) +// csys_Apply( invindex{, lvl, scope} ) function script csys_Apply { .@id=getarg(0); .@lv=getarg(1, getskilllv(TMW2_CRAFT)); + .@sc=getarg(1, CRAFTSYS_CURRENT); - csys_Generate(CRAFTSYS_CURRENT); - // It'll fill the following variables: - // @csys_attr → Available attributes - // @csys_penalty → Penalty attribute array - // - // use getarraysize(@csys_attr) to know how many are there. - // Players can active the bonus groups they want to use (in future, TODO) + csys_Generate(.@sc); + // @csys_attr → Available attributes + // @csys_penalty → Penalty attribute array // Shuffle the arrays array_shuffle(@csys_attr); |