summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-27 15:33:12 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-27 15:33:12 -0300
commit72699baa837cf83248ecb6c4b0b9c6dc900b3d66 (patch)
treeb7fce770d89a2f78a49405b01b855ec460c80269
parentb29f8151cf83f567d46fa166fc0874070af00480 (diff)
downloadserverdata-72699baa837cf83248ecb6c4b0b9c6dc900b3d66.tar.gz
serverdata-72699baa837cf83248ecb6c4b0b9c6dc900b3d66.tar.bz2
serverdata-72699baa837cf83248ecb6c4b0b9c6dc900b3d66.tar.xz
serverdata-72699baa837cf83248ecb6c4b0b9c6dc900b3d66.zip
Item Options - WIP
-rw-r--r--db/constants.conf21
-rw-r--r--db/item_options.conf28
-rw-r--r--db/re/skill_db.conf12
-rw-r--r--npc/craft/options.txt119
-rw-r--r--npc/craft/tweak.txt2
-rw-r--r--npc/scripts.conf1
6 files changed, 168 insertions, 15 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 4ce2bea22..8ff1f1b67 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -4359,6 +4359,27 @@ constants_db: {
ASK_NO: 2
ASK_EXIT: 255
+ comment__: "craft skill groups IDs"
+ // Base tier
+ CRGROUP_BASE: 1
+ // First tier
+ CRGROUP_ATK: 2
+ CRGROUP_DEF: 4
+ CRGROUP_ACC: 8
+ CRGROUP_EVD: 16
+ // Second tier
+ CRGROUP_REGEN: 32
+ CRGROUP_SPEED: 64
+ CRGROUP_DOUBLE: 128
+ CRGROUP_MAXPC: 256
+ // Third tier
+ CRGROUP_SCRESIST: 512
+ CRGROUP_SCINFLICT: 1024
+ CRGROUP_MANAUSE: 2048
+ CRGROUP_BOSSDEF: 4096
+ // Final tier
+ CRGROUP_EXPUP: 8192
+
comment__: "Emotes"
// TMW2 Emotes
E_DISGUST: 1
diff --git a/db/item_options.conf b/db/item_options.conf
index ab5a59f65..ca734d5c4 100644
--- a/db/item_options.conf
+++ b/db/item_options.conf
@@ -966,12 +966,12 @@ item_options_db: (
{
Id: 173
Name: "HP_DRAIN"
- Script: <" bonus(bHPDrainValue, (getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus(bHPDrainValue, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 174
Name: "SP_DRAIN"
- Script: <" bonus(bSPDrainValue, (getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus(bSPDrainValue, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 175
@@ -1038,62 +1038,62 @@ item_options_db: (
{
Id: 187
Name: "IOPT_SPLASHDAMAGE"
- Script: <" bonus(bSplashRange, (getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus(bSplashRange, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 188
Name: "IOPT_WALKSPEED"
- Script: <" bonus(bSpeedAddRate, (getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus(bSpeedAddRate, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 189
Name: "IOPT_EXPGAIN"
- Script: <" bonus2(bExpAddRace, RC_All, (getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bExpAddRace, RC_All, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 190
Name: "IOPT_DOUBLEATTACK"
- Script: <" bonus(bDoubleAddRate, (getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus(bDoubleAddRate, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 191
Name: "IOPT_SCRESIST_POISON"
- Script: <" bonus2(bResEff,Eff_Poison,(getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bResEff,Eff_Poison, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 192
Name: "IOPT_SCRESIST_SILENCE"
- Script: <" bonus2(bResEff,Eff_Silence,(getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bResEff,Eff_Silence, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 193
Name: "IOPT_SCRESIST_CURSE"
- Script: <" bonus2(bResEff,Eff_Curse,(getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bResEff,Eff_Curse, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 194
Name: "IOPT_SCRESIST_BLIND"
- Script: <" bonus2(bResEff,Eff_Blind,(getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bResEff,Eff_Blind, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 195
Name: "IOPT_SCPROVOKE_POISON"
- Script: <" bonus2(bAddEff,Eff_Poison,(getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bAddEff,Eff_Poison, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 196
Name: "IOPT_SCPROVOKE_SILENCE"
- Script: <" bonus2(bAddEff,Eff_Silence,(getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bAddEff,Eff_Silence, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 197
Name: "IOPT_SCPROVOKE_CURSE"
- Script: <" bonus2(bAddEff,Eff_Curse,(getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bAddEff,Eff_Curse, getequippedoptioninfo(IT_OPT_VALUE)); ">
},
{
Id: 198
Name: "IOPT_SCPROVOKE_BLIND"
- Script: <" bonus2(bAddEff,Eff_Blind,(getequippedoptioninfo(IT_OPT_VALUE)); ">
+ Script: <" bonus2(bAddEff,Eff_Blind, getequippedoptioninfo(IT_OPT_VALUE)); ">
}
diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf
index 554f6bd73..1d94fc3af 100644
--- a/db/re/skill_db.conf
+++ b/db/re/skill_db.conf
@@ -38544,6 +38544,18 @@ skill_db: (
Self: true
}
},
+{
+ Id: 20033
+ Name: "TMW2_CRAFT"
+ Description: "Crafting"
+ MaxLevel: 10
+ SkillType: {
+ Self: true
+ }
+ SkillInfo: {
+ Quest: true
+ }
+},
// More skills: 20036~20042
{
Id: 20036
diff --git a/npc/craft/options.txt b/npc/craft/options.txt
new file mode 100644
index 000000000..515cd315c
--- /dev/null
+++ b/npc/craft/options.txt
@@ -0,0 +1,119 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Item Option System
+// Notes:
+// Awarded for crafters and their own base skill tree system
+
+// Player knowledge structure
+// CRAFTSYS[ SKILL_SCOPE ] = SKILL_LV
+
+// ReturnVarID() takes the scope and finds out the skills on the group
+// 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)
+
+// 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
+
+// ReturnVarID( cr_id{, preserve} )
+function script ReturnVarID {
+ .@gid=getarg(0);
+ if (!getarg(1, false)) {
+ deletearray(@csys_attr);
+ }
+ .@lvl=getd("CRAFTSYS["+.@gid+"]");
+
+ switch (.@gid) {
+ case CRGROUP_BASE:
+ if (@lvl >= 1)
+ array_push(@csys_attr, VAR_STRAMOUNT);
+ if (@lvl >= 2)
+ array_push(@csys_attr, VAR_AGIAMOUNT);
+ if (@lvl >= 3)
+ array_push(@csys_attr, VAR_VITAMOUNT);
+ if (@lvl >= 4)
+ array_push(@csys_attr, VAR_INTAMOUNT);
+ if (@lvl >= 5)
+ 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)
+ array_push(@csys_attr, VAR_MAXSPAMOUNT);
+ break;
+ // First tier
+ case CRGROUP_ATK:
+ if (@lvl >= 1) {
+ array_push(@csys_attr, VAR_ATTPOWER);
+ array_push(@csys_attr, VAR_ATTMPOWER);
+ }
+ if (@lvl >= 5) {
+ array_push(@csys_attr, VAR_MAGICATKPERCENT);
+ array_push(@csys_attr, VAR_ATKPERCENT);
+ }
+ array_push(@csys_penalty, VAR_ITEMDEFPOWER);
+ array_push(@csys_penalty, VAR_MDEFPOWER);
+ break;
+ case CRGROUP_DEF:
+ if (@lvl >= 1) {
+ array_push(@csys_attr, VAR_ITEMDEFPOWER);
+ array_push(@csys_attr, VAR_MDEFPOWER);
+ }
+ if (@lvl >= 5) {
+ array_push(@csys_attr, DAMAGE_CRI_USER);
+ array_push(@csys_attr, RANGE_ATTACK_DAMAGE_USER);
+ }
+ array_push(@csys_penalty, VAR_ATTPOWER);
+ array_push(@csys_penalty, VAR_ATTMPOWER);
+ break;
+ case CRGROUP_ACC:
+ if (@lvl >= 1) {
+ array_push(@csys_attr, VAR_HITSUCCESSVALUE);
+ }
+ if (@lvl >= 5) {
+ array_push(@csys_attr, VAR_CRITICALSUCCESSVALUE);
+ }
+ array_push(@csys_penalty, VAR_ATTPOWER);
+ array_push(@csys_penalty, VAR_ATTMPOWER);
+ break;
+ break;
+ case CRGROUP_EVD:
+ if (@lvl >= 1) {
+ array_push(@csys_attr, VAR_AVOIDSUCCESSVALUE);
+ }
+ if (@lvl >= 5) {
+ array_push(@csys_attr, VAR_PLUSAVOIDSUCCESSVALUE);
+ }
+ array_push(@csys_penalty, VAR_ATTPOWER);
+ array_push(@csys_penalty, VAR_ATTMPOWER);
+ break;
+ break;
+ // Second tier
+ case CRGROUP_REGEN:
+ if (@lvl >= 1) {
+ array_push(@csys_attr, VAR_HPACCELERATION);
+ }
+ if (@lvl >= 5) {
+ array_push(@csys_attr, VAR_SPACCELERATION);
+ }
+ array_push(@csys_penalty, VAR_ATTPOWER);
+ array_push(@csys_penalty, VAR_ATTMPOWER);
+ break;
+ }
+
+ return Exception("Invalid ID");
+}
+
+
+
+
+
diff --git a/npc/craft/tweak.txt b/npc/craft/tweak.txt
index 4f10ac3c1..c6d966f4e 100644
--- a/npc/craft/tweak.txt
+++ b/npc/craft/tweak.txt
@@ -44,7 +44,7 @@ function script SmithTweakSystem {
}
// Eh, apply some stuff for testing
- setitemoptionbyindex(.@id, 0, VAR_MAXHPAMOUNT, 200);
+ setitemoptionbyindex(.@id, 0, VAR_MAXHPAMOUNT, 2000);
setitemoptionbyindex(.@id, 1, VAR_STRAMOUNT, 10);
setitemoptionbyindex(.@id, 2, VAR_VITAMOUNT, -5);
mesc l("SUCCESS!"), 3;
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 6376db465..823f1913a 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -76,6 +76,7 @@
"npc/items/teleporter.txt",
// Crafting System
+"npc/craft/options.txt",
"npc/craft/alchemy.txt",
"npc/craft/smith.txt",
"npc/craft/tweak.txt",