From 974162b9fd470b9afcb8204451dd55763febd3d7 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 24 May 2019 19:21:24 -0300 Subject: Partial Rewrite to rand_sc_heal --- npc/items/rand_sc_heal.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'npc/items/rand_sc_heal.txt') diff --git a/npc/items/rand_sc_heal.txt b/npc/items/rand_sc_heal.txt index ddb2ab194..a005bf095 100644 --- a/npc/items/rand_sc_heal.txt +++ b/npc/items/rand_sc_heal.txt @@ -86,10 +86,13 @@ OnUse: @val1 = rand(@min, @max); // Calculate delay if it was not given - if (!@delay) { + if (!@delay || @delay > 60) { @delay=1 + (@type*2); } + // Update val1 + @val1 = @val1 / @delay; + // Decide the healing bonus type. We have four types: S, L, G and M // By default, we use 'S' .@skill = SC_S_LIFEPOTION; @@ -102,13 +105,13 @@ OnUse: .@v=getstatus(.@skill, 1); .@d=getstatus(.@skill, 4); } - */ // If there WAS an effect previously, get ponderate average if (.@v > 0) { @val1=ponderate_avg(@val1, @delay, .@v, .@d); @delay=ponderate_avg(@delay, @val1, .@d, .@v); } + */ // Put the delay in ms @delay *= 1000; -- cgit v1.2.3-60-g2f50