diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-06-21 03:12:56 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-06-21 03:12:56 -0300 |
commit | 3b54b5d72e976737d6274ff9deeff96057db3d36 (patch) | |
tree | 9df15459e4ad4cfa95998ef812c6a62ab045bbf2 /npc | |
parent | 75b712abea826110958eb34f30372d0abc4b8e2a (diff) | |
download | serverdata-3b54b5d72e976737d6274ff9deeff96057db3d36.tar.gz serverdata-3b54b5d72e976737d6274ff9deeff96057db3d36.tar.bz2 serverdata-3b54b5d72e976737d6274ff9deeff96057db3d36.tar.xz serverdata-3b54b5d72e976737d6274ff9deeff96057db3d36.zip |
[CSys] Minor refactoring to ArmorFix - add WeaponFix
Diffstat (limited to 'npc')
-rw-r--r-- | npc/craft/options.txt | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/npc/craft/options.txt b/npc/craft/options.txt index 947a5c8ca..94941537d 100644 --- a/npc/craft/options.txt +++ b/npc/craft/options.txt @@ -409,7 +409,7 @@ function script csys_Multiplier { // Remove problematic bonuses from armors // Use getiteminfo before -// csys_ArmorFix( - ) +// csys_ArmorFix( item ) function script csys_ArmorFix { // Rare bonus if (rand2(100) >= 5) @@ -431,6 +431,14 @@ function script csys_ArmorFix { return; } +// Update problematic bonuses for weapons +// Use getiteminfo before +// csys_WeaponFix( item ) +function script csys_WeaponFix { + @csysArmor=false; + return; +} + // csys_BonusCalc( lv1, lv2, vartp ) // Calculates the due bonus function script csys_BonusCalc { @@ -472,10 +480,11 @@ function script csys_Apply { // Remove weapon-only bonuses if it is armor delinventorylist(); getinventorylist(); - if (getiteminfo(@inventorylist_id[.@id], ITEMINFO_TYPE) != IT_WEAPON) - csys_ArmorFix(); + .@itemid=@inventorylist_id[.@id]; + if (getiteminfo(.@itemid, ITEMINFO_TYPE) != IT_WEAPON) + csys_ArmorFix(.@itemid); else - @csysArmor=false; + csys_WeaponFix(.@itemid); // Shuffle the arrays array_shuffle(@csys_attr); |