summaryrefslogtreecommitdiff
path: root/npc/craft
diff options
context:
space:
mode:
Diffstat (limited to 'npc/craft')
-rw-r--r--npc/craft/options.txt215
1 files changed, 197 insertions, 18 deletions
diff --git a/npc/craft/options.txt b/npc/craft/options.txt
index de392c3ae..27ca1bc9e 100644
--- a/npc/craft/options.txt
+++ b/npc/craft/options.txt
@@ -18,13 +18,7 @@
// @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)
-
-// Max Level for base: 10
-// Max Level for first tier: 5
-// Max Level for second tier:
-// Max Level for third tier:
-// Max Level for ultimate tier: 1
+// Players can active the bonus groups they want to use
// csys_Generate( cr_id{, preserve} )
// Return average level
@@ -42,22 +36,22 @@ function script csys_Generate {
// Basic tier
if (.@gid & CRGROUP_BASE) {
.@lvl=CRAFTSYS[CRGROUP_BASE];
- if (.@lvl >= 1)
+ if (.@lvl >= 1) {
array_push(@csys_attr, VAR_STRAMOUNT);
- if (.@lvl >= 2)
- array_push(@csys_attr, VAR_VITAMOUNT);
- if (.@lvl >= 3)
- array_push(@csys_attr, VAR_AGIAMOUNT);
- if (.@lvl >= 4)
array_push(@csys_attr, VAR_INTAMOUNT);
- if (.@lvl >= 5)
+ }
+ if (.@lvl >= 3) {
array_push(@csys_attr, VAR_DEXAMOUNT);
- if (.@lvl >= 6)
- array_push(@csys_attr, VAR_LUKAMOUNT);
- if (.@lvl >= 8)
array_push(@csys_attr, VAR_MAXHPAMOUNT);
- if (.@lvl >= 10)
+ }
+ if (.@lvl >= 5) {
+ array_push(@csys_attr, VAR_AGIAMOUNT);
array_push(@csys_attr, VAR_MAXSPAMOUNT);
+ }
+ if (.@lvl >= 7) {
+ array_push(@csys_attr, VAR_LUKAMOUNT);
+ array_push(@csys_attr, VAR_VITAMOUNT);
+ }
// Update averages
.@avg+=.@lvl;
@@ -459,8 +453,193 @@ function script csys_Apply {
///////
// Interface System for Options Craft
+// csysGUI_Report( )
+// Report craft skill levels
+function script csysGUI_Report {
+
+ mes l("Crafting Skill: @@", getskilllv(TMW2_CRAFT));
+ mes "";
+ mes ".:: " + l("First Tier") + " ::.";
+ mesc l("Craft Min Level: 1");
+ mes "";
+ mes l("BASIC SKILLS: @@", CRAFTSYS[CRGROUP_BASE]);
+ mesc l("Lv 1 - Str, Int");
+ mesc l("Lv 3 - Dex, MaxHP");
+ mesc l("Lv 5 - Agi, MaxMP");
+ mesc l("Lv 7 - Luk, Vit");
+ next;
+ mes "";
+ mes ".:: " + l("Second Tier") + " ::.";
+ mesc l("Craft Min Level: 2");
+ mes "";
+ mes l("ATTACK SKILLS: @@", CRAFTSYS[CRGROUP_ATK]);
+ mesc l("BASIC Min Level: 2");
+ mesc l("Lv 1 - Atk, MAtk");
+ mesc l("Lv 5 - Atk %, MAtk %");
+ mes "";
+ mes l("DEFENSE SKILLS: @@", CRAFTSYS[CRGROUP_DEF]);
+ mesc l("BASIC Min Level: 2");
+ mesc l("Lv 1 - Def, MDef");
+ mesc l("Lv 5 - Crit DEF, Ranged DEF");
+
+ next;
+ return;
+}
+
+
+// csysGUI_CRName( cr )
+// Return group name for CR
+function script csysGUI_CRName {
+ .@cr=getarg(0);
+ switch (.@cr) {
+ case CRGROUP_BASE:
+ return l("0 - Base Bonus");
+ // Tier 1
+ case CRGROUP_ATK:
+ return l("1 - Attack Bonus");
+ case CRGROUP_DEF:
+ return l("1 - Defense Bonus");
+ case CRGROUP_ACC:
+ return l("1 - Accuracy Bonus");
+ case CRGROUP_EVD:
+ return l("1 - Evasion Bonus");
+ // Tier 2
+ case CRGROUP_REGEN:
+ return l("2 - Regeneration Bonus");
+ case CRGROUP_SPEED:
+ return l("2 - Speed Bonus");
+ case CRGROUP_DOUBLE:
+ return l("2 - Double Power Bonus");
+ case CRGROUP_MAXPC:
+ return l("2 - Max Stats Bonus");
+ // Tier 3
+ case CRGROUP_SCRESIST:
+ return l("3 - SC Resist Bonus");
+ case CRGROUP_SCINFLICT:
+ return l("3 - SC Inflict Bonus");
+ case CRGROUP_MANAUSE:
+ return l("3 - Mana Economy Bonus");
+ case CRGROUP_BOSSATK:
+ return l("3 - Boss Techniques Bonus");
+ case CRGROUP_FINAL:
+ return l("4 - EXP Bonus");
+ default:
+ return Exception("Invalid optname group: "+.@cr);
+ }
+ return Exception("Definitely Invalid optname group: "+.@cr);
+}
+
+
+// csysGUI_OptToogleMenu( cr )
+// Returns a Toogle Menu for option group (CR)
+//
+function script csysGUI_OptToogleMenu {
+ .@sk=getarg(0);
+ if (getd("CRAFTSYS["+.@sk+"]")) {
+ if (CRAFTSYS_CURRENT & .@sk)
+ return "Active "+csysGUI_CRName(.@sk);
+ else
+ return "Remove "+csysGUI_CRName(.@sk);
+ }
+ return "";
+}
+
+
+// csysGUI_OptToogleMenu( cr )
+// Returns a Toogle Menu for option group (CR)
+function script csysGUI_GroupOpt {
+ .@sk=getarg(0);
+ if (csysGUI_OptReq(.@sk))
+ .@ms$=""
+ return ":";
+}
+// csysGUI_OptReq( cr )
+// Return true if all requisites for Option were met
+function script csysGUI_OptReq {
+ .@sk=getarg(0);
+ switch (.@sk) {
+ case CRGROUP_BASE:
+ return (getskilllv(TMW2_CRAFT) >= 1);
+ // Tier 1
+ case CRGROUP_ATK:
+ return (getskilllv(TMW2_CRAFT) >= 2 &&
+ CRAFTSYS[CRGROUP_BASE]);
+ case CRGROUP_DEF:
+ return (getskilllv(TMW2_CRAFT) >= 2 &&
+ CRAFTSYS[CRGROUP_BASE]);
+ case CRGROUP_ACC:
+ return (getskilllv(TMW2_CRAFT) >= 2 &&
+ CRAFTSYS[CRGROUP_BASE]);
+ case CRGROUP_EVD:
+ return (getskilllv(TMW2_CRAFT) >= 2 &&
+ CRAFTSYS[CRGROUP_BASE]);
+ // Tier 2
+ case CRGROUP_REGEN:
+ return (getskilllv(TMW2_CRAFT) >= 3 &&
+ CRAFTSYS[CRGROUP_ATK] &&
+ CRAFTSYS[CRGROUP_DEF] &&
+ CRAFTSYS[CRGROUP_BASE] >= 2);
+ case CRGROUP_SPEED:
+ return (getskilllv(TMW2_CRAFT) >= 3 &&
+ CRAFTSYS[CRGROUP_ACC] &&
+ CRAFTSYS[CRGROUP_EVD] &&
+ CRAFTSYS[CRGROUP_BASE] >= 2);
+ case CRGROUP_DOUBLE:
+ return (getskilllv(TMW2_CRAFT) >= 3 &&
+ CRAFTSYS[CRGROUP_ATK] &&
+ CRAFTSYS[CRGROUP_ACC] &&
+ CRAFTSYS[CRGROUP_BASE] >= 2);
+ case CRGROUP_MAXPC:
+ return (getskilllv(TMW2_CRAFT) >= 3 &&
+ CRAFTSYS[CRGROUP_DEF] &&
+ CRAFTSYS[CRGROUP_EVD] &&
+ CRAFTSYS[CRGROUP_BASE] >= 2);
+ // Tier 3
+ case CRGROUP_SCRESIST:
+ return (getskilllv(TMW2_CRAFT) >= 4 &&
+ CRAFTSYS[CRGROUP_MAXPC] >= 2 &&
+ CRAFTSYS[CRGROUP_REGEN] >= 2 &&
+ CRAFTSYS[CRGROUP_BASE] >= 4);
+ case CRGROUP_SCINFLICT:
+ return (getskilllv(TMW2_CRAFT) >= 4 &&
+ CRAFTSYS[CRGROUP_SPEED] >= 2 &&
+ CRAFTSYS[CRGROUP_DOUBLE] >= 2 &&
+ CRAFTSYS[CRGROUP_BASE] >= 4);
+ case CRGROUP_MANAUSE:
+ return (getskilllv(TMW2_CRAFT) >= 4 &&
+ CRAFTSYS[CRGROUP_DEF] >= 3 &&
+ CRAFTSYS[CRGROUP_EVD] >= 3 &&
+ CRAFTSYS[CRGROUP_BASE] >= 4);
+ case CRGROUP_BOSSATK:
+ return (getskilllv(TMW2_CRAFT) >= 4 &&
+ CRAFTSYS[CRGROUP_ATK] >= 3 &&
+ CRAFTSYS[CRGROUP_HIT] >= 3 &&
+ CRAFTSYS[CRGROUP_BASE] >= 4);
+ case CRGROUP_FINAL:
+ return (getskilllv(TMW2_CRAFT) >= 5 &&
+ CRAFTSYS[CRGROUP_BOSSATK] &&
+ CRAFTSYS[CRGROUP_MANAUSE] &&
+ CRAFTSYS[CRGROUP_SCINFLICT] &&
+ CRAFTSYS[CRGROUP_SCRESIST] &&
+ CRAFTSYS[CRGROUP_BASE] >= 6);
+ default:
+ return Exception("Invalid optreq group: "+.@sk);
+ }
+ return Exception("Definitely Invalid optreq group: "+.@sk);
+}
+
+// csysGUI_OptPrice( cr )
+// Return group option price and requisites
+function script csysGUI_OptPrice {
+ .@sk=getarg(0);
+
+ switch (.@sk) {
+ }
+
+ return ":";
+}