summaryrefslogtreecommitdiff
path: root/npc/craft/options.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-28 10:49:17 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-28 10:49:17 -0300
commit9d868fff658a4038fa2c6d5a65f9b7355801edbf (patch)
tree11a436a3bc1ea14f9b3ba0f45abc2043f30ea0c1 /npc/craft/options.txt
parent7bc379d449dd64acfb1ba7358f4efe78dcf1fb90 (diff)
downloadserverdata-9d868fff658a4038fa2c6d5a65f9b7355801edbf.tar.gz
serverdata-9d868fff658a4038fa2c6d5a65f9b7355801edbf.tar.bz2
serverdata-9d868fff658a4038fa2c6d5a65f9b7355801edbf.tar.xz
serverdata-9d868fff658a4038fa2c6d5a65f9b7355801edbf.zip
Option Bonus Multipliers.
Diffstat (limited to 'npc/craft/options.txt')
-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;