summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/craft/options.txt31
1 files changed, 27 insertions, 4 deletions
diff --git a/npc/craft/options.txt b/npc/craft/options.txt
index 2442060db..f652a6103 100644
--- a/npc/craft/options.txt
+++ b/npc/craft/options.txt
@@ -198,6 +198,29 @@ function script csys_Check {
return false;
}
+// csys_Multiplier( cr_id )
+// Returns a multiplier for bonus (it can be zero)
+function script csys_Multiplier {
+ .@sk=getarg(0);
+ switch (.@sk) {
+ case IOPT_SPLASHDAMAGE:
+ return 0;
+ case IOPT_SCRESIST_POISON:
+ case IOPT_SCRESIST_SILENCE:
+ case IOPT_SCRESIST_CURSE:
+ case IOPT_SCRESIST_BLIND:
+ return 2;
+ case VAR_MAXHPAMOUNT:
+ case VAR_MAXSPAMOUNT:
+ case VAR_ITEMDEFPOWER:
+ case VAR_MDEFPOWER:
+ return 3;
+ default:
+ return 1;
+ }
+ return 0;
+}
+
// Attribute item options
// Does NOT performs success chance check, and can be used by NPC
// csys_Apply( invindex{, lvl, scope} )
@@ -222,15 +245,15 @@ function script csys_Apply {
.@slot=0;
while (.@slot < min(3, .@max_attr)) {
- // You have 100% for first bonus/onus, -20% each, depending on skill lv
- .@base=2000-(.@lv*75);
+ // You have 100% for first bonus/onus, -30% each, depending on skill lv
+ .@base=3000-(.@lv*75);
if (rand(10000) > 10000-(.@base*.@slot))
break;
// Apply a bonus using array_pop (it was shuffled so we're fine)
// A pity 1 str and 1 hp is so different.
.@vartp=array_pop(@csys_attr);
- .@bonus=rand(1, .@lv+.@lv2);
+ .@bonus=rand(1, .@lv+.@lv2)*csys_Multiplier(.@vartp)+1;
setitemoptionbyindex(.@id, .@slot, .@vartp, .@bonus);
//debugmes "Bonus applied: %d at %d (slot: %d)", .@vartp, .@bonus, .@slot;
.@slot+=1;
@@ -247,7 +270,7 @@ function script csys_Apply {
// Apply a bonus using array_pop (it was shuffled so we're fine)
// A pity 1 str and 1 hp is so different.
.@vartp=array_pop(@csys_penalty);
- .@bonus=rand(1, .@lv+.@lv2);
+ .@bonus=rand(1, .@lv+.@lv2)*csys_Multiplier(.@vartp)+1;
setitemoptionbyindex(.@id, .@slot, .@vartp, .@bonus);
.@slot+=1;
.@slt+=1;