diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-06-21 03:28:39 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-06-21 03:28:39 -0300 |
commit | 6a2b66bfcc1e2210f90f9dc36608758d7e2580d4 (patch) | |
tree | 51f5f7ed8b97f2fd723267a00eaea8a2c66fcc1b | |
parent | 3b54b5d72e976737d6274ff9deeff96057db3d36 (diff) | |
download | serverdata-6a2b66bfcc1e2210f90f9dc36608758d7e2580d4.tar.gz serverdata-6a2b66bfcc1e2210f90f9dc36608758d7e2580d4.tar.bz2 serverdata-6a2b66bfcc1e2210f90f9dc36608758d7e2580d4.tar.xz serverdata-6a2b66bfcc1e2210f90f9dc36608758d7e2580d4.zip |
Crafting Advanced Bonus Rules!
Effects +20% for Savior set
Attack % Bonus halved for all!
2H and Bows/Guns will get x2 (same as before), magic & brawling gets +80%
-rw-r--r-- | db/constants.conf | 10 | ||||
-rw-r--r-- | npc/craft/options.txt | 55 |
2 files changed, 58 insertions, 7 deletions
diff --git a/db/constants.conf b/db/constants.conf index b1d071d67..a3361daa9 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -4273,6 +4273,16 @@ constants_db: { CRAFT_EXPERT: 8 CRAFT_MASTER: 16 + comment__: "CRAFT Bonus Correction enum" + CSYS_ARMOR: 1 + CSYS_ZWEIHANDER: 2 + CSYS_BRAWLING: 4 + CSYS_RANGED: 8 + CSYS_MAGICAL: 16 + CSYS_SPECIAL: 32 + CSYS_OTHER: 64 + CSYS_SAVIOR: 128 + comment__: "Easter eggs enum" EE_NONE: 0 EE_SAXSO: 1 diff --git a/npc/craft/options.txt b/npc/craft/options.txt index 94941537d..2706f5f95 100644 --- a/npc/craft/options.txt +++ b/npc/craft/options.txt @@ -387,10 +387,9 @@ function script csys_Multiplier { case VAR_CRITICALRATE: case DEC_SP_CONSUMPTION: case VAR_PLUSASPDPERCENT: - return 5; case VAR_MAGICATKPERCENT: case VAR_ATKPERCENT: - return 7; + return 5; case IOPT_SCRESIST_POISON: case IOPT_SCRESIST_SILENCE: case IOPT_SCRESIST_CURSE: @@ -427,15 +426,43 @@ function script csys_ArmorFix { array_remove(@csys_penalty, VAR_MDEFPOWER); // Save for csys_BonusCalc - @csysArmor=true; + @csysArmor=CSYS_ARMOR; + + // Special sets + if (compare("savior", strtolower(getitemname(getarg(0))))) + @csysArmor=@csysArmor|CSYS_SAVIOR; return; } // Update problematic bonuses for weapons // Use getiteminfo before -// csys_WeaponFix( item ) +// csys_WeaponFix( {item} ) function script csys_WeaponFix { - @csysArmor=false; + .@sub=getiteminfo(getarg(0,Acorn), ITEMINFO_SUBTYPE); + @csysArmor=0; + + // Weapon Subtype + if (.@sub == W_FIST || .@sub == W_KNUCKLE) + @csysArmor=@csysArmor|CSYS_BRAWLING; + else if (.@sub == W_2HSWORD || .@sub == W_2HSPEAR || + .@sub == W_2HAXE || .@sub == W_2HMACE || + .@sub == W_2HSTAFF) + @csysArmor=@csysArmor|CSYS_ZWEIHANDER; + else if (.@sub == W_BOW || .@sub == W_REVOLVER || + .@sub == W_RIFLE || .@sub == W_GATLING || + .@sub == W_SHOTGUN || .@sub == W_GRENADE) + @csysArmor=@csysArmor|CSYS_RANGED; + else if (.@sub == W_STAFF || .@sub == W_BOOK) + @csysArmor=@csysArmor|CSYS_MAGICAL; + else if (.@sub == W_KATAR) + @csysArmor=@csysArmor|CSYS_SPECIAL; + else + @csysArmor=@csysArmor|CSYS_OTHER; + + // Special sets + if (compare("savior", strtolower(getitemname(getarg(0))))) + @csysArmor=@csysArmor|CSYS_SAVIOR; + return; } @@ -457,8 +484,22 @@ function script csys_BonusCalc { if (.@base >= (.@avg+1)*7/10) .@base=rand2(1, .@avg+1); - // Armor? Crap it to 25% - if (@csysArmor) + // Savior Set? Effects +20% + if (@csysArmor & CSYS_SAVIOR) + .@base=max(1, .@base*6/5); + + // Attack for 2H? + if (.@var == VAR_ATKPERCENT || .@var == VAR_MAGICATKPERCENT) { + // Two Hands/Bows: x2 + if ((@csysArmor & CSYS_ZWEIHANDER) || (@csysArmor & CSYS_RANGED)) + .@base=max(1, .@base*2); + // Brawling/Magical: +80% + else if ((@csysArmor & CSYS_BRAWLING) || (@csysArmor & CSYS_MAGICAL)) + .@base=max(1, .@base*18/10); + } + + // Armor? Cap it to 25% + if (@csysArmor & CSYS_ARMOR) .@base=max(1, .@base/4); return .@base; |