From 3b54b5d72e976737d6274ff9deeff96057db3d36 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 21 Jun 2020 03:12:56 -0300 Subject: [CSys] Minor refactoring to ArmorFix - add WeaponFix --- npc/craft/options.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'npc/craft') 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); -- cgit v1.2.3-70-g09d2