summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-04-15 00:08:56 -0300
committerJesusaves <cpntb1@ymail.com>2019-04-15 00:08:56 -0300
commita18585d1766acf17ac72beea9aa694a46dcf2b20 (patch)
tree0d07b1b895a2cbc71c5d4e6f522e1041a9e5b94b /npc
parent7f97f3d407933342530082575a9b691498e3df3b (diff)
downloadserverdata-a18585d1766acf17ac72beea9aa694a46dcf2b20.tar.gz
serverdata-a18585d1766acf17ac72beea9aa694a46dcf2b20.tar.bz2
serverdata-a18585d1766acf17ac72beea9aa694a46dcf2b20.tar.xz
serverdata-a18585d1766acf17ac72beea9aa694a46dcf2b20.zip
Fix typo
Diffstat (limited to 'npc')
-rw-r--r--npc/items/inc_sc_bonus.txt31
1 files changed, 19 insertions, 12 deletions
diff --git a/npc/items/inc_sc_bonus.txt b/npc/items/inc_sc_bonus.txt
index c4187d4d1..ac1dd8d9b 100644
--- a/npc/items/inc_sc_bonus.txt
+++ b/npc/items/inc_sc_bonus.txt
@@ -19,31 +19,38 @@ OnUse:
if (@delay <= 0) close;
// Get the bonus value
- .@bonus=rand(@min, @max);
+ if (@min != @max)
+ .@bonus=rand(@min, @max);
+ else
+ .@bonus=any(@min, @max);
// Remaining time and effect conversion
- @v=getstatus(@type, 1);
- @t=getstatus(@type, 5);
+ .@v=getstatus(@type, 1);
+ .@t=getstatus(@type, 5);
// Convert remaining time to seconds, rounded down
- if (@t > 1000)
- @t=@t/1000;
+ if (.@t > 1000)
+ .@t=.@t/1000;
else
- @t=0;
+ .@t=0;
// If there was effect previously, get ponderate average
- if (@v > 0)
- @v=(.@bonus*@delay+@v*@t)/(@t+@delay);
+ if (.@v > 0)
+ .@v=((.@bonus*@delay)+(.@v*.@t))/(.@t+@delay);
else
- @v=.@bonus;
+ .@v=.@bonus;
// Update time value to ms and to stack
- @t+=@delay;
- @t*=1000;
+ .@t+=@delay;
+ .@t*=1000;
+
+ // Debug print if needed
+ if (debug || $@GM_OVERRIDE)
+ debugmes "Effect %d (+%d percent) for %d ms", @type, .@bonus, .@t;
// Restart the bonus
sc_end @type;
- sc_start @type,@t,@v;
+ sc_start @type,.@t,.@v;
close;
}