diff options
-rw-r--r-- | npc/craft/options.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/npc/craft/options.txt b/npc/craft/options.txt index a6770c45f..22b7f8a71 100644 --- a/npc/craft/options.txt +++ b/npc/craft/options.txt @@ -567,15 +567,15 @@ function script csys_Apply { // You have 102% chance of a malus, skill and equips lower it in 0.5% each .@base=10200-(.@lv*50); - if (rand(10000) > .@base) - break; - - // Apply a malus using array_pop (it was shuffled so we're fine) - .@vartp=array_pop(@csys_penalty); - .@malus=csys_BonusCalc(.@lv, .@lv2, .@vartp); - .@malus=.@malus*70/100; - setitemoptionbyindex(.@id, .@slot, .@vartp, -(.@malus)); - .@slot+=1; + if (rand(10000) < .@base && .@max_pena) { + // Apply a malus using array_pop (it was shuffled so we're fine) + .@vartp=array_pop(@csys_penalty); + .@malus=csys_BonusCalc(.@lv, .@lv2, .@vartp); + .@malus=.@malus*70/100; + if (.@vartp > 0 && .@malus > 0) + setitemoptionbyindex(.@id, .@slot, .@vartp, -(.@malus)); + .@slot+=1; + } // The options have been attributed, clear temporary variables @csysArmor=false; |