summaryrefslogtreecommitdiff
path: root/npc/craft/options.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-26 10:49:59 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-26 10:49:59 -0300
commit2133b7f03c15ecf058a84f9551cb5644ff822d25 (patch)
tree67e6bcae12d46a2d88904a170fd560fea2515bcc /npc/craft/options.txt
parent7e677a902fd3c537513973f879d401ba5edb7863 (diff)
downloadserverdata-2133b7f03c15ecf058a84f9551cb5644ff822d25.tar.gz
serverdata-2133b7f03c15ecf058a84f9551cb5644ff822d25.tar.bz2
serverdata-2133b7f03c15ecf058a84f9551cb5644ff822d25.tar.xz
serverdata-2133b7f03c15ecf058a84f9551cb5644ff822d25.zip
Avoid possible bugs
Diffstat (limited to 'npc/craft/options.txt')
-rw-r--r--npc/craft/options.txt18
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;